From e422f901f5769200762d1e4a0b21f21ae0940f3e Mon Sep 17 00:00:00 2001 From: RageCage64 Date: Wed, 6 Mar 2024 08:39:09 -0500 Subject: [PATCH] Added a filetree eat your heart out Primeagen --- nvim/after/plugin/neotree.lua | 35 ++++++++++ nvim/lua/RageCage64/packer.lua | 112 ++++++++++++++++++-------------- nvim/lua/RageCage64/remap.lua | 4 ++ nvim/plugin/packer_compiled.lua | 10 +++ 4 files changed, 111 insertions(+), 50 deletions(-) create mode 100644 nvim/after/plugin/neotree.lua diff --git a/nvim/after/plugin/neotree.lua b/nvim/after/plugin/neotree.lua new file mode 100644 index 0000000..891aa7f --- /dev/null +++ b/nvim/after/plugin/neotree.lua @@ -0,0 +1,35 @@ +require("neo-tree").setup({ + close_if_last_window = true, + enable_git_status = true, + default_component_configs = { + icon = { + folder_closed = "+", + folder_open = "-", + folder_empty = "", + -- The next two settings are only a fallback, if you use nvim-web-devicons and configure default icons there + -- then these will never be used. + default = " ", + highlight = "NeoTreeFileIcon" + }, + name = { + trailing_slash = false, + use_git_status_colors = true, + highlight = "NeoTreeFileName", + }, + git_status = { + symbols = { + -- Change type + added = "", -- or "✚", but this is redundant info if you use git_status_colors on the name + modified = "", -- or "", but this is redundant info if you use git_status_colors on the name + deleted = "", -- this can only be used in the git_status source + renamed = "", -- this can only be used in the git_status source + -- Status type + untracked = "", + ignored = "", + unstaged = "", + staged = "", + conflict = "", + } + }, + }, +}) diff --git a/nvim/lua/RageCage64/packer.lua b/nvim/lua/RageCage64/packer.lua index 5eec189..8868a22 100644 --- a/nvim/lua/RageCage64/packer.lua +++ b/nvim/lua/RageCage64/packer.lua @@ -1,54 +1,66 @@ vim.cmd [[packadd packer.nvim]] return require('packer').startup(function(use) - use 'wbthomason/packer.nvim' - - -- Navigation - use { - 'nvim-telescope/telescope.nvim', tag = '0.1.5', - -- or , branch = '0.1.x', - requires = { { 'nvim-lua/plenary.nvim' } } - } - - -- Colours - use('ellisonleao/gruvbox.nvim') - use({ 'rose-pine/neovim', as = 'rose-pine' }) - use({ 'bluz71/vim-moonfly-colors', as = 'moonfly' }) - - -- Treesitter - use('nvim-treesitter/nvim-treesitter', { run = ':TSUpdate' }) - use('nvim-treesitter/playground') - - -- Editing - use('mbbill/undotree') - use('tpope/vim-surround') - use('tpope/vim-commentary') - - -- LSP - use { - 'VonHeikemen/lsp-zero.nvim', - branch = 'v2.x', - requires = { - -- LSP Support - { 'neovim/nvim-lspconfig' }, -- Required - { - -- Optional - 'williamboman/mason.nvim', - run = function() - vim.cmd [[MasonUpdate]] - end, - }, - { 'williamboman/mason-lspconfig.nvim' }, -- Optional - - -- Autocompletion - { 'hrsh7th/nvim-cmp' }, -- Required - { 'hrsh7th/cmp-nvim-lsp' }, -- Required - { 'L3MON4D3/LuaSnip' }, -- Required - }, - - use('editorconfig/editorconfig-vim'), - - -- For centering when I'm writing documents - use { 'smithbm2316/centerpad.nvim' } - } + use 'wbthomason/packer.nvim' + + -- Navigation + use { + 'nvim-telescope/telescope.nvim', tag = '0.1.5', + -- or , branch = '0.1.x', + requires = { { 'nvim-lua/plenary.nvim' } } + } + + -- Colours + use('ellisonleao/gruvbox.nvim') + use({ 'rose-pine/neovim', as = 'rose-pine' }) + use({ 'bluz71/vim-moonfly-colors', as = 'moonfly' }) + + -- Treesitter + use('nvim-treesitter/nvim-treesitter', { run = ':TSUpdate' }) + use('nvim-treesitter/playground') + + -- Editing + use('mbbill/undotree') + use('tpope/vim-surround') + use('tpope/vim-commentary') + + -- LSP + use { + 'VonHeikemen/lsp-zero.nvim', + branch = 'v2.x', + requires = { + -- LSP Support + { 'neovim/nvim-lspconfig' }, -- Required + { + -- Optional + 'williamboman/mason.nvim', + run = function() + vim.cmd [[MasonUpdate]] + end, + }, + { 'williamboman/mason-lspconfig.nvim' }, -- Optional + + -- Autocompletion + { 'hrsh7th/nvim-cmp' }, -- Required + { 'hrsh7th/cmp-nvim-lsp' }, -- Required + { 'L3MON4D3/LuaSnip' }, -- Required + }, + + use('editorconfig/editorconfig-vim'), + + } + + -- Document writing + use { 'smithbm2316/centerpad.nvim' } + + -- Tree + use { + "nvim-neo-tree/neo-tree.nvim", + branch = "v3.x", + requires = { + "nvim-lua/plenary.nvim", + "MunifTanjim/nui.nvim", + -- "3rd/image.nvim", -- Optional image support in preview window: See `# Preview Mode` for more information + }, + } end) diff --git a/nvim/lua/RageCage64/remap.lua b/nvim/lua/RageCage64/remap.lua index f232b39..75392a1 100644 --- a/nvim/lua/RageCage64/remap.lua +++ b/nvim/lua/RageCage64/remap.lua @@ -54,4 +54,8 @@ function WritingMode() vim.opt.wrap = not vim.opt.wrap end +-- Writing vim.keymap.set('n', 'z', ':lua WritingMode()') + +-- Tree +vim.keymap.set("n", "nt", ":Neotree toggle") diff --git a/nvim/plugin/packer_compiled.lua b/nvim/plugin/packer_compiled.lua index 264f0f8..55f95fe 100644 --- a/nvim/plugin/packer_compiled.lua +++ b/nvim/plugin/packer_compiled.lua @@ -119,6 +119,16 @@ _G.packer_plugins = { path = "/home/braydonk/.local/share/nvim/site/pack/packer/start/moonfly", url = "https://github.com/bluz71/vim-moonfly-colors" }, + ["neo-tree.nvim"] = { + loaded = true, + path = "/home/braydonk/.local/share/nvim/site/pack/packer/start/neo-tree.nvim", + url = "https://github.com/nvim-neo-tree/neo-tree.nvim" + }, + ["nui.nvim"] = { + loaded = true, + path = "/home/braydonk/.local/share/nvim/site/pack/packer/start/nui.nvim", + url = "https://github.com/MunifTanjim/nui.nvim" + }, ["nvim-cmp"] = { loaded = true, path = "/home/braydonk/.local/share/nvim/site/pack/packer/start/nvim-cmp",