added nvimtree and toggleterm

This commit is contained in:
Nikurasu 2022-12-23 15:52:20 +01:00
parent adefa5ce2a
commit 45a17fe9df
6 changed files with 46 additions and 2 deletions

View file

@ -61,6 +61,8 @@ vim.cmd [[colorscheme base16-tomorrow-night-eighties]]
-- Set completeopt to have a better completion experience -- Set completeopt to have a better completion experience
vim.o.completeopt = 'menuone,noselect' vim.o.completeopt = 'menuone,noselect'
vim.g.loaded_netrw = 1
-- [[ Basic Keymaps ]] -- [[ Basic Keymaps ]]
-- Set <space> as the leader key -- Set <space> as the leader key
-- See `:help mapleader` -- See `:help mapleader`
@ -82,6 +84,8 @@ vim.keymap.set('n', ']d', vim.diagnostic.goto_next)
vim.keymap.set('n', '<leader>e', vim.diagnostic.open_float) vim.keymap.set('n', '<leader>e', vim.diagnostic.open_float)
vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist) vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist)
local api = require("nvim-tree.api")
vim.keymap.set('n', '<leader>ft', api.tree.toggle)
require('plugins') require('plugins')
-- LSP settings. -- LSP settings.
@ -132,3 +136,6 @@ end
-- nvim-cmp supports additional completion capabilities, so broadcast that to servers -- nvim-cmp supports additional completion capabilities, so broadcast that to servers
local capabilities = vim.lsp.protocol.make_client_capabilities() local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities) capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities)
-- disable some stock plugins
vim.g.loaded_netrwPlugin = 1

View file

@ -0,0 +1 @@
local db = require('dashboard')

View file

@ -6,4 +6,7 @@ require('plugins.gitsigns')
require('plugins.treesitter') require('plugins.treesitter')
require('plugins.mason') require('plugins.mason')
require('plugins.fidget') require('plugins.fidget')
require('plugins.cmp') require('plugins.cmp')
require('plugins.nvim-tree')
require('plugins.toggleterm')
require('plugins.dashboard')

View file

@ -0,0 +1,5 @@
require("nvim-tree").setup({
filters = {
dotfiles = true,
},
})

View file

@ -39,11 +39,26 @@ require('packer').startup(function(use)
'nvim-treesitter/nvim-treesitter-textobjects', 'nvim-treesitter/nvim-treesitter-textobjects',
after = 'nvim-treesitter', after = 'nvim-treesitter',
} }
use {
'nvim-tree/nvim-tree.lua',
requires = {
'nvim-tree/nvim-web-devicons', -- optional, for file icons
},
}
use {
'akinsho/toggleterm.nvim'
}
use { -- rainbow brackets using treesitter use { -- rainbow brackets using treesitter
'p00f/nvim-ts-rainbow', 'p00f/nvim-ts-rainbow',
after = 'nvim-treesitter' after = 'nvim-treesitter'
} }
use {
'glepnir/dashboard-nvim'
}
-- Git related plugins -- Git related plugins
use 'tpope/vim-fugitive' use 'tpope/vim-fugitive'
@ -58,4 +73,4 @@ require('packer').startup(function(use)
if is_bootstrap then if is_bootstrap then
require('packer').sync() require('packer').sync()
end end
end) end)

View file

@ -0,0 +1,13 @@
require("toggleterm").setup({
open_mapping = [[<leader>tt]]
})
vim.cmd "autocmd! TermOpen term://* lua set_terminal_keymaps()"
local Terminal = require("toggleterm.terminal").Terminal
local lazygit = Terminal:new { cmd = 'lazygit', hidden = true, direction = 'float' }
function _LAZYGIT_TOGGLE()
lazygit:toggle()
end