diff options
author | Bobby Bingham <koorogi@koorogi.info> | 2022-02-07 17:58:08 -0600 |
---|---|---|
committer | Bobby Bingham <koorogi@koorogi.info> | 2022-02-07 17:58:08 -0600 |
commit | 26275d8001dc39f7b47074cd357be9daee40ba49 (patch) | |
tree | e3bc6a3d3090d0fe5e6401e571ce6fd397e3d874 /nvim | |
parent | 322b066c492e8ca4001b85de2c2dce24a19d859e (diff) |
nvim: add neotree
Diffstat (limited to 'nvim')
-rw-r--r-- | nvim/.config/nvim/lua/neotree_config.lua | 93 | ||||
-rw-r--r-- | nvim/.config/nvim/lua/plugins.lua | 10 |
2 files changed, 103 insertions, 0 deletions
diff --git a/nvim/.config/nvim/lua/neotree_config.lua b/nvim/.config/nvim/lua/neotree_config.lua new file mode 100644 index 0000000..12dd435 --- /dev/null +++ b/nvim/.config/nvim/lua/neotree_config.lua @@ -0,0 +1,93 @@ +require("neo-tree").setup({ + enable_git_status = true, + filesystem = { + filters = { --These filters are applied to both browsing and searching + show_hidden = false, + respect_gitignore = true, + }, + + -- This will find and focus the file in the + -- active buffer every time the current file is changed while the tree is open. + follow_current_file = true, + + -- This will use the OS level file watchers + -- to detect changes instead of relying on nvim autocmd events. + use_libuv_file_watcher = true, + + window = { + position = "left", + width = 40, + mappings = { + ["<2-LeftMouse>"] = "open", + ["<cr>"] = "open", + ["S"] = "open_split", + ["s"] = "open_vsplit", + ["C"] = "close_node", + ["<bs>"] = "navigate_up", + ["."] = "set_root", + ["H"] = "toggle_hidden", + ["I"] = "toggle_gitignore", + ["R"] = "refresh", + ["/"] = "filter_as_you_type", + --["/"] = "none" -- Assigning a key to "none" will remove the default mapping + ["f"] = "filter_on_submit", + ["<c-x>"] = "clear_filter", + ["a"] = "add", + ["d"] = "delete", + ["r"] = "rename", + ["c"] = "copy_to_clipboard", + ["x"] = "cut_to_clipboard", + ["p"] = "paste_from_clipboard", + ["bd"] = "buffer_delete", + } + } + }, + buffers = { + show_unloaded = true, + window = { + position = "left", + mappings = { + ["<2-LeftMouse>"] = "open", + ["<cr>"] = "open", + ["S"] = "open_split", + ["s"] = "open_vsplit", + ["<bs>"] = "navigate_up", + ["."] = "set_root", + ["R"] = "refresh", + ["a"] = "add", + ["d"] = "delete", + ["r"] = "rename", + ["c"] = "copy_to_clipboard", + ["x"] = "cut_to_clipboard", + ["p"] = "paste_from_clipboard", + } + }, + }, + git_status = { + window = { + position = "float", + mappings = { + ["<2-LeftMouse>"] = "open", + ["<cr>"] = "open", + ["S"] = "open_split", + ["s"] = "open_vsplit", + ["C"] = "close_node", + ["R"] = "refresh", + ["d"] = "delete", + ["r"] = "rename", + ["c"] = "copy_to_clipboard", + ["x"] = "cut_to_clipboard", + ["p"] = "paste_from_clipboard", + ["A"] = "git_add_all", + ["gu"] = "git_unstage_file", + ["ga"] = "git_add_file", + ["gr"] = "git_revert_file", + ["gc"] = "git_commit", + ["gp"] = "git_push", + ["gg"] = "git_commit_and_push", + } + } + } +}) + +vim.cmd([[nnoremap \ :NeoTreeReveal<cr>]]) diff --git a/nvim/.config/nvim/lua/plugins.lua b/nvim/.config/nvim/lua/plugins.lua index 3ae9936..da0097f 100644 --- a/nvim/.config/nvim/lua/plugins.lua +++ b/nvim/.config/nvim/lua/plugins.lua @@ -35,5 +35,15 @@ return require('packer').startup(function() 'neovim/nvim-lspconfig', config = function() require('lsp_config') end } + + use { + 'nvim-neo-tree/neo-tree.nvim', + requires = { + 'nvim-lua/plenary.nvim', + 'kyazdani42/nvim-web-devicons', + 'MunifTanjim/nui.nvim' + }, + config = function() require('neotree_config') end + } end) |