diff --git a/vim/.vim/lua/config/google-comments.lua b/vim/.vim/lua/config/google-comments.lua index f4f3414..703008c 100644 --- a/vim/.vim/lua/config/google-comments.lua +++ b/vim/.vim/lua/config/google-comments.lua @@ -1,12 +1,8 @@ -- Here are all the options and their default values: require('google.comments').setup { - -- The command for fetching comments, refer to `get_comments.par --help` to - -- see all the options. -- command = {'/google/bin/releases/editor-devtools/get_comments.par', '--full', '--json', "-x=''"}, - stubby = true, - -- + -- stubby = true, command = {'/google/bin/releases/editor-devtools/get_comments.par', '--json', '--full', '--noresolved', '--cl_comments', '--file_comments'}, - -- /google/bin/releases/editor-devtools/get_comments.par --json --full --noresolved --cl_comments --file_comments -x "" --cl 487267122 -- command = {'stubby --output_json call blade:codereview-rpc CodereviewRpcService.GetComments "changelist_number: $(/google/data/ro/teams/fig/bin/vcstool pending-change-number)"'}, -- Define your own icon by `vim.fn.sign_define('ICON_NAME', {text = ' '})`. -- See :help sign_define @@ -20,18 +16,38 @@ require('google.comments').setup { width = 50, -- When showing file paths, use relative paths or not. relative_path = true, + --- Enable viewing comments through floating window + floating = true, + --- Options used when creating the floating window. + floating_window_options = floating_window_options }, - --- Enable viewing comments through floating window - floating = true, - --- Options used when creating the floating window. - floating_window_options = require('google.comments.options').default_floating_window_options, } +function floating_window_options(parent_win_id) + local parent_width = vim.api.nvim_win_get_width(parent_win_id) + local parent_height = vim.api.nvim_win_get_height(parent_win_id) + + return { + relative = 'win', + anchor = 'NW', + width = math.floor(parent_width * 0.5), + height = math.floor(parent_height * 0.3), + row = vim.api.nvim_win_get_cursor(parent_win_id)[1], + col = math.floor(parent_width * 0.25), + border = 'rounded', + } +end + + local map = require("utils").map -- here are some mappings you might want: -map('n', 'nc', [[lua require('google.comments').goto_next_comment()]]) -map('n', 'pc', [[lua require('google.comments').goto_prev_comment()]]) -map('n', 'lc', [[lua require('google.comments').toggle_line_comments()]]) -map('n', 'ac', [[lua require('google.comments').toggle_all_comments()]]) +map('n', '[c', [[GoogleCommentsGotoNextComment]]) +map('n', ']c', [[GoogleCommentsGotoPrevComment]]) + +map('n', 'nc', [[GoogleCommentsGotoNextComment]]) +map('n', 'pc', [[GoogleCommentsGotoPrevComment]]) +map('n', 'lc', [[GoogleCommentsToggleLineComments]]) +map('n', 'ac', [[GoogleCommentsToggleAllComments]]) +map('n', 'fc', [[GoogleCommentsFetchComments]]) vim.fn.sign_define('COMMENT_ICON', {text = ''}) diff --git a/vim/.vim/lua/config/imp.lua b/vim/.vim/lua/config/imp.lua index f38f6db..c4dd2bc 100644 --- a/vim/.vim/lua/config/imp.lua +++ b/vim/.vim/lua/config/imp.lua @@ -19,7 +19,8 @@ if use_google() then -- To search for imports in the file's parent directory before using Code Search across all of google3, install ripgrep and try vim.cmd([[ Glaive imp Suggest[gcl]=buffer,ripgrep,csearch,prompt - \ Suggest[borg]=buffer,ripgrep,csearch,prompt \ Location[gcl]=parent Location[borg]=parent + \ Suggest[borg]=buffer,ripgrep,csearch,prompt + \ Suggest[aidl]=buffer,ripgrep,csearch,prompt ]]) end diff --git a/vim/.vim/lua/config/signify.lua b/vim/.vim/lua/config/signify.lua new file mode 100644 index 0000000..0bf3be9 --- /dev/null +++ b/vim/.vim/lua/config/signify.lua @@ -0,0 +1,4 @@ +local map = require("utils").map + +map('n', ']d', '(signify-next-hunk)') +map('n', '[d', '(signify-prev-hunk)') diff --git a/vim/.vim/lua/plugins.lua b/vim/.vim/lua/plugins.lua index b29fdca..180f978 100644 --- a/vim/.vim/lua/plugins.lua +++ b/vim/.vim/lua/plugins.lua @@ -277,7 +277,11 @@ require('packer').startup(function(use) use 'tpope/vim-surround' use 'scrooloose/nerdcommenter' - use 'mhinz/vim-signify' + + use 'mhinz/vim-signify' { + config= [[require('config.signify')]] + } + use { 'j-hui/fidget.nvim', config = [[require("fidget").setup()]] } use({ "iamcco/markdown-preview.nvim", run = "cd app && npm install", setup = function() vim.g.mkdp_filetypes = { "markdown" } end, ft = { "markdown" }, }) diff --git a/vim/.vim/prefs/google.vim b/vim/.vim/prefs/google.vim index 749674e..848b7e7 100644 --- a/vim/.vim/prefs/google.vim +++ b/vim/.vim/prefs/google.vim @@ -177,11 +177,10 @@ nnoremap ps :FzfHgFiles nnoremap pl :PiperLoadActiveAsBuffers nnoremap po :PiperOpenPath -" search in codesearch for the word under the cursor -nnoremap ws :CorpWebCs -" search in codesearch for the current file -nnoremap wf :CorpWebCsFile - nmap rbs ss rb nmap yb :let @" = join(blaze#GetTargets(), ' ') + +Glug corpweb +nnoremap csw :CorpWebCsFile +