From 505abba0c2e8f04748f9f42773fed2ec47107bce Mon Sep 17 00:00:00 2001 From: Christian Nieves Date: Thu, 8 Jun 2023 17:16:45 -0500 Subject: [PATCH] Finish lazy.nvim migration --- config/.config/nvim/lazy-lock.json | 2 +- vim/.vim/lua/config/lsp.lua | 1 + vim/.vim/lua/config/nvim-treesitter.lua | 12 ++--- vim/.vim/lua/config/trouble.lua | 7 --- vim/.vim/lua/plugin_init.lua | 4 +- vim/.vim/lua/plugins/base.lua | 66 ++++++++++--------------- vim/.vim/lua/plugins/git.lua | 16 ++++++ vim/.vim/lua/plugins/google.lua | 9 +++- vim/.vim/prefs/google.vim | 5 +- vim/.vimrc | 17 +++---- 10 files changed, 68 insertions(+), 71 deletions(-) create mode 100644 vim/.vim/lua/plugins/git.lua diff --git a/config/.config/nvim/lazy-lock.json b/config/.config/nvim/lazy-lock.json index 3997b7f..3333b01 100644 --- a/config/.config/nvim/lazy-lock.json +++ b/config/.config/nvim/lazy-lock.json @@ -46,7 +46,7 @@ "mkdir.nvim": { "branch": "main", "commit": "c55d1dee4f099528a1853b28bb28caa802eba217" }, "neo-tree.nvim": { "branch": "v2.x", "commit": "d883632bf8f92f1d5abea4a9c28fb2f90aa795aa" }, "nerdcommenter": { "branch": "master", "commit": "b0b09ea46c9f0509556257bd8b838b40f493d6a0" }, - "nui.nvim": { "branch": "main", "commit": "bd2fefb2efac70231fee497137295333dd4ada30" }, + "nui.nvim": { "branch": "main", "commit": "062e366afcdf2bc1e9d28313a1df4ff14f05cb4e" }, "null-ls.nvim": { "branch": "main", "commit": "a138b14099e9623832027ea12b4631ddd2a49256" }, "nvim-cmp": { "branch": "main", "commit": "b5a636d46c69bb371995c22d7a10ee1544004879" }, "nvim-lightbulb": { "branch": "master", "commit": "ca5b44a8efffb5fec1963ccd21f25ec04cc778b7" }, diff --git a/vim/.vim/lua/config/lsp.lua b/vim/.vim/lua/config/lsp.lua index 290d11d..67c0abd 100644 --- a/vim/.vim/lua/config/lsp.lua +++ b/vim/.vim/lua/config/lsp.lua @@ -12,6 +12,7 @@ require("mason-lspconfig").setup({ local lspconfig = require("lspconfig") local configs = require("lspconfig.configs") + if use_google() then configs.ciderlsp = { default_config = { diff --git a/vim/.vim/lua/config/nvim-treesitter.lua b/vim/.vim/lua/config/nvim-treesitter.lua index 37e86cb..efdffcf 100644 --- a/vim/.vim/lua/config/nvim-treesitter.lua +++ b/vim/.vim/lua/config/nvim-treesitter.lua @@ -12,17 +12,17 @@ sync_install = false, indent = { enable = true }, - disable = {"java"}, + -- disable = {"java"}, -- -- Setting this to true will run `:h syntax` and tree-sitter at the same time. -- Set this to `true` if you depend on 'syntax' being enabled (like for indentation). -- Using this option may slow down your editor, and you may see some duplicate highlights. -- Instead of true it can also be a list of languages -- additional_vim_regex_highlighting = true, - -- additional_vim_regex_highlighting = {"java"}, + additional_vim_regex_highlighting = {"java"}, }, - rainbow = { - enable = true, - extended_mode = true, - } + -- rainbow = { + -- enable = true, + -- extended_mode = true, + -- } } diff --git a/vim/.vim/lua/config/trouble.lua b/vim/.vim/lua/config/trouble.lua index 9e5b185..717eda6 100644 --- a/vim/.vim/lua/config/trouble.lua +++ b/vim/.vim/lua/config/trouble.lua @@ -4,13 +4,6 @@ vim.diagnostic.config({ severity_sort = true, }) -vim.keymap.set( - "", - "l", - require("lsp_lines").toggle, - { desc = "Toggle lsp_lines" } -) - -- Diagnostics require("trouble").setup({ signs = { diff --git a/vim/.vim/lua/plugin_init.lua b/vim/.vim/lua/plugin_init.lua index ede36ed..57b9126 100644 --- a/vim/.vim/lua/plugin_init.lua +++ b/vim/.vim/lua/plugin_init.lua @@ -14,6 +14,8 @@ if not vim.loop.fs_stat(lazypath) then end vim.opt.rtp:prepend(lazypath) +package.path = package.path .. ';' .. vim.env.HOME .. "/.vim/lua/?.lua" + require("lazy").setup("plugins") -- CiderLSP @@ -23,5 +25,3 @@ vim.opt.shortmess:append("c") vim.opt.spell = true vim.opt.spelllang = { 'en_us' } - -require("config.imp") diff --git a/vim/.vim/lua/plugins/base.lua b/vim/.vim/lua/plugins/base.lua index a158166..bac163d 100644 --- a/vim/.vim/lua/plugins/base.lua +++ b/vim/.vim/lua/plugins/base.lua @@ -5,7 +5,6 @@ return -- Pretty symbols 'kyazdani42/nvim-web-devicons', - 'nvim-lua/lsp-status.nvim', 'jghauser/mkdir.nvim', 'lewis6991/impatient.nvim', 'dstein64/vim-startuptime', @@ -15,11 +14,6 @@ return 'apalmer1377/factorus', 'hrsh7th/vim-vsnip', 'kosayoda/nvim-lightbulb', - - "williamboman/mason.nvim", - "williamboman/mason-lspconfig.nvim", - 'VonHeikemen/lsp-zero.nvim', - 'tpope/vim-surround', 'scrooloose/nerdcommenter', 'ntpeters/vim-better-whitespace', @@ -29,7 +23,6 @@ return 'jremmen/vim-ripgrep', 'nvim-lua/plenary.nvim', - { 'nvim-treesitter/nvim-treesitter', build = ':TSUpdate', @@ -75,14 +68,19 @@ return { 'ray-x/go.nvim',ft='go' }, { 'ray-x/guihua.lua',ft='go' }, + "williamboman/mason.nvim", + "williamboman/mason-lspconfig.nvim", + 'nvim-lua/lsp-status.nvim', + 'VonHeikemen/lsp-zero.nvim', + -- Completion and linting - 'neovim/nvim-lspconfig', { 'hrsh7th/nvim-cmp', - event = "InsertEnter", + event = "VimEnter", dependencies = { 'onsails/lspkind.nvim', + 'neovim/nvim-lspconfig', 'hrsh7th/cmp-nvim-lsp', 'hrsh7th/cmp-buffer', 'lukas-reineke/cmp-under-comparator', @@ -106,14 +104,14 @@ return }, { 'ErichDonGubler/lsp_lines.nvim', - event = "InsertEnter", - config = function() - require("lsp_lines").setup() - end + event = "VimEnter", + keys = { + { "l", function() require("lsp_lines").toggle() end, desc = "Toggle LSP Lines" }, + }, }, { 'jose-elias-alvarez/null-ls.nvim', - event = "InsertEnter", + event = "VimEnter", config = function() require("config.null-ls") end @@ -143,9 +141,10 @@ return { 'folke/trouble.nvim', + event = "VimEnter", config = function() require("config.trouble") - end + end, }, { @@ -160,16 +159,18 @@ return }, {'andymass/vim-matchup', event = 'VimEnter'}, - { 'simrat39/symbols-outline.nvim', config = function() - require("config.symbols-outline") - end -}, + { 'simrat39/symbols-outline.nvim', + config = function() + require("config.symbols-outline") + end + }, { - 'petertriho/nvim-scrollbar', config = function() - require("scrollbar").setup() + 'petertriho/nvim-scrollbar', + config = function() + require("scrollbar").setup() end, lazy = false, -}, + }, { 'rmagatti/auto-session', @@ -181,7 +182,6 @@ return end }, - { "ipod825/libp.nvim", config = function() @@ -203,23 +203,6 @@ return end }, - -- Git - { - { - 'lewis6991/gitsigns.nvim', - dependencies = 'nvim-lua/plenary.nvim', - event = 'User ActuallyEditing', - }, - { - 'akinsho/git-conflict.nvim', - version = '*', - config = function() - require('git-conflict').setup() - end, - }, - { 'rhysd/conflict-marker.vim' } - }, - { "catppuccin/nvim", name = "catppuccin", @@ -238,7 +221,8 @@ return -- mine { - 'squk/java-syntax.vim', ft='java' + 'squk/java-syntax.vim', + lazy = false, }, { diff --git a/vim/.vim/lua/plugins/git.lua b/vim/.vim/lua/plugins/git.lua new file mode 100644 index 0000000..dfb6781 --- /dev/null +++ b/vim/.vim/lua/plugins/git.lua @@ -0,0 +1,16 @@ +return { + -- Git + { + 'lewis6991/gitsigns.nvim', + dependencies = 'nvim-lua/plenary.nvim', + event = 'User ActuallyEditing', + }, + { + 'akinsho/git-conflict.nvim', + version = '*', + config = function() + require('git-conflict').setup() + end, + }, + { 'rhysd/conflict-marker.vim' } +} diff --git a/vim/.vim/lua/plugins/google.lua b/vim/.vim/lua/plugins/google.lua index 29a6cca..3127e00 100644 --- a/vim/.vim/lua/plugins/google.lua +++ b/vim/.vim/lua/plugins/google.lua @@ -8,10 +8,18 @@ return { { name = "cmp_nvim_ciderlsp", url = 'sso://googler@user/piloto/cmp-nvim-ciderlsp', + lazy = false; + dependencies = { + 'hrsh7th/nvim-cmp', + } }, { name = "ciderlsp_nvim", url = 'sso://googler@user/kdark/ciderlsp-nvim', + lazy = false; + dependencies = { + 'hrsh7th/nvim-cmp', + } }, { name = "nvim_figtree", @@ -80,4 +88,3 @@ return { -- 'google/vim-glaive', -- } -- } - diff --git a/vim/.vim/prefs/google.vim b/vim/.vim/prefs/google.vim index a5ff3b5..c440b17 100644 --- a/vim/.vim/prefs/google.vim +++ b/vim/.vim/prefs/google.vim @@ -7,8 +7,8 @@ let g:signify_skip_filename_pattern = ['\.pipertmp.*'] Glug alert Glug csearch -" Glug codefmt ktfmt_executable=`["/google/bin/releases/kotlin-google-eng/ktfmt/ktfmt_deploy.jar", "--google-style"]` -Glug codefmt +" Glug! codefmt ktfmt_executable=`["/google/bin/releases/kotlin-google-eng/ktfmt/ktfmt_deploy.jar", "--google-style"]` +Glug! codefmt Glug codefmt-google Glug languages " applies google coding style settings to files whitelisted as google code. probably also want @@ -179,4 +179,3 @@ nmap yb :let @+ = join(blaze#GetTargets(), ' ') Glug corpweb nnoremap csw :CorpWebCsFile - diff --git a/vim/.vimrc b/vim/.vimrc index 38ab788..dff03f2 100644 --- a/vim/.vimrc +++ b/vim/.vimrc @@ -5,7 +5,6 @@ filetype off " required set runtimepath+=,~/.vim set runtimepath+=,~/.vim/after set runtimepath+=,~/.vim/lua/ -set runtimepath+=,~/.vim/lua/plugins set runtimepath+=,~/.config/nvim/after/ let &runtimepath = &runtimepath @@ -22,7 +21,6 @@ let &t_8f = "\[38;2;%lu;%lu;%lum" let &t_8b = "\[48;2;%lu;%lu;%lum" let &t_AB="\e[48;5;%dm" let &t_AF="\e[38;5;%dm" -syntax on set laststatus=2 set cmdheight=1 @@ -82,13 +80,7 @@ set omnifunc= completeopt=menuone,noinsert,noselect set updatetime=100 -if filereadable(expand("~/.vimrc.local")) - source ~/.vimrc.local -endif - -if filereadable(expand("~/use_google")) - source ~/.vim/prefs/google.vim -endif +lua require('plugin_init') source ~/.vim/prefs/mappings.vim source ~/.vim/prefs/leader.vim @@ -194,7 +186,12 @@ function! s:AddBufferToTab() tabfirst endfun -lua require('plugin_init') filetype plugin indent on syntax on + +if filereadable(expand("~/use_google")) + source ~/.vim/prefs/google.vim +endif +lua require("config.imp") +