This commit is contained in:
Christian Nieves
2022-10-18 23:32:44 +00:00
parent 21837e0336
commit 99215a3333
10 changed files with 109 additions and 63 deletions

View File

@ -1,9 +1,13 @@
vim.g.catppuccin_flavour = "macchiato" -- latte, frappe, macchiato, mocha
local colors = require("catppuccin.palettes").get_palette()
require("catppuccin").setup({
compile_path = vim.fn.stdpath("cache") .. "/catppuccin",
transparent_background = false,
term_colors = false,
dim_inactive = {
enabled = false,
enabled = true,
shade = "dark",
percentage = 0.15,
},
@ -83,5 +87,15 @@ require("catppuccin").setup({
},
},
color_overrides = {},
custom_highlights = {},
custom_highlights = {
-- Type = { fg = colors.blue },
-- Function = { fg = colors.sapphire },
-- Identifier = { fg = colors.mauve },
-- --
Function = { fg = colors.mauve },
},
})
require('catppuccin').compile()
vim.api.nvim_command "colorscheme catppuccin"

View File

@ -4,7 +4,8 @@ require("trouble").setup({
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 = "workspace_diagnostics", -- "workspace_diagnostics", "document_diagnostics", "quickfix", "lsp_references", "loclist"
-- mode = "workspace_diagnostics", -- "workspace_diagnostics", "document_diagnostics", "quickfix", "lsp_references", "loclist"
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

View File

@ -0,0 +1,40 @@
-- 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=''"},
command = {'/google/bin/releases/editor-devtools/get_comments.par', '--json', '--full', '--noresolved', '--cl_comments', '--file_comments', '--unreplied_only', ' -x ""'},
-- 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
-- example above.
sign = 'COMMENT_ICON',
-- Fetch the comments after calling `setup`.
auto_fetch = true,
display = {
-- The width of the comment display window.
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 = require('google.comments.options')
.default_floating_window_options,
}
-- 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 })
vim.fn.sign_define('COMMENT_ICON', {text = ''})

View File

