Added nvim tree

This commit is contained in:
Prajakt Shastry 2023-04-20 20:13:01 -04:00
parent 9924f7e0a0
commit 73f450bc2d
1 changed files with 16 additions and 2 deletions

View File

@ -184,6 +184,9 @@ require('lazy').setup({
-- --
-- An additional note is that if you only copied in the `init.lua`, you can just comment this line -- An additional note is that if you only copied in the `init.lua`, you can just comment this line
-- to get rid of the warning telling you that there are not plugins in `lua/custom/plugins/`. -- to get rid of the warning telling you that there are not plugins in `lua/custom/plugins/`.
{'towolf/vim-helm'},
{'nvim-tree/nvim-tree.lua'},
{'nvim-tree/nvim-web-devicons'},
{ import = 'custom.plugins' }, { import = 'custom.plugins' },
}, {}) }, {})
@ -238,6 +241,8 @@ vim.keymap.set({ 'n', 'v' }, '<Space>', '<Nop>', { silent = true })
vim.keymap.set('n', 'k', "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true }) vim.keymap.set('n', 'k', "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true })
vim.keymap.set('n', 'j', "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true }) vim.keymap.set('n', 'j', "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true })
--- Autocommands
-- [[ Highlight on yank ]] -- [[ Highlight on yank ]]
-- See `:help vim.highlight.on_yank()` -- See `:help vim.highlight.on_yank()`
local highlight_group = vim.api.nvim_create_augroup('YankHighlight', { clear = true }) local highlight_group = vim.api.nvim_create_augroup('YankHighlight', { clear = true })
@ -282,11 +287,20 @@ vim.keymap.set('n', '<leader>sw', require('telescope.builtin').grep_string, { de
vim.keymap.set('n', '<leader>sg', require('telescope.builtin').live_grep, { desc = '[S]earch by [G]rep' }) vim.keymap.set('n', '<leader>sg', require('telescope.builtin').live_grep, { desc = '[S]earch by [G]rep' })
vim.keymap.set('n', '<leader>sd', require('telescope.builtin').diagnostics, { desc = '[S]earch [D]iagnostics' }) vim.keymap.set('n', '<leader>sd', require('telescope.builtin').diagnostics, { desc = '[S]earch [D]iagnostics' })
-- [[ Configure NvimTree ]]
require("nvim-tree").setup()
vim.keymap.set('n', '<leader>e', ":NvimTreeToggle<cr>", { desc = 'Toggle NvimTree' })
vim.keymap.set('n', '<leader>ef', ':NvimTreeFindFile<cr>', { desc = 'Find file' })
vim.keymap.set('n', '<C-h>', '<C-n><left>')
vim.keymap.set('n', '<C-j>', '<C-n><up>')
vim.keymap.set('n', '<C-k>', '<C-n><down>')
vim.keymap.set('n', '<C-l>', '<C-n><right>')
-- [[ Configure Treesitter ]] -- [[ Configure Treesitter ]]
-- See `:help nvim-treesitter` -- See `:help nvim-treesitter`
require('nvim-treesitter.configs').setup { require('nvim-treesitter.configs').setup {
-- Add languages to be installed here that you want installed for treesitter -- Add languages to be installed here that you want installed for treesitter
ensure_installed = { 'c', 'cpp', 'go', 'lua', 'python', 'rust', 'tsx', 'typescript', 'vimdoc', 'vim' }, ensure_installed = { 'c', 'cpp', 'go', 'lua', 'python', 'rust', 'tsx', 'typescript', 'vimdoc', 'vim', 'terraform' },
-- Autoinstall languages that are not installed. Defaults to false (but you can change for yourself!) -- Autoinstall languages that are not installed. Defaults to false (but you can change for yourself!)
auto_install = false, auto_install = false,
@ -331,7 +345,7 @@ require('nvim-treesitter.configs').setup {
['[m'] = '@function.outer', ['[m'] = '@function.outer',
['[['] = '@class.outer', ['[['] = '@class.outer',
}, },
goto_previous_end = { goto_previousqend = {
['[M'] = '@function.outer', ['[M'] = '@function.outer',
['[]'] = '@class.outer', ['[]'] = '@class.outer',
}, },