diff --git a/config/.config/nvim/lazy-lock.json b/config/.config/nvim/lazy-lock.json index 3b379f8..455083b 100644 --- a/config/.config/nvim/lazy-lock.json +++ b/config/.config/nvim/lazy-lock.json @@ -7,6 +7,7 @@ "calendar-vim": { "branch": "master", "commit": "a7e73e02c92566bf427b2a1d6a61a8f23542cc21" }, "catppuccin": { "branch": "main", "commit": "a84ee1848bfac4601771805396552bdbaa0a0e91" }, "ciderlsp-nvim": { "branch": "main", "commit": "45ee3634c6d4224c6981825da5bde39804addc71" }, + "cmp-async-path": { "branch": "main", "commit": "d8229a93d7b71f22c66ca35ac9e6c6cd850ec61d" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-calc": { "branch": "main", "commit": "50792f34a628ea6eb31d2c90e8df174671e4e7a0" }, "cmp-cmdline": { "branch": "main", "commit": "8ee981b4a91f536f52add291594e89fb6645e451" }, @@ -16,7 +17,6 @@ "cmp-nvim-lsp-document-symbol": { "branch": "main", "commit": "f0f53f704c08ea501f9d222b23491b0d354644b0" }, "cmp-nvim-lsp-signature-help": { "branch": "main", "commit": "3d8912ebeb56e5ae08ef0906e3a54de1c66b92f1" }, "cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" }, - "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "cmp-spell": { "branch": "master", "commit": "60584cb75e5e8bba5a0c9e4c3ab0791e0698bffa" }, "cmp-treesitter": { "branch": "master", "commit": "389eadd48c27aa6dc0e6b992644704f026802a2e" }, "cmp-under-comparator": { "branch": "master", "commit": "6857f10272c3cfe930cece2afa2406e1385bfef8" }, @@ -48,10 +48,11 @@ "mason.nvim": { "branch": "main", "commit": "5ad3e113b0c3fde3caba8630599373046f6197e8" }, "mkdir.nvim": { "branch": "main", "commit": "c55d1dee4f099528a1853b28bb28caa802eba217" }, "neo-tree.nvim": { "branch": "v2.x", "commit": "80dc74d081823649809f78370fa5b204aa9a853a" }, + "neoscopes": { "branch": "main", "commit": "88ca15efcc20b267789d74ca483cc8bac85b3083" }, "nerdcommenter": { "branch": "master", "commit": "ab2ae4d502a26bc591db78a8548823ddd04bbc9c" }, "nui.nvim": { "branch": "main", "commit": "d146966a423e60699b084eeb28489fe3b6427599" }, - "null-ls.nvim": { "branch": "main", "commit": "db09b6c691def0038c456551e4e2772186449f35" }, "nvim-cmp": { "branch": "main", "commit": "c4e491a87eeacf0408902c32f031d802c7eafce8" }, + "nvim-cmp-buffer-lines": { "branch": "master", "commit": "2036e6fbb40c770eb82f1940a0ce0b2988f8ef32" }, "nvim-lightbulb": { "branch": "master", "commit": "6166029a136afd56cf23384fc31e8ba203a6e102" }, "nvim-lint": { "branch": "master", "commit": "4744fc04c3a869c9eaa137fec13d992aea7da7ee" }, "nvim-lspconfig": { "branch": "master", "commit": "447443a2404adc323ad2efc7c0a346a904ce694c" }, @@ -72,12 +73,14 @@ "telescope_citc": { "branch": "main", "commit": "d6421d5bfe058915ece0daec55e488f8ea05f207" }, "telescope_codesearch": { "branch": "main", "commit": "a26077ad3c68cf897ae1c31da903d6516ebb9c92" }, "telescope_fig": { "branch": "main", "commit": "90150e1aa368b49a5125689b3a6da573a99e2bda" }, + "time-ago.vim": { "branch": "master", "commit": "be978d5c790cfcc41f524205f28783b9937fd0ee" }, "trouble.nvim": { "branch": "main", "commit": "20d1b30d6925213abece21d35858a16e11d1e9fc" }, "undotree": { "branch": "master", "commit": "0e11ba7325efbbb3f3bebe06213afa3e7ec75131" }, "vcscommand.vim": { "branch": "master", "commit": "2fb32681361f37533455d20aaa7fc6eb11b0fa4b" }, "vim-bazel": { "branch": "master", "commit": "31b0d5e4f51da1aeb56d65bf505a744e6de405de" }, "vim-better-whitespace": { "branch": "master", "commit": "1b22dc57a2751c7afbc6025a7da39b7c22db635d" }, "vim-dirdiff": { "branch": "master", "commit": "84bc8999fde4b3c2d8b228b560278ab30c7ea4c9" }, + "vim-floaterm": { "branch": "master", "commit": "bcaeabf89a92a924031d471395054d84bd88ce2f" }, "vim-imp": { "branch": "main", "commit": "394e926ce62010443731f3923031e5afa1279f3e" }, "vim-indent-guides": { "branch": "master", "commit": "a1e1390c0136e63e813d051de2003bf0ee18ae30" }, "vim-maktaba": { "branch": "master", "commit": "fe95bb10f6bb250943a44632107f6a3d76ce5f28" }, diff --git a/vim/.vim/lua/config/google.lua b/vim/.vim/lua/config/google.lua index f16d58b..af36506 100644 --- a/vim/.vim/lua/config/google.lua +++ b/vim/.vim/lua/config/google.lua @@ -130,9 +130,6 @@ endfunction com! -nargs=? -complete=file Blame :call G4Blame() nnoremap cc :CritiqueUnresolvedComments - -nmap rbs ss rb - nmap yb :let @+ = join(blaze#GetTargets(), ' ') ]]) end diff --git a/vim/.vim/lua/plugins/cmp.lua b/vim/.vim/lua/plugins/cmp.lua index 235071e..c0bdacf 100644 --- a/vim/.vim/lua/plugins/cmp.lua +++ b/vim/.vim/lua/plugins/cmp.lua @@ -85,7 +85,7 @@ return { mapping = cmp.mapping.preset.cmdline(), sources = cmp.config.sources({ { name = "async_path", priority = 9 }, - { name = "treesitter", priority = 7 }, + -- { name = "treesitter", priority = 7 }, { name = "cmdline", priority = 8 }, }), }) diff --git a/vim/.vim/lua/plugins/floaterm.lua b/vim/.vim/lua/plugins/floaterm.lua new file mode 100644 index 0000000..ca527c6 --- /dev/null +++ b/vim/.vim/lua/plugins/floaterm.lua @@ -0,0 +1,17 @@ +local use_google = require("utils").use_google +local TableConcat = require("utils").TableConcat +local keys = { + { "f", ":FloatermToggle" }, + { "f", ":FloatermToggle", mode = "t" }, +} + +if use_google() then + TableConcat(keys, { + -- { "br", ":FloatermSend blaze run blaze#GetTargets()" }, + }) +end + +return { + "voldikss/vim-floaterm", + keys = keys, +} diff --git a/vim/.vim/lua/plugins/formatter.lua b/vim/.vim/lua/plugins/formatter.lua index 49a15ec..69ff186 100644 --- a/vim/.vim/lua/plugins/formatter.lua +++ b/vim/.vim/lua/plugins/formatter.lua @@ -44,27 +44,27 @@ return { html = { require("formatter.defaults").prettier, }, - xml = { - function() - return { - exe = "tidy", - args = { - "-quiet", - "-xml", - "--wrap yes", - "--indent yes", - "--indent-spaces 2", - "--indent-attributes yes", - "--sort-attributes alpha", - "--wrap-attributes yes", - "--vertical-space yes", - "--tidy-mark no", - }, - stdin = true, - try_node_modules = true, - } - end, - }, + -- xml = { + -- function() + -- return { + -- exe = "tidy", + -- args = { + -- "-quiet", + -- "-xml", + -- "--wrap yes", + -- "--indent yes", + -- "--indent-spaces 2", + -- "--indent-attributes yes", + -- "--sort-attributes alpha", + -- "--wrap-attributes yes", + -- "--vertical-space yes", + -- "--tidy-mark no", + -- }, + -- stdin = true, + -- try_node_modules = true, + -- } + -- end, + -- }, -- java = { -- function() -- return { diff --git a/vim/.vim/lua/plugins/google.lua b/vim/.vim/lua/plugins/google.lua index 3df0860..53359af 100644 --- a/vim/.vim/lua/plugins/google.lua +++ b/vim/.vim/lua/plugins/google.lua @@ -86,7 +86,7 @@ return { "flwyd/vim-imp", dependencies = { "imp-google" }, keys = { - { "ii", ":ImpSuggest " }, + { "i", ":ImpSuggest " }, }, }, { @@ -132,7 +132,7 @@ return { name = "google_comments", -- url = "sso://googler@user/chmnchiang/google-comments", dir = "/google/src/cloud/cnieves/google-comments/google3/experimental/users/chmnchiang/neovim/google-comments/", - dependencies = { "rcarriga/nvim-notify", "nvim-lua/plenary.nvim" }, + dependencies = { "rktjmp/time-ago.vim", "rcarriga/nvim-notify", "nvim-lua/plenary.nvim" }, config = function() -- Here are all the options and their default values: require("google.comments").setup({ diff --git a/vim/.vim/lua/plugins/lsp.lua b/vim/.vim/lua/plugins/lsp.lua index 093b173..43083e7 100644 --- a/vim/.vim/lua/plugins/lsp.lua +++ b/vim/.vim/lua/plugins/lsp.lua @@ -125,9 +125,14 @@ return { local my_on_attach = function(client, bufnr) require("lualine").refresh() - vim.api.nvim_command("autocmd CursorHold lua vim.lsp.buf.document_highlight()") - vim.api.nvim_command("autocmd CursorHoldI lua vim.lsp.buf.document_highlight()") - vim.api.nvim_command("autocmd CursorMoved lua vim.lsp.util.buf_clear_references()") + -- vim.api.nvim_command("augroup LSP") + -- vim.api.nvim_command("autocmd!") + -- if client.server_capabilities.documentFormattingProvider then + -- vim.api.nvim_command("autocmd CursorHold lua vim.lsp.buf.document_highlight()") + -- vim.api.nvim_command("autocmd CursorHoldI lua vim.lsp.buf.document_highlight()") + -- vim.api.nvim_command("autocmd CursorMoved lua vim.lsp.util.buf_clear_references()") + -- end + -- vim.api.nvim_command("augroup END") vim.api.nvim_buf_set_option(bufnr, "omnifunc", "v:lua.vim.lsp.omnifunc") if vim.lsp.formatexpr then -- Neovim v0.6.0+ only. @@ -163,7 +168,7 @@ return { end end require("cmp_nvim_ciderlsp").setup({ - multiline_summary_symbol = "…", + -- multiline_summary_symbol = "…", }) capabilities = require("cmp_nvim_ciderlsp").update_capabilities(capabilities) capabilities.workspace.codeLens = { refreshSupport = true } diff --git a/vim/.vim/lua/plugins/lsp_lines.lua b/vim/.vim/lua/plugins/lsp_lines.lua index d680259..cbc145e 100644 --- a/vim/.vim/lua/plugins/lsp_lines.lua +++ b/vim/.vim/lua/plugins/lsp_lines.lua @@ -7,12 +7,12 @@ return { virtual_lines = { only_current_line = true }, -- virtual_lines = true, - update_in_insert = true, + update_in_insert = false, virtual_text = false, }) require("lsp_lines").setup() - require("lsp_lines").toggle() + -- require("lsp_lines").toggle() end, keys = { { diff --git a/vim/.vim/lua/plugins/neoscopes.lua b/vim/.vim/lua/plugins/neoscopes.lua new file mode 100644 index 0000000..3815095 --- /dev/null +++ b/vim/.vim/lua/plugins/neoscopes.lua @@ -0,0 +1,23 @@ +return { + "smartpde/neoscopes", + config = function() + require("neoscopes").setup({ + scopes = { + { + name = "apkdiff", + dirs = { + "java/com/google/android/gmscore/tools/earlycheckin/apkdiff", + "javatests/com/google/android/gmscore/tools/earlycheckin/apkdiff", + }, + }, + { name = "experimental", dirs = { "experimental/users/cnieves" } }, + }, + -- add_dirs_to_all_scopes = { + -- "~/dotfiles", + -- }, + }) + + local scopes = require("neoscopes") + scopes.add_startup_scope() + end, +} diff --git a/vim/.vim/lua/plugins/telescope.lua b/vim/.vim/lua/plugins/telescope.lua index 80fb35e..0a6e0a4 100644 --- a/vim/.vim/lua/plugins/telescope.lua +++ b/vim/.vim/lua/plugins/telescope.lua @@ -1,11 +1,29 @@ local use_google = require("utils").use_google local TableConcat = require("utils").TableConcat +local scopes = require("neoscopes") + +scopes.add_startup_scope() + +-- Helper functions to fetch the current scope and set `search_dirs` +_G.find_files = function() + require("telescope.builtin").find_files({ + search_dirs = scopes.get_current_dirs(), + }) +end +_G.live_grep = function() + require("telescope.builtin").live_grep({ + search_dirs = scopes.get_current_dirs(), + }) +end + local keys = { + { "ts", [[lua require("neoscopes").select()]], desc = "NeoScopes" }, { "tb", ":Telescope file_buffers", desc = "[T]elescope [B]uffers" }, - { "th", ":lua require('telescope.builtin').help_tags{}", desc = "[T]elescope [H]elp" }, - { "t*", ":lua require('telescope.builtin').grep_string{}", desc = "[T]elescope current [W]ord" }, - { "tf", ":lua require('telescope.builtin').live_grep{}", desc = "[T]elescope by [G]rep" }, + { "tf", ":lua find_files()", desc = "[T]elescope [F]ind Files" }, + { "tl", ":lua live_grep()", desc = "[T]elescope [L]ive Grep" }, { "tg", ":Telescope git_files", desc = "[T]elescope [G]it Files" }, + { "t*", ":lua require('telescope.builtin').grep_string{}", desc = "[T]elescope current [W]ord" }, + { "th", ":lua require('telescope.builtin').help_tags{}", desc = "[T]elescope [H]elp" }, } if use_google() then diff --git a/vim/.vim/prefs/leader.vim b/vim/.vim/prefs/leader.vim index c27c80a..32d6a4e 100644 --- a/vim/.vim/prefs/leader.vim +++ b/vim/.vim/prefs/leader.vim @@ -52,6 +52,8 @@ nmap e :e %% " without yanking it vnoremap p "_dP -nnoremap rp :VimuxOpenRunner :VimuxRunCommand '!!' :call VimuxSendKeys("Enter") + +nnoremap rp :lua vim.notify("use ") +nnoremap :VimuxOpenRunner :VimuxRunCommand '!!' :call VimuxSendKeys("Enter") nnoremap s :SessionSave diff --git a/vim/.vimrc b/vim/.vimrc index a93dd53..298b42d 100644 --- a/vim/.vimrc +++ b/vim/.vimrc @@ -141,12 +141,12 @@ let g:loaded_remote_plugins = 1 " Permanent "very magic" mode -nnoremap / /\v -vnoremap / /\v -cnoremap %s/ %smagic/ -cnoremap \>s/ \>smagic/ -nnoremap :g/ :g/\v -nnoremap :g// :g// +" nnoremap / /\v +" vnoremap / /\v +" cnoremap %s/ %smagic/ +" cnoremap \>s/ \>smagic/ +" nnoremap :g/ :g/\v +" nnoremap :g// :g// function! TabMultiDiff() let s:tab_multi_diff = 0