From bb51bf2e747aa5fe9c096ce53627b356c32f76f9 Mon Sep 17 00:00:00 2001 From: The-Repo-Club Date: Sun, 30 Jul 2023 18:23:57 +0100 Subject: [PATCH] Update NVim --- nvim/.config/nvim/init.lua | 1 - nvim/.config/nvim/lua/user/bufferline.lua | 10 +- nvim/.config/nvim/lua/user/nvim-tree.lua | 67 ------- nvim/.config/nvim/lua/user/plugins.lua | 185 +++++++++---------- nvim/.config/nvim/lua/user/whichkey.lua | 2 +- nvim/.config/nvim/plugin/packer_compiled.lua | 5 - 6 files changed, 99 insertions(+), 171 deletions(-) delete mode 100644 nvim/.config/nvim/lua/user/nvim-tree.lua diff --git a/nvim/.config/nvim/init.lua b/nvim/.config/nvim/init.lua index b6a832c92..e9edd26cf 100644 --- a/nvim/.config/nvim/init.lua +++ b/nvim/.config/nvim/init.lua @@ -10,7 +10,6 @@ require "user.treesitter" require "user.autopairs" require "user.comment" require "user.gitsigns" -require "user.nvim-tree" require "user.bufferline" require "user.lualine" require "user.toggleterm" diff --git a/nvim/.config/nvim/lua/user/bufferline.lua b/nvim/.config/nvim/lua/user/bufferline.lua index 1c006075f..2f38f6957 100644 --- a/nvim/.config/nvim/lua/user/bufferline.lua +++ b/nvim/.config/nvim/lua/user/bufferline.lua @@ -17,7 +17,7 @@ bufferline.setup({ icon = "▎", style = "icon", }, - buffer_close_icon = "", + buffer_close_icon = "󰅖", -- buffer_close_icon = '', modified_icon = "●", close_icon = "", @@ -76,7 +76,7 @@ bufferline.setup({ }, highlights = { fill = { - fg = { attribute = "fg", highlight = "#ff0000" }, + fg = { attribute = "fg", highlight = "TabLine" }, bg = { attribute = "bg", highlight = "TabLine" }, }, background = { @@ -85,8 +85,10 @@ bufferline.setup({ }, buffer_selected = { - fg = { attribute = "fg", highlight = "#ff0000" }, - bg = { attribute = "bg", highlight = "#0000ff" }, + fg = { attribute = "fg", highlight = "TabLine" }, + bg = { attribute = "bg", highlight = "TabLine" }, + bold = false, + italic = false, }, buffer_visible = { diff --git a/nvim/.config/nvim/lua/user/nvim-tree.lua b/nvim/.config/nvim/lua/user/nvim-tree.lua deleted file mode 100644 index e568db6f6..000000000 --- a/nvim/.config/nvim/lua/user/nvim-tree.lua +++ /dev/null @@ -1,67 +0,0 @@ -local status_ok, nvim_tree = pcall(require, "nvim-tree") -if not status_ok then - return -end - -local config_status_ok, nvim_tree_config = pcall(require, "nvim-tree.config") -if not config_status_ok then - return -end - -local tree_cb = nvim_tree_config.nvim_tree_callback - -nvim_tree.setup({ - update_focused_file = { - enable = true, - update_cwd = true, - }, - renderer = { - root_folder_modifier = ":t", - icons = { - glyphs = { - default = "", - symlink = "", - folder = { - arrow_open = "", - arrow_closed = "", - default = "", - open = "", - empty = "", - empty_open = "", - symlink = "", - symlink_open = "", - }, - git = { - unstaged = "", - staged = "S", - unmerged = "", - renamed = "➜", - untracked = "U", - deleted = "", - ignored = "◌", - }, - }, - }, - }, - diagnostics = { - enable = true, - show_on_dirs = true, - icons = { - hint = "", - info = "", - warning = "", - error = "", - }, - }, - view = { - width = 40, - side = "left", - mappings = { - list = { - { key = { "l", "", "o" }, cb = tree_cb("edit") }, - { key = "h", cb = tree_cb("close_node") }, - { key = "v", cb = tree_cb("vsplit") }, - }, - }, - }, -}) diff --git a/nvim/.config/nvim/lua/user/plugins.lua b/nvim/.config/nvim/lua/user/plugins.lua index 0019ab3a2..78c1a44c1 100644 --- a/nvim/.config/nvim/lua/user/plugins.lua +++ b/nvim/.config/nvim/lua/user/plugins.lua @@ -1,139 +1,138 @@ local fn = vim.fn -- Install packer -local install_path = vim.fn.stdpath 'data' .. '/site/pack/packer/start/packer.nvim' +local install_path = vim.fn.stdpath 'data' .. + '/site/pack/packer/start/packer.nvim' local is_bootstrap = false if vim.fn.empty(vim.fn.glob(install_path)) > 0 then - is_bootstrap = true - vim.fn.execute('!git clone https://github.com/wbthomason/packer.nvim ' .. install_path) - vim.cmd [[packadd packer.nvim]] + is_bootstrap = true + vim.fn.execute('!git clone https://github.com/wbthomason/packer.nvim ' .. + install_path) + vim.cmd [[packadd packer.nvim]] end -- Autocommand that reloads neovim whenever you save the plugins.lua file vim.api.nvim_create_autocmd("BufWritePost", { - group = vim.api.nvim_create_augroup("packer_user_config", { clear = true }), - pattern = "plugins.lua", - callback = function() - vim.cmd("source ") - require("packer").sync() - end, + group = vim.api.nvim_create_augroup("packer_user_config", {clear = true}), + pattern = "plugins.lua", + callback = function() + vim.cmd("source ") + require("packer").sync() + end }) -- Use a protected call so we don't error out on first use local status_ok, packer = pcall(require, "packer") -if not status_ok then - return -end +if not status_ok then return end -- Have packer use a popup window packer.init({ - display = { - open_fn = function() - return require("packer.util").float({ border = "rounded" }) - end, - }, + display = { + open_fn = function() + return require("packer.util").float({border = "rounded"}) + end + } }) -- Install your plugins here return packer.startup(function(use) - -- My plugins here + -- My plugins here - use({ "wbthomason/packer.nvim" }) -- Have packer manage itself - use({ "windwp/nvim-autopairs" }) -- Autopairs, integrates with both cmp and treesitter - use({ "numToStr/Comment.nvim" }) - use({ "JoosepAlviste/nvim-ts-context-commentstring" }) - use({ "kyazdani42/nvim-web-devicons" }) - use({ "kyazdani42/nvim-tree.lua" }) - use({ "akinsho/bufferline.nvim" }) - use({ "moll/vim-bbye" }) - use({ "nvim-lualine/lualine.nvim" }) - use({ "akinsho/toggleterm.nvim" }) - use({ "ahmedkhalf/project.nvim" }) - use({ "lewis6991/impatient.nvim" }) - use({ "lukas-reineke/indent-blankline.nvim" }) - use({ "goolord/alpha-nvim" }) - use({ "folke/which-key.nvim" }) + use({"wbthomason/packer.nvim"}) -- Have packer manage itself + use({"windwp/nvim-autopairs"}) -- Autopairs, integrates with both cmp and treesitter + use({"numToStr/Comment.nvim"}) + use({"JoosepAlviste/nvim-ts-context-commentstring"}) + use({"kyazdani42/nvim-web-devicons"}) + use({"akinsho/bufferline.nvim"}) + use({"moll/vim-bbye"}) + use({"nvim-lualine/lualine.nvim"}) + use({"akinsho/toggleterm.nvim"}) + use({"ahmedkhalf/project.nvim"}) + use({"lewis6991/impatient.nvim"}) + use({"lukas-reineke/indent-blankline.nvim"}) + use({"goolord/alpha-nvim"}) + use({"folke/which-key.nvim"}) - -- Colorschemes - use({ "folke/tokyonight.nvim" }) - use({ "Minimal-Mistakes/minimalmistakes-nvim" }) + -- Colorschemes + use({"folke/tokyonight.nvim"}) + use({"Minimal-Mistakes/minimalmistakes-nvim"}) - -- CMP plugins - use { -- Autocompletion - 'hrsh7th/nvim-cmp', - requires = { - 'hrsh7th/cmp-buffer', -- buffer completions - 'hrsh7th/cmp-cmdline', -- cmdline completions - 'hrsh7th/cmp-path', -- path completions - 'hrsh7th/cmp-nvim-lsp', - 'hrsh7th/cmp-nvim-lua', - 'L3MON4D3/LuaSnip', -- snippet engine - 'rafamadriz/friendly-snippets', -- a bunch of snippets to use - 'saadparwaiz1/cmp_luasnip' - }, - } + -- CMP plugins + use { -- Autocompletion + 'hrsh7th/nvim-cmp', + requires = { + 'hrsh7th/cmp-buffer', -- buffer completions + 'hrsh7th/cmp-cmdline', -- cmdline completions + 'hrsh7th/cmp-path', -- path completions + 'hrsh7th/cmp-nvim-lsp', 'hrsh7th/cmp-nvim-lua', 'L3MON4D3/LuaSnip', -- snippet engine + 'rafamadriz/friendly-snippets', -- a bunch of snippets to use + 'saadparwaiz1/cmp_luasnip' + } + } - -- LSP - use({ -- LSP Configuration & Plugins + -- LSP + use({ -- LSP Configuration & Plugins "neovim/nvim-lspconfig", requires = { - -- Automatically install LSPs to stdpath for neovim - 'williamboman/mason.nvim', - 'williamboman/mason-lspconfig.nvim', + -- Automatically install LSPs to stdpath for neovim + 'williamboman/mason.nvim', 'williamboman/mason-lspconfig.nvim', - -- Useful status updates for LSP - 'j-hui/fidget.nvim', - }, + -- Useful status updates for LSP + 'j-hui/fidget.nvim' + } }) -- enable LSP - use({ "jose-elias-alvarez/null-ls.nvim" }) -- for formatters and linters + use { + 'j-hui/fidget.nvim', + tag = 'legacy', + } + use({"jose-elias-alvarez/null-ls.nvim"}) -- for formatters and linters - -- Telescope Fuzzy Finder (files, lsp, etc) - use({ "nvim-telescope/telescope.nvim", - requires = { - 'nvim-lua/plenary.nvim' } - }) + -- Telescope Fuzzy Finder (files, lsp, etc) + use({"nvim-telescope/telescope.nvim", requires = {'nvim-lua/plenary.nvim'}}) -- Fuzzy Finder Algorithm which requires local dependencies to be built. Only load if `make` is available - use { 'nvim-telescope/telescope-fzf-native.nvim', run = 'make', cond = vim.fn.executable 'make' == 1 } + use { + 'nvim-telescope/telescope-fzf-native.nvim', + run = 'make', + cond = vim.fn.executable 'make' == 1 + } - -- Treesitter - use { -- Highlight, edit, and navigate code + -- Treesitter + use { -- Highlight, edit, and navigate code 'nvim-treesitter/nvim-treesitter', run = function() - pcall(require('nvim-treesitter.install').update { with_sync = true }) - end, + pcall(require('nvim-treesitter.install').update {with_sync = true}) + end } use { -- Additional text objects via treesitter 'nvim-treesitter/nvim-treesitter-textobjects', - after = 'nvim-treesitter', + after = 'nvim-treesitter' } - -- Git - use({ "tpope/vim-fugitive" }) - use({ "tpope/vim-rhubarb" }) - use({ "lewis6991/gitsigns.nvim" }) + -- Git + use({"tpope/vim-fugitive"}) + use({"tpope/vim-rhubarb"}) + use({"lewis6991/gitsigns.nvim"}) - -- Custom - use({ "wesleimp/stylua.nvim" }) - use({ "cappyzawa/trim.nvim" }) - use({ "ap/vim-css-color" }) - use({ "airblade/vim-gitgutter" }) - use({ "ctrlpvim/ctrlp.vim" }) - use({ "lyuts/vim-rtags" }) - use({ "wakatime/vim-wakatime" }) - use({ "mboughaba/i3config.vim" }) - use({ "The-Repo-Club/header.nvim" }) - use({ "The-Repo-Club/Vim_Keys" }) - use({ "Thyrum/vim-stabs" }) - use({ "mbbill/undotree" }) - use({ "tpope/vim-sleuth" }) -- Detect tabstop and shiftwidth automatically + -- Custom + use({"wesleimp/stylua.nvim"}) + use({"cappyzawa/trim.nvim"}) + use({"ap/vim-css-color"}) + use({"airblade/vim-gitgutter"}) + use({"ctrlpvim/ctrlp.vim"}) + use({"lyuts/vim-rtags"}) + use({"wakatime/vim-wakatime"}) + use({"mboughaba/i3config.vim"}) + use({"The-Repo-Club/header.nvim"}) + use({"The-Repo-Club/Vim_Keys"}) + use({"Thyrum/vim-stabs"}) + use({"mbbill/undotree"}) + use({"tpope/vim-sleuth"}) -- Detect tabstop and shiftwidth automatically -- When we are bootstrapping a configuration, it doesn't -- make sense to execute the rest of the init.lua. -- You'll need to restart nvim, and then it will work. - if is_bootstrap then - require("packer").sync() - end -end) \ No newline at end of file + if is_bootstrap then require("packer").sync() end +end) diff --git a/nvim/.config/nvim/lua/user/whichkey.lua b/nvim/.config/nvim/lua/user/whichkey.lua index eec50be02..ec95cc7d0 100644 --- a/nvim/.config/nvim/lua/user/whichkey.lua +++ b/nvim/.config/nvim/lua/user/whichkey.lua @@ -84,7 +84,7 @@ local mappings = { "lua require('telescope.builtin').buffers(require('telescope.themes').get_dropdown{previewer = false})", "Buffers", }, - ["e"] = { "NvimTreeToggle", "Explorer" }, + -- ["e"] = { "NvimTreeToggle", "Explorer" }, ["w"] = { "w!", "Save" }, ["q"] = { "q!", "Quit" }, ["c"] = { "Bdelete!", "Close Buffer" }, diff --git a/nvim/.config/nvim/plugin/packer_compiled.lua b/nvim/.config/nvim/plugin/packer_compiled.lua index d1bd4f25e..c40cf3604 100644 --- a/nvim/.config/nvim/plugin/packer_compiled.lua +++ b/nvim/.config/nvim/plugin/packer_compiled.lua @@ -209,11 +209,6 @@ _G.packer_plugins = { path = "/home/repo/.local/share/nvim/site/pack/packer/start/nvim-lspconfig", url = "https://github.com/neovim/nvim-lspconfig" }, - ["nvim-tree.lua"] = { - loaded = true, - path = "/home/repo/.local/share/nvim/site/pack/packer/start/nvim-tree.lua", - url = "https://github.com/kyazdani42/nvim-tree.lua" - }, ["nvim-treesitter"] = { loaded = true, path = "/home/repo/.local/share/nvim/site/pack/packer/start/nvim-treesitter",