diff --git a/tmux/.tmux.conf b/tmux/.tmux.conf index 386f269..fdcbff6 100644 --- a/tmux/.tmux.conf +++ b/tmux/.tmux.conf @@ -4,6 +4,8 @@ set-option -g update-environment "SSH_ASKPASS SSH_AUTH_SOCK SSH_AGENT_PID SSH_CO set -g prefix C-a bind C-a send-prefix +set -g mouse on + set -g prefix ` bind-key ` send-prefix diff --git a/vim/.vim/lua/diagnostics.lua b/vim/.vim/lua/diagnostics.lua index a5b315f..2ed22c5 100644 --- a/vim/.vim/lua/diagnostics.lua +++ b/vim/.vim/lua/diagnostics.lua @@ -1,25 +1,12 @@ -- Diagnostics require("trouble").setup({ - position = "bottom", -- position of the list can be: bottom, top, left, right - height = 10, -- height of the trouble list when position is top or bottom - width = 50, -- width of the list when position is left or right - icons = true, -- use devicons for filenames - mode = "document_diagnostics", -- "workspace_diagnostics", "document_diagnostics", "quickfix", "lsp_references", "loclist" - -- fold_open = "", -- icon used for open folds - -- fold_closed = "", -- icon used for closed folds - group = true, -- group results by file - padding = true, -- add an extra new line on top of the list - indent_lines = true, -- add an indent guide below the fold icons - auto_open = false, -- automatically open the list when you have diagnostics - auto_close = true, -- automatically close the list when you have no diagnostics - auto_jump = { "lsp_definitions" }, -- for the given modes, automatically jump if there is only a single result signs = { -- icons / text used for a diagnostic error = ' ', warning = ' ', hint = ' ', information = ' ', - other = "﫠", + other = "?﫠", }, use_diagnostic_signs = false, -- enabling this will use the signs defined in your lsp client }) diff --git a/vim/.vim/lua/lsp.lua b/vim/.vim/lua/lsp.lua index d750fd6..c09ba02 100644 --- a/vim/.vim/lua/lsp.lua +++ b/vim/.vim/lua/lsp.lua @@ -23,16 +23,22 @@ if use_google() then default_config = { cmd = { "/google/bin/releases/cider/ciderlsp/ciderlsp", "--tooltag=nvim-cmp", "--forward_sync_responses" }, filetypes = { "c", "cpp", "java", "kotlin", "objc", "proto", "textproto", "go", "python", "bzl" }, - root_dir = lspconfig.util.root_pattern("BUILD"), + -- root_dir = lspconfig.util.root_pattern("BUILD"), + root_dir = function(fname) + return string.match(fname, '(/google/src/cloud/[%w_-]+/[%w_-]+/google3/).+$') + end; settings = {}, }, } configs.analysislsp = { default_config = { - cmd = { '/google/bin/users/lerm/glint-ale/analysis_lsp/server', '--lint_on_save=false', '--max_qps=10', }, + cmd = { '/google/bin/users/lerm/glint-ale/analysis_lsp/server', '--lint_on_save=false', '--max_qps=10' }, filetypes = { "c", "cpp", "java", "kotlin", "objc", "proto", "textproto", "go", "python", "bzl" }, - root_dir = lspconfig.util.root_pattern('BUILD'), + -- root_dir = lspconfig.util.root_pattern('BUILD'), + root_dir = function(fname) + return string.match(fname, '(/google/src/cloud/[%w_-]+/[%w_-]+/google3/).+$') + end; settings = {}, }, } @@ -193,7 +199,7 @@ local has_words_before = function() end local feedkey = function(key, mode) - vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes(key, true, true, true), mode, true) + vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes(key, true, true, true), mode, true) end -- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore). @@ -292,7 +298,26 @@ cmp.setup({ sources = conditionalSources, sorting = { - comparators = { }, + comparators = { + cmp.config.compare.offset, + cmp.config.compare.exact, + cmp.config.compare.score, + function(entry1, entry2) + local _, entry1_under = entry1.completion_item.label:find("^_+") + local _, entry2_under = entry2.completion_item.label:find("^_+") + entry1_under = entry1_under or 0 + entry2_under = entry2_under or 0 + if entry1_under > entry2_under then + return false + elseif entry1_under < entry2_under then + return true + end + end, + cmp.config.compare.kind, + cmp.config.compare.sort_text, + cmp.config.compare.length, + cmp.config.compare.order, + }, }, snippet = { diff --git a/vim/.vim/lua/lualine_config.lua b/vim/.vim/lua/lualine_config.lua index f3fad73..e872eaa 100644 --- a/vim/.vim/lua/lualine_config.lua +++ b/vim/.vim/lua/lualine_config.lua @@ -17,7 +17,7 @@ local function isCiderLspAttached() if vim.b['is_cider_lsp_attached'] == 'yes' then return '✓' else - return 'CiderLSP loading..' + return 'LSP..' end else return '' @@ -53,8 +53,8 @@ require('lualine').setup { }, sections = { lualine_a = {'mode'}, - lualine_b = {'branch', 'diff', getCitc, isCiderLspAttached}, - lualine_c = {'filename', 'lsp_progress', getLightbulb}, + lualine_b = {'branch', 'diff', getCitc, isCiderLspAttached, 'lsp_progress'}, + lualine_c = {'filename', getLightbulb}, lualine_x = { { 'diagnostics', sources = {"nvim_lsp"}, symbols = {error = ' ', warn = ' ', info = ' ', hint = ' '} }, 'encoding', diff --git a/vim/.vim/lua/plugins.lua b/vim/.vim/lua/plugins.lua index cc8fef4..d2b94bc 100644 --- a/vim/.vim/lua/plugins.lua +++ b/vim/.vim/lua/plugins.lua @@ -110,6 +110,12 @@ require('packer').startup(function(use) disable = not use_google(), } + use { + 'sso://googler@user/piloto/cmp-nvim-ciderlsp', + 'sso://googler@user/kdark/ciderlsp-nvim', + disable = not use_google(), + } + use { 'sso://googler@user/chmnchiang/google-comments', -- '/google/src/head/depot/google3/experimental/users/chmnchiang/neovim/google-comments', diff --git a/vim/.vim/prefs/google.vim b/vim/.vim/prefs/google.vim index a0e017f..7a9485c 100644 --- a/vim/.vim/prefs/google.vim +++ b/vim/.vim/prefs/google.vim @@ -2,7 +2,6 @@ source /usr/share/vim/google/glug/bootstrap.vim source /usr/share/vim/google/core.vim Plug 'vim-scripts/vcscommand.vim' -Plug 'sso://googler@user/piloto/cmp-nvim-ciderlsp' let g:VCSCommandDisableMappings = 1