This commit is contained in:
Christian Nieves
2022-11-14 18:24:34 +00:00
parent b4e5d6a60a
commit 9028ccc503
18 changed files with 152 additions and 237 deletions

View File

@ -159,6 +159,12 @@ _G.packer_plugins = {
path = "/usr/local/google/home/cnieves/.local/share/nvim/site/pack/packer/opt/cmp_luasnip",
url = "https://github.com/saadparwaiz1/cmp_luasnip"
},
critique = {
config = { ' require("critique").setup() ' },
loaded = true,
path = "/usr/local/google/home/cnieves/.local/share/nvim/site/pack/packer/start/critique",
url = "/google/src/cloud/cnieves/google-comments/google3/experimental/users/cnieves/neovim/critique"
},
["fidget.nvim"] = {
config = { 'require("fidget").setup()' },
loaded = true,
@ -184,6 +190,15 @@ _G.packer_plugins = {
path = "/usr/local/google/home/cnieves/.local/share/nvim/site/pack/packer/opt/gitsigns.nvim",
url = "https://github.com/lewis6991/gitsigns.nvim"
},
["google-comments"] = {
cond = { true },
config = { ' require("google_comments") ' },
loaded = false,
needs_bufread = false,
only_cond = true,
path = "/usr/local/google/home/cnieves/.local/share/nvim/site/pack/packer/opt/google-comments",
url = "/google/src/cloud/cnieves/google-comments/google3/experimental/users/chmnchiang/neovim/google-comments"
},
["java-syntax.vim"] = {
loaded = true,
path = "/usr/local/google/home/cnieves/.local/share/nvim/site/pack/packer/start/java-syntax.vim",
@ -245,12 +260,18 @@ _G.packer_plugins = {
path = "/usr/local/google/home/cnieves/.local/share/nvim/site/pack/packer/start/nvim-lightbulb",
url = "https://github.com/kosayoda/nvim-lightbulb"
},
["nvim-lsp-installer"] = {
loaded = true,
path = "/usr/local/google/home/cnieves/.local/share/nvim/site/pack/packer/start/nvim-lsp-installer",
url = "https://github.com/williamboman/nvim-lsp-installer"
},
["nvim-lspconfig"] = {
loaded = true,
path = "/usr/local/google/home/cnieves/.local/share/nvim/site/pack/packer/start/nvim-lspconfig",
url = "https://github.com/neovim/nvim-lspconfig"
},
["nvim-notify"] = {
config = { ' require("notify_config") ' },
loaded = true,
path = "/usr/local/google/home/cnieves/.local/share/nvim/site/pack/packer/start/nvim-notify",
url = "https://github.com/rcarriga/nvim-notify"
@ -292,8 +313,11 @@ _G.packer_plugins = {
url = "https://github.com/simrat39/symbols-outline.nvim"
},
["telescope-codesearch.nvim"] = {
loaded = true,
path = "/usr/local/google/home/cnieves/.local/share/nvim/site/pack/packer/start/telescope-codesearch.nvim",
cond = { true },
loaded = false,
needs_bufread = false,
only_cond = true,
path = "/usr/local/google/home/cnieves/.local/share/nvim/site/pack/packer/opt/telescope-codesearch.nvim",
url = "sso://googler@user/vintharas/telescope-codesearch.nvim"
},
["telescope.nvim"] = {
@ -415,30 +439,45 @@ time([[Defining packer_plugins]], false)
time([[Config for auto-session]], true)
try_loadstring("\27LJ\2\n<EFBFBD>\1\0\0\4\0\6\0\t6\0\0\0'\2\1\0B\0\2\0029\0\2\0005\2\3\0005\3\4\0=\3\5\2B\0\2\1K\0\1\0\31auto_session_suppress_dirs\1\4\0\0\a~/\16~/Downloads\6/\1\0\1\14log_level\nerror\nsetup\17auto-session\frequire\0", "config", "auto-session")
time([[Config for auto-session]], false)
-- Config for: lualine.nvim
time([[Config for lualine.nvim]], true)
require("lualine_config")
time([[Config for lualine.nvim]], false)
-- Config for: nvim-scrollbar
time([[Config for nvim-scrollbar]], true)
require("scrollbar").setup()
time([[Config for nvim-scrollbar]], false)
-- Config for: git-conflict.nvim
time([[Config for git-conflict.nvim]], true)
require('git-conflict').setup()
time([[Config for git-conflict.nvim]], false)
-- Config for: lsp_lines.nvim
time([[Config for lsp_lines.nvim]], true)
require("lsp_lines").setup()
time([[Config for lsp_lines.nvim]], false)
-- Config for: nvim-notify
time([[Config for nvim-notify]], true)
require("notify_config")
time([[Config for nvim-notify]], false)
-- Config for: catppuccin
time([[Config for catppuccin]], true)
require("catppuccin-config")
time([[Config for catppuccin]], false)
-- Config for: lualine.nvim
time([[Config for lualine.nvim]], true)
require("lualine_config")
time([[Config for lualine.nvim]], false)
-- Config for: git-conflict.nvim
time([[Config for git-conflict.nvim]], true)
require('git-conflict').setup()
time([[Config for git-conflict.nvim]], false)
-- Config for: nvim-scrollbar
time([[Config for nvim-scrollbar]], true)
require("scrollbar").setup()
time([[Config for nvim-scrollbar]], false)
-- Config for: fidget.nvim
time([[Config for fidget.nvim]], true)
require("fidget").setup()
time([[Config for fidget.nvim]], false)
-- Config for: critique
time([[Config for critique]], true)
require("critique").setup()
time([[Config for critique]], false)
-- Conditional loads
time([[Conditional loading of telescope-codesearch.nvim]], true)
require("packer.load")({"telescope-codesearch.nvim"}, {}, _G.packer_plugins)
time([[Conditional loading of telescope-codesearch.nvim]], false)
time([[Conditional loading of google-comments]], true)
require("packer.load")({"google-comments"}, {}, _G.packer_plugins)
time([[Conditional loading of google-comments]], false)
-- Load plugins in order defined by `after`
time([[Sequenced loading]], true)
vim.cmd [[ packadd LuaSnip ]]
@ -447,8 +486,8 @@ time([[Sequenced loading]], false)
-- Command lazy-loads
time([[Defining lazy-load commands]], true)
pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file Neogit lua require("packer.load")({'neogit'}, { cmd = "Neogit", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args>, mods = "<mods>" }, _G.packer_plugins)]])
pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file UndotreeToggle lua require("packer.load")({'undotree'}, { cmd = "UndotreeToggle", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args>, mods = "<mods>" }, _G.packer_plugins)]])
pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file Neogit lua require("packer.load")({'neogit'}, { cmd = "Neogit", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args>, mods = "<mods>" }, _G.packer_plugins)]])
time([[Defining lazy-load commands]], false)
vim.cmd [[augroup packer_load_aucmds]]

