diff --git a/lua/my_plugins.lua b/lua/my_plugins.lua index 54e4361..880b5ea 100644 --- a/lua/my_plugins.lua +++ b/lua/my_plugins.lua @@ -112,7 +112,7 @@ return require('packer').startup(function() config = get_setup('nvim-autopairs'), }) use({ 'ray-x/lsp_signature.nvim' }) - use({ + use({ 's1n7ax/nvim-terminal', config = get_setup('terminal') }) @@ -139,6 +139,15 @@ return require('packer').startup(function() 'nvim-treesitter/nvim-treesitter-textobjects', requires = 'nvim-treesitter/nvim-treesitter', }) + use({ + 'nvim-neo-tree/neo-tree.nvim', + requires = { + 'nvim-lua/plenary.nvim', + 'kyazdani42/nvim-web-devicons', -- not strictly required, but recommended + 'MunifTanjim/nui.nvim', + }, + config = get_setup('neo-tree') + }) use({ 'mvllow/modes.nvim', config = function() diff --git a/lua/setup/neo-tree.lua b/lua/setup/neo-tree.lua new file mode 100644 index 0000000..67ee796 --- /dev/null +++ b/lua/setup/neo-tree.lua @@ -0,0 +1,54 @@ +-- If you want icons for diagnostic errors, you'll need to define them somewhere: +vim.fn.sign_define('DiagnosticSignError', { text = ' ', texthl = 'DiagnosticSignError' }) +vim.fn.sign_define('DiagnosticSignWarn', { text = ' ', texthl = 'DiagnosticSignWarn' }) +vim.fn.sign_define('DiagnosticSignInfo', { text = ' ', texthl = 'DiagnosticSignInfo' }) +vim.fn.sign_define('DiagnosticSignHint', { text = '', texthl = 'DiagnosticSignHint' }) + +local utils = require('utils') + +require('neo-tree').setup({ + window = { -- see https://github.com/MunifTanjim/nui.nvim/tree/main/lua/nui/popup for + -- possible options. These can also be functions that return these options. + position = 'float', -- left, right, float, current + width = 40, -- applies to left and right positions + popup = { -- settings that apply to float position only + size = { + height = '80%', + width = '50%', + }, + position = '50%', -- 50% means center it + -- you can also specify border here, if you want a different setting from + -- the global popup_border_style. + }, + -- Mappings for tree window. See `:h nep-tree-mappings` for a list of built-in commands. + -- You can also create your own commands by providing a function instead of a string. + mappings = { + [''] = 'toggle_node', + ['<2-LeftMouse>'] = 'open', + [''] = 'open', + ['s'] = 'open_split', + ['v'] = 'open_vsplit', + ['C'] = 'close_node', + ['z'] = 'close_all_nodes', + ['R'] = 'refresh', + ['a'] = 'add', + ['A'] = 'add_directory', + ['d'] = 'delete', + ['r'] = 'rename', + ['y'] = 'copy_to_clipboard', + ['x'] = 'cut_to_clipboard', + ['p'] = 'paste_from_clipboard', + ['c'] = 'copy', -- takes text input for destination + ['m'] = 'move', -- takes text input for destination + ['q'] = 'close_window', + }, + }, + filesystem = { + filtered_items = { + hide_dotfiles = false, + hide_gitignored = false, + }, + } +}) +utils.map('n', '\\', 'Neotree reveal') +utils.map('n', 'b', 'Neotree buffers')