@ -1,11 +1,12 @@
-- 1. Configure CiderLSP
local nvim_lsp = require("lspconfig")
local configs = require("lspconfig.configs")
local notify = require 'notify'
configs.ciderlsp = {
default_config = {
cmd = { "/google/bin/releases/cider/ciderlsp/ciderlsp", "--tooltag=nvim-lsp", "--forward_sync_responses", "--enable_semantic_tokens", "--relay_mode=true", "--hub_addr=blade:languageservices-staging" ,"--enable_document_highlight"},
cmd = { "/google/bin/releases/cider/ciderlsp/ciderlsp", "--tooltag=nvim-cmp", "--forward_sync_responses", "--enable_semantic_tokens", "--relay_mode=true", "--hub_addr=blade:languageservices-staging" ,"--enable_document_highlight"},
-- cmd = {'/google/bin/releases/cider/ciderlsp/ciderlsp', '--forward_sync_responses', '--enable_document_highlight'};
filetypes = { "c", "cpp", "java", "kotlin", "proto", "textproto", "go", "python", "bzl" },
filetypes = { "c", "cpp", "java", "kotlin", "objc", "proto", "textproto", "go", "python", "bzl" },
root_dir = nvim_lsp.util.root_pattern("BUILD"),
settings = {},
},
@ -121,8 +122,9 @@ cmp.setup({
with_text = true,
maxwidth = 40, -- half max width
menu = {
nvim_ciderlsp = "[🤖]",
buffer = "[buffer]",
-- nvim_ciderlsp = "[]",
nvim_ciderlsp = "",
buffer = "",
nvim_lsp = "[CiderLSP]",
nvim_lua = "[API]",
path = "[path]",
@ -157,7 +159,7 @@ cider_lsp_handlers["$/syncResponse"] = function(_, result, ctx)
local first_fire = vim.b['is_cider_lsp_attached'] == 'no'
vim.b['is_cider_lsp_attached'] = 'yes'
if first_fire then
require('notify')('CiderLSP attached', 'info', {timeout=150})
notify('CiderLSP attached', 'info', {timeout=500})
require('lualine').refresh()
end
end
@ -169,6 +171,23 @@ cider_lsp_handlers["workspace/diagnostic/refresh"] = function(_, result, ctx)
VPrint(ctx)
end
cider_lsp_handlers['window/showMessage'] = function(_, result, ctx)
local client = vim.lsp.get_client_by_id(ctx.client_id)
local lvl = ({
'ERROR',
'WARN',
'INFO',
'DEBUG',
})[result.type]
notify({ result.message }, lvl, {
title = 'LSP | ' .. client.name,
timeout = 1000,
keep = function()
return lvl == 'ERROR' or lvl == 'WARN'
end,
})
end
-- 3. Set up CiderLSP
local on_attach = function(client, bufnr)
vim.b['is_cider_lsp_attached'] = 'no'

View File

@ -1,45 +1,2 @@
lua << EOF
-- 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=''"},
command = {'/google/bin/releases/editor-devtools/get_comments.par', '--json', '--full', '--noresolved', '--cl_comments', '--file_comments', ' -x ""'},
-- 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
-- example above.
sign = 'COMMENT_ICON',
-- Fetch the comments after calling `setup`.
auto_fetch = true,
display = {
-- The width of the comment display window.
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 = require('google.comments.options')
.default_floating_window_options,
}
-- 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 })
vim.fn.sign_define('COMMENT_ICON', {text = ''})
EOF
autocmd InsertLeave * :lua require('google.comments').update_signs()
autocmd InsertLeave * :GoogleCommentsFetchComments

View File

@ -35,7 +35,6 @@ Plug 'rcarriga/nvim-notify'
Plug 'nathanaelkane/vim-indent-guides'
Plug 'Konfekt/vim-scratchpad'
Plug 'guns/xterm-color-table.vim'
Plug 'kyazdani42/nvim-web-devicons'
Plug 'mbbill/undotree'
Plug 'tversteeg/registers.nvim', { 'branch': 'main' }
" Plug 'ryanoasis/vim-devicons'
@ -131,6 +130,7 @@ Plug 'kristiandupont/shades-of-teal'
Plug 'joshdick/onedark.vim'
Plug 'google/vim-colorscheme-primary'
Plug 'kyoz/purify', { 'rtp': 'vim' }
Plug 'kyazdani42/nvim-web-devicons'
" ONE LINERS ONLY
set statusline=%{pathshorten(expand('%:f'))}

View File

@ -75,6 +75,8 @@ let g:clipboard = #{
\ cache_enabled: 1,
\ }
set shortmess=A
set modifiable
set omnifunc= completeopt=menuone,noinsert,noselect
set updatetime=100
@ -105,6 +107,7 @@ if filereadable(expand("~/use_google"))
source ~/.vim/prefs/cmp.vim
source ~/.vim/prefs/imp.vim
source ~/.vim/prefs/google_comments.vim
lua require("google_comments")
endif
filetype plugin on " redundant?
@ -143,16 +146,26 @@ endif
set background=dark
let $NVIM_TUI_ENABLE_TRUE_COLOR=1
" colorscheme quantum
let g:catppuccin_flavour = "macchiato" " latte, frappe, macchiato, mocha
colorscheme catppuccin
let g:airline_theme='quantum'
set modifiable
set omnifunc= completeopt=menuone,noinsert,noselect
let g:lsp_log_verbose = 1
let g:lsp_log_file = expand('~/vim-lsp.log')
"Don't ask to save when changing buffers (i.e. when jumping to a type definition)
set hidden
function! GenerateUnicode(first, last)
let i = a:first
while i <= a:last
if (i%256 == 0)
$put ='----------------------------------------------------'
$put =' 0 1 2 3 4 5 6 7 8 9 A B C D E F '
$put ='----------------------------------------------------'
endif
let c = printf('%04X ', i)
for j in range(16)
let c = c . nr2char(i) . ' '
let i += 1
endfor
$put =c
endwhile
endfunction