plugin config(symbols outline, catpuccin, lsp)
This commit is contained in:
@ -89,6 +89,7 @@ require("catppuccin").setup({
|
||||
color_overrides = {},
|
||||
custom_highlights = {
|
||||
Identifier = { fg = colors.lavender },
|
||||
Statement = { fg = colors.rosewater },
|
||||
-- Identifier = { fg = colors.sapphire },
|
||||
Function = { fg = colors.mauve },
|
||||
},
|
||||
|
@ -1,5 +1,5 @@
|
||||
-- 1. Configure CiderLSP
|
||||
local nvim_lsp = require("lspconfig")
|
||||
local lspconfig = require("lspconfig")
|
||||
local configs = require("lspconfig.configs")
|
||||
local notify = require 'notify'
|
||||
configs.ciderlsp = {
|
||||
@ -7,7 +7,7 @@ configs.ciderlsp = {
|
||||
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", "objc", "proto", "textproto", "go", "python", "bzl" },
|
||||
root_dir = nvim_lsp.util.root_pattern("BUILD"),
|
||||
root_dir = lspconfig.util.root_pattern("BUILD"),
|
||||
settings = {},
|
||||
},
|
||||
}
|
||||
@ -28,18 +28,18 @@ lspkind.init()
|
||||
|
||||
local cmp = require("cmp")
|
||||
|
||||
require'cmp'.setup.cmdline(':', {
|
||||
sources = {
|
||||
{ name = 'cmdline' }
|
||||
}
|
||||
cmp.setup.cmdline(':', {
|
||||
sources = {
|
||||
{ name = 'cmdline' }
|
||||
}
|
||||
})
|
||||
|
||||
cmp.setup.cmdline('/', {
|
||||
sources = cmp.config.sources({
|
||||
{ name = 'nvim_lsp_document_symbol' }
|
||||
}, {
|
||||
{ name = 'buffer' }
|
||||
})
|
||||
sources = cmp.config.sources({
|
||||
{ name = 'nvim_lsp_document_symbol' }
|
||||
}, {
|
||||
{ name = 'buffer' }
|
||||
})
|
||||
})
|
||||
|
||||
cmp.setup({
|
||||
@ -182,27 +182,23 @@ end
|
||||
cider_lsp_handlers["workspace/diagnostic/refresh"] = function(_, result, ctx)
|
||||
notify('result:'..result, 'info', {timeout=900})
|
||||
notify('ctx:'..ctx, 'info', {timeout=900})
|
||||
|
||||
VPrint(result)
|
||||
VPrint('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,
|
||||
})
|
||||
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
|
||||
@ -264,8 +260,37 @@ capabilities.textDocument.publishDiagnostics={
|
||||
--layeredDiagnostics=true
|
||||
}
|
||||
|
||||
nvim_lsp.ciderlsp.setup({
|
||||
lspconfig.ciderlsp.setup({
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
handlers = cider_lsp_handlers,
|
||||
})
|
||||
|
||||
local runtime_path = vim.split(package.path, ";")
|
||||
table.insert(runtime_path, "lua/?.lua")
|
||||
table.insert(runtime_path, "lua/?/init.lua")
|
||||
|
||||
lspconfig.sumneko_lua.setup({
|
||||
settings = {
|
||||
Lua = {
|
||||
runtime = {
|
||||
-- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim)
|
||||
version = "LuaJIT",
|
||||
-- Setup your lua path
|
||||
path = runtime_path,
|
||||
},
|
||||
diagnostics = {
|
||||
-- Get the language server to recognize the `vim` global
|
||||
globals = { "vim" },
|
||||
},
|
||||
workspace = {
|
||||
-- Make the server aware of Neovim runtime files
|
||||
library = vim.api.nvim_get_runtime_file("", true),
|
||||
},
|
||||
-- Do not send telemetry data containing a randomized but unique identifier
|
||||
telemetry = {
|
||||
enable = false,
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
@ -1,4 +1,23 @@
|
||||
require("symbols-outline").setup()
|
||||
require("symbols-outline").setup(
|
||||
{
|
||||
show_relative_numbers = true,
|
||||
keymaps = { -- These keymaps can be a string or a table for multiple keys
|
||||
-- close = {"<Esc>", "q"},
|
||||
-- goto_location = "<Cr>",
|
||||
-- focus_location = "o",
|
||||
-- hover_symbol = "<C-space>",
|
||||
toggle_preview = "L",
|
||||
-- rename_symbol = "r",
|
||||
-- code_actions = "a",
|
||||
-- fold = "h",
|
||||
-- unfold = "l",
|
||||
fold_all = "H",
|
||||
unfold_all = "L",
|
||||
fold_reset = "R",
|
||||
},
|
||||
}
|
||||
)
|
||||
|
||||
local map = require("utils").map
|
||||
map('n', '<leader>so', ':SymbolsOutline<cr>')
|
||||
map('n', '<leader>o', ':SymbolsOutline<cr>')
|
||||
|
@ -4,6 +4,7 @@
|
||||
# For running crow against a remote X server
|
||||
# xhost +
|
||||
export PATH=$PATH:/google/src/head/depot/google3/experimental/users/cnieves/util
|
||||
export PATH="${HOME}/.config/lsp/lua-language-server/bin:${PATH}"
|
||||
export XAUTHORITY=~/.Xauthority
|
||||
export GOROOT=/usr/lib/google-golang
|
||||
export PATH=$GOROOT/bin:$PATH
|
||||
|
@ -251,3 +251,5 @@ export ZSH="$HOME/.oh-my-zsh"
|
||||
source $ZSH/oh-my-zsh.sh
|
||||
|
||||
source ~/.bash_profile
|
||||
|
||||
alias luamake=/luamake
|
||||
|
Reference in New Issue
Block a user