View File

@ -2,7 +2,7 @@ vim.g.catppuccin_flavour = "macchiato" -- latte, frappe, macchiato, mocha
local colors = require("catppuccin.palettes").get_palette()
require("catppuccin").setup({
flavour = vim.g.catppuccin_flavour, --"macchiato",
flavour = "macchiato",
integrations = {
cmp = true,
-- coc_nvim = false,

View File

@ -3,7 +3,10 @@ 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=''"},
command = {'/google/bin/releases/editor-devtools/get_comments.par', '--json', '--full', '--noresolved', '--cl_comments', '--file_comments', '--unreplied_only', ' -x ""'},
stubby = true,
--
command = {'/google/bin/releases/editor-devtools/get_comments.par', '--json', '--full', '--resolved', '--cl_comments', '--file_comments'},
-- 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
-- The sign property passed to setup should be the 'ICON_NAME' in the define
@ -20,21 +23,14 @@ require('google.comments').setup {
--- 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,
floating_window_options = require('google.comments.options').default_floating_window_options,
}
local map = require("utils").map
-- here are some mappings you might want:
vim.api.nvim_set_keymap('n', '<Leader>nc',
[[<Cmd>lua require('google.comments').goto_next_comment()<CR>]],
{ noremap = true, silent = true })
vim.api.nvim_set_keymap('n', '<Leader>pc',
[[<Cmd>lua require('google.comments').goto_prev_comment()<CR>]],
{ noremap = true, silent = true })
vim.api.nvim_set_keymap('n', '<Leader>lc',
[[<Cmd>lua require('google.comments').toggle_line_comments()<CR>]],
{ noremap = true, silent = true })
vim.api.nvim_set_keymap('n', '<Leader>ac',
[[<Cmd>lua require('google.comments').toggle_all_comments()<CR>]],
{ noremap = true, silent = true })
map('n', '<Leader>nc', [[<Cmd>lua require('google.comments').goto_next_comment()<CR>]])
map('n', '<Leader>pc', [[<Cmd>lua require('google.comments').goto_prev_comment()<CR>]])
map('n', '<Leader>lc', [[<Cmd>lua require('google.comments').toggle_line_comments()<CR>]])
map('n', '<Leader>ac', [[<Cmd>lua require('google.comments').toggle_all_comments()<CR>]])
vim.fn.sign_define('COMMENT_ICON', {text = ''})

View File

@ -30,6 +30,19 @@ local function getLightbulb()
return require('nvim-lightbulb').get_status_text()
end
local comments = require("google.comments")
local tracker = require("google.comments.tracker")
local dump = require("utils").dump
local function getLGTMs()
print(dump(tracker.get_all_comments()))
local lgtm = comments.get_lgtms()
local appr = comments.get_approvals()
print("lgtms"..dump(lgtm))
print("approvals"..dump(appr))
return "LGTM:"..table.concat(lgtm, ",").." Approval:"..table.concat(appr, ",")
end
require('lualine').setup {
options = {
theme = 'auto',
@ -58,7 +71,8 @@ require('lualine').setup {
-- lualine_c = {'filename'},
lualine_x = {
{ 'diagnostics', sources = {"nvim_lsp", "nvim_workspace_diagnostic"}, symbols = {error = '', warn = '', info = '', hint = ''} },
}
},
-- lualine_y = { getLGTMs }
},
-- default
-- sections = {

View File

@ -2,3 +2,4 @@ local colors = require("catppuccin.palettes").get_palette()
require("notify").setup({
background_colour = colors.base,
})
vim.notify = require("notify")

View File

@ -12,6 +12,9 @@ vim.cmd([[
augroup end
]])
local file_exists = require("utils").file_exists
require('packer').startup(function(use)
-- Packer can manage itself
use 'wbthomason/packer.nvim'
@ -41,6 +44,7 @@ require('packer').startup(function(use)
'hrsh7th/cmp-nvim-lsp',
'hrsh7th/cmp-buffer',
'lukas-reineke/cmp-under-comparator',
'williamboman/nvim-lsp-installer',
'hrsh7th/cmp-cmdline',
'f3fora/cmp-spell',
'hrsh7th/cmp-nvim-lsp-document-symbol',
@ -78,12 +82,34 @@ require('packer').startup(function(use)
}
end
}
use 'sso://googler@user/vintharas/telescope-codesearch.nvim'
use {
'sso://googler@user/vintharas/telescope-codesearch.nvim',
cond = file_exists(os.getenv("HOME").."/use_google"),
}
use {
-- 'sso://googler@user/chmnchiang/google-comments',
-- '/google/src/head/depot/google3/experimental/users/chmnchiang/neovim/google-comments',
'/google/src/cloud/cnieves/google-comments/google3/experimental/users/chmnchiang/neovim/google-comments',
cond = file_exists(os.getenv("HOME").."/use_google"),
requires = {'rcarriga/nvim-notify', 'nvim-lua/plenary.nvim'},
config = [[ require("google_comments") ]]
}
use {
'/google/src/cloud/cnieves/google-comments/google3/experimental/users/cnieves/neovim/critique',
config = [[ require("critique").setup() ]]
}
use {
'nvim-lualine/lualine.nvim',
config = [[ require("lualine_config") ]]
}
use 'rcarriga/nvim-notify'
use {
'rcarriga/nvim-notify',
config = [[ require("notify_config") ]]
}
-- Git
use {
@ -158,7 +184,6 @@ require("lsp")
require("diagnostics")
require("treesitter")
require("telescope_config")
require("notify_config")
require("symbols-outline-config")
require("spell_config")

View File

@ -8,4 +8,22 @@ function M.map(mode, lhs, rhs, opts)
vim.api.nvim_set_keymap(mode, lhs, rhs, options)
end
function M.file_exists(name)
local f=io.open(name,"r")
if f~=nil then io.close(f) return true else return false end
end
function M.dump(o)
if type(o) == 'table' then
local s = '{ '
for k,v in pairs(o) do
if type(k) ~= 'number' then k = '"'..k..'"' end
s = s .. '['..k..'] = ' .. dump(v) .. ','
end
return s .. '} '
else
return tostring(o)
end
end
return M

Submodule vim/.vim/plugged/google-comments deleted from ad50cd3c71

Submodule vim/.vim/plugged/nvim-lsp-installer deleted from 23820a878a

Submodule vim/.vim/plugged/vim-signify deleted from 8bc268c79d

View File

@ -1,76 +0,0 @@
" AirLine visual settings
if !exists('g:airline_symbols')
let g:airline_symbols = {}
endif
let g:airline_theme='onedark'
" let g:airline_stl_path_style = 'short'
let g:airline#extensions#coc#enabled = 1
let g:airline_left_sep=''
let g:airline_left_alt_sep = ''
let g:airline_right_sep=''
let g:airline_right_alt_sep = ''
let g:airline_symbols.branch = ''
let g:airline_symbols.readonly = ''
let g:airline_symbols.dirty = ''
let g:airline_symbols.linenr = '␤'
"let g:airline_symbols.whitespace = 'Ξ'
let g:airline_powerline_fonts = 1
let g:airline#extensions#tabline#enabled = 1
let g:airline#extensions#tabline#formatter = 'unique_tail_improved'
let g:airline#extensions#tabline#show_buffers = 0
let g:airline#extensions#tabline#show_splits = 1
let g:airline#extensions#tabline#show_tabs = 1
let g:airline#extensions#tabline#show_tab_nr = 0
let g:airline#extensions#tabline#show_tab_type = 0
let g:airline#extensions#tabline#exclude_preview = 1
let g:airline#extensions#tabline#show_close_button = 0
let g:airline#extensions#tabline#fnamemod = ':t'
lua << EOF
function getCitc()
local fname = vim.api.nvim_buf_get_name(0)
if string.find(fname, '/google/src/cloud/', 1, true) then
local parts = split(fname, '/')
return parts[5]
end
end
EOF
" let g:airline_section_c = execute("lua getCitc()")
let g:airline_mode_map = {
\ '__' : '------',
\ 'n' : 'NORMAL',
\ 'c' : 'COMMAND',
\ 'i' : 'INSERT',
\ 'R' : 'REPLACE',
\ 's' : 'SELECT',
\ 'S' : 'S-LINE',
\ '' : 'S-BLOCK',
\ 'v' : 'VISUAL',
\ 'V' : 'V-LINE',
\ '' : 'V-BLOCK',
\ }
let g:PaperColor_Theme_Options = {
\ 'language': {
\ 'python': {
\ 'highlight_builtins' : 1
\ },
\ 'cpp': {
\ 'highlight_standard_library': 1
\ },
\ 'c': {
\ 'highlight_builtins' : 1
\ }
\ },
\ 'theme': {
\ 'default.dark': {
\ 'transparent_background': 1
\ }
\ }
\ }

View File

@ -1,21 +0,0 @@
function! s:FindProjectRoot(buffer) abort
for l:path in ale#path#Upwards(expand('#' . a:buffer . ':p:h'))
if filereadable(l:path . '/BUILD')
return l:path
endif
endfor
endfunction
let ciderlsp = {
\ 'name': 'CiderLSP',
\ 'lsp': 'stdio',
\ 'executable': '/google/bin/releases/cider/ciderlsp/ciderlsp',
\ 'command': '%e --noforward_sync_responses',
\ 'project_root': function('s:FindProjectRoot'),
\}
call ale#linter#Define('java', ciderlsp)
let g:ale_lint_on_save = 1
let g:ale_detail_to_floating_preview = 1
let g:ale_linters={'java': ['CiderLSP']}
let g:ale_completion_enabled = 1

View File

@ -1,53 +0,0 @@
Plug 'prabirshrestha/vim-lsp'
Plug 'prabirshrestha/asyncomplete.vim'
Plug 'prabirshrestha/asyncomplete-lsp.vim'
au User lsp_setup call lsp#register_server({
\ 'name': 'CiderLSP',
\ 'cmd': {server_info->[
\ '/google/bin/releases/cider/ciderlsp/ciderlsp',
\ '--tooltag=vim-lsp',
\ '--noforward_sync_responses',
\ '-hub_addr=blade:languageservices-staging'
\ ]},
\ 'allowlist': ['c', 'cpp', 'java', 'kotlin', 'proto', 'textproto', 'go', 'python', 'bzl', 'sql', 'yaml', 'googlesql', 'build', 'typescript', 'gcl', 'soy'],
\})
" Send async completion requests.
" WARNING: Might interfere with other completion plugins.
let g:lsp_async_completion = 1
" Enable UI for diagnostics
let g:lsp_signs_enabled = 1 " enable diagnostics signs in the gutter
let g:lsp_diagnostics_echo_cursor = 1 " enable echo under cursor when in normal mode
let g:lsp_diagnostics_float_cursor = 1 " enable floating window diagnostics
" Automatically show completion options
let g:asyncomplete_auto_popup = 1
function! s:on_lsp_buffer_enabled() abort
setlocal omnifunc=lsp#complete
setlocal signcolumn=yes
if exists('+tagfunc') | setlocal tagfunc=lsp#tagfunc | endif
nmap <buffer> gd <plug>(lsp-definition)
nmap <buffer> gs <plug>(lsp-document-symbol-search)
nmap <buffer> gS <plug>(lsp-workspace-symbol-search)
nmap <buffer> gr <plug>(lsp-references)
nmap <buffer> gi <plug>(lsp-implementation)
nmap <buffer> gt <plug>(lsp-type-definition)
nmap <buffer> ga <plug>(lsp-code-action)
nmap <buffer> <leader>rn <plug>(lsp-rename)
nmap <buffer> [g <plug>(lsp-previous-diagnostic)
nmap <buffer> ]g <plug>(lsp-next-diagnostic)
inoremap <buffer> <expr><c-f> lsp#scroll(+4)
inoremap <buffer> <expr><c-d> lsp#scroll(-4)
nmap <buffer> L <plug>(lsp-hover)
endfunction
augroup lsp_install
au!
" call s:on_lsp_buffer_enabled only for languages that has the server registered.
autocmd User lsp_buffer_enabled call s:on_lsp_buffer_enabled()
augroup END

View File

@ -1,22 +0,0 @@
let s:brown = "964B00"
let s:aqua = "3AFFDB"
let s:blue = "689FB6"
let s:darkBlue = "44788E"
let s:purple = "834F79"
let s:lightPurple = "834F79"
let s:red = "AE403F"
let s:beige = "F5C06F"
let s:yellow = "F09F17"
let s:orange = "D4843E"
let s:darkOrange = "F16529"
let s:pink = "CB6F6F"
let s:salmon = "EE6E73"
let s:green = "8FAA54"
let s:lightGreen = "31B53E"
let s:white = "FFFFFF"
let s:rspec_red = 'FE405F'
let s:git_orange = 'F54D27'
" If you have vim-devicons you can customize your icons for each file type.
let g:NERDTreeExtensionHighlightColor = {} "this line is needed to avoid error
let g:NERDTreeExtensionHighlightColor['java'] = s:lightGreen "assigning it to an empty string will skip highlight

View File

@ -2,9 +2,7 @@ source /usr/share/vim/google/glug/bootstrap.vim
source /usr/share/vim/google/core.vim
Plug 'vim-scripts/vcscommand.vim'
Plug 'sso://user/chmnchiang/google-comments'
Plug 'sso://googler@user/piloto/cmp-nvim-ciderlsp'
Plug 'williamboman/nvim-lsp-installer'
let g:signify_skip_filename_pattern = ['\.pipertmp.*']

View File

@ -1,2 +0,0 @@
autocmd InsertLeave * :lua require('google.comments').update_signs()
autocmd InsertLeave * :GoogleCommentsFetchComments

View File

@ -61,6 +61,7 @@ alias safergcp=/google/bin/releases/safer-gcp/tools/safergcp
alias add_deps_to_usages='/google/src/head/depot/google3/apps/framework/tools/add_deps_to_usages.sh'
alias plxutil='/google/data/ro/teams/plx/plxutil'
export HGSHORT_CMDS="cat head tail mv cp rm chmod g4 diff merge patch meld trim less more"
alias vim="source $HGSHORT_DIR/tobashargs.sh nvim"
source /etc/bash_completion.d/hgd
alias hgd='source /google/src/head/depot/google3/experimental/fig_contrib/hgshort/hgd-local.sh'
alias builddoctor=/google/bin/releases/build-doctor/builddoctor