diff --git a/vim/.vim/lua/config/lsp.lua b/vim/.vim/lua/config/lsp.lua index 67c0abd..a09c2f4 100644 --- a/vim/.vim/lua/config/lsp.lua +++ b/vim/.vim/lua/config/lsp.lua @@ -10,6 +10,14 @@ require("mason-lspconfig").setup({ ensure_installed = { "lua_ls", "rust_analyzer" } }) +-- CiderLSP +vim.opt.completeopt = { "menu", "menuone", "noselect" } +-- Don't show the dumb matching stuff +vim.opt.shortmess:append("c") + +vim.opt.spell = true +vim.opt.spelllang = { 'en_us' } + local lspconfig = require("lspconfig") local configs = require("lspconfig.configs") diff --git a/vim/.vim/lua/config/nerdcommenter.lua b/vim/.vim/lua/config/nerdcommenter.lua new file mode 100644 index 0000000..885a549 --- /dev/null +++ b/vim/.vim/lua/config/nerdcommenter.lua @@ -0,0 +1,30 @@ +--------- NERD Commenter +-- Create default mappings +vim.g.NERDCreateDefaultMappings = 0 + +-- Add spaces after comment delimiters by default +vim.g.NERDSpaceDelims = 1 + +-- Use compact syntax for prettified multi-line comments +vim.g.NERDCompactSexyComs = 1 + +-- Align line-wise comment delimiters flush left instead of following code indentation +vim.g.NERDDefaultAlign = 'left' + +-- Set a language to use its alternate delimiters by default +vim.g.NERDAltDelims_java = 1 + +-- Allow commenting and inverting empty lines (useful when commenting a region) +vim.g.NERDCommentEmptyLines = 1 + +-- Enable trimming of trailing whitespace when uncommenting +vim.g.NERDTrimTrailingWhitespace = 1 + +--Enable NERDCommenterToggle to check all selected lines is commented or not +vim.g.NERDToggleCheckAllLines = 1 + +nnoremap c :call nerdcommenter#Comment(0,"toggle") +vnoremap c :call nerdcommenter#Comment(0,"toggle") + +nnoremap c$ :call nerdcommenter#Comment(0,"ToEOL") +vnoremap c$ :call nerdcommenter#Comment(0,"ToEOL") diff --git a/vim/.vim/lua/plugin_init.lua b/vim/.vim/lua/plugin_init.lua index 57b9126..5734901 100644 --- a/vim/.vim/lua/plugin_init.lua +++ b/vim/.vim/lua/plugin_init.lua @@ -18,10 +18,3 @@ package.path = package.path .. ';' .. vim.env.HOME .. "/.vim/lua/?.lua" require("lazy").setup("plugins") --- CiderLSP -vim.opt.completeopt = { "menu", "menuone", "noselect" } --- Don't show the dumb matching stuff -vim.opt.shortmess:append("c") - -vim.opt.spell = true -vim.opt.spelllang = { 'en_us' } diff --git a/vim/.vim/lua/plugins/base.lua b/vim/.vim/lua/plugins/base.lua index bac163d..b556296 100644 --- a/vim/.vim/lua/plugins/base.lua +++ b/vim/.vim/lua/plugins/base.lua @@ -15,7 +15,6 @@ return 'hrsh7th/vim-vsnip', 'kosayoda/nvim-lightbulb', 'tpope/vim-surround', - 'scrooloose/nerdcommenter', 'ntpeters/vim-better-whitespace', 'junegunn/fzf.vim', 'nathanaelkane/vim-indent-guides', @@ -23,6 +22,18 @@ return 'jremmen/vim-ripgrep', 'nvim-lua/plenary.nvim', + { + 'scrooloose/nerdcommenter', + config = function() + require("config.nerdcommenter") + end, + keys = { + { "c", ":call nerdcommenter#Comment(0, 'toggle')" }, + { "c", ":call nerdcommenter#Comment(0, 'toggle')", 'v' }, + { "c$", ":call nerdcommenter#Comment(0, 'ToEOL')" }, + { "c$", ":call nerdcommenter#Comment(0, 'ToEOL')", 'v' }, + } + }, { 'nvim-treesitter/nvim-treesitter', build = ':TSUpdate', @@ -122,9 +133,27 @@ return branch = '0.1.x', config = function() require("config.telescope") - end + end, + dependencies = { + "telescope_codesearch", + "telescope_citc", + "telescope_fig", + 'nvim-telescope/telescope-file-browser.nvim', + }, + keys = { + { 'tb', ":Telescope file_buffers", desc = '[T]elescope [B]uffers' } , + { 'tf', [[:lua require('telescope.builtin').find_files{ find_command = {'rg', '--files', '--hidden', '-g', '!node_modules/**'} }]], desc = '[T]elescope [F]iles' }, + { 'th', [[:lua require('telescope.builtin').help_tags]], desc = '[T]elescope [H]elp' }, + { 'tw', [[:lua require('telescope.builtin').grep_string]], desc = '[T]elescope current [W]ord' }, + { 'tg', [[:lua require('telescope.builtin').live_grep]], desc = '[T]elescope by [G]rep' }, + -- Google mappings + { '', [[:lua require('telescope').extensions.codesearch.find_files{}]],'n', { noremap = true, silent=true }}, + { '', [[:lua require('telescope').extensions.codesearch.find_query{}]], { noremap = true, silent = true }}, + { 'cs', [[:lua require('telescope').extensions.codesearch.find_query{}]], { noremap = true, silent = true }}, + { 'cs', [[:lua require('telescope').extensions.codesearch.find_query{}]], 'v', { noremap = true, silent = true }}, + { 'CS', [[:lua require('telescope').extensions.codesearch.find_query{default_text_expand=''}]], { noremap = true, silent = true } }, + }, }, - 'nvim-telescope/telescope-file-browser.nvim', -- Rust { diff --git a/vim/.vim/lua/plugins/google.lua b/vim/.vim/lua/plugins/google.lua index 3127e00..a4ebe0a 100644 --- a/vim/.vim/lua/plugins/google.lua +++ b/vim/.vim/lua/plugins/google.lua @@ -28,7 +28,7 @@ return { { name = "telescope_codesearch", url = 'sso://googler@user/vintharas/telescope-codesearch.nvim', - dependencies = { 'nvim-telescope/telescope.nvim' } + dependencies = { 'nvim-telescope/telescope.nvim' }, }, { name = "telescope_citc", diff --git a/vim/.vim/prefs/google.vim b/vim/.vim/prefs/google.vim index c440b17..90f8a48 100644 --- a/vim/.vim/prefs/google.vim +++ b/vim/.vim/prefs/google.vim @@ -158,14 +158,6 @@ endfunction com! -nargs=? -complete=file Blame :call G4Blame() -" nnoremap cs :FzfCs -" The buffer n can be replaced by any other unused buffer. -" removes the visual range because csearch doesn't support ranges. -" Removes newlines to allow the entire line search using V-LINE mode. -" vnoremap cs "ny:FzfCs "=substitute(@n, '\n', '', '')" -" -" nnoremap CS :FzfCs - nnoremap cc :CritiqueUnresolvedComments " nnoremap ps :PiperSelectActiveFiles diff --git a/vim/.vim/prefs/leader.vim b/vim/.vim/prefs/leader.vim index b2ac76f..82d3a15 100644 --- a/vim/.vim/prefs/leader.vim +++ b/vim/.vim/prefs/leader.vim @@ -71,37 +71,6 @@ endfunction nmap toi :CocCommand tsserver.organizeImports -"" --------- NERD Commenter -" Create default mappings -let g:NERDCreateDefaultMappings = 0 - -" Add spaces after comment delimiters by default -let g:NERDSpaceDelims = 1 - -" Use compact syntax for prettified multi-line comments -let g:NERDCompactSexyComs = 1 - -" Align line-wise comment delimiters flush left instead of following code indentation -let g:NERDDefaultAlign = 'left' - -" Set a language to use its alternate delimiters by default -let g:NERDAltDelims_java = 1 - -" Allow commenting and inverting empty lines (useful when commenting a region) -let g:NERDCommentEmptyLines = 1 - -" Enable trimming of trailing whitespace when uncommenting -let g:NERDTrimTrailingWhitespace = 1 - -"Enable NERDCommenterToggle to check all selected lines is commented or not -let g:NERDToggleCheckAllLines = 1 - -nnoremap c :call nerdcommenter#Comment(0,"toggle") -vnoremap c :call nerdcommenter#Comment(0,"toggle") - -nnoremap c$ :call nerdcommenter#Comment(0,"ToEOL") -vnoremap c$ :call nerdcommenter#Comment(0,"ToEOL") - nmap yf :let @+ = expand("%") nmap ut :UndotreeToggle nmap e :e %%