nicer lsp
This commit is contained in:
parent
3bea51a834
commit
a309cf3fb3
|
@ -19,6 +19,15 @@ let
|
|||
sha256 = "rs3NTZwWdsmBGXnrgUeVxUiNjbN/ULxJHifPYJD9mT4=";
|
||||
};
|
||||
};
|
||||
my-lspsaga = pkgs.vimUtils.buildVimPluginFrom2Nix {
|
||||
name = "lspsaga.nvim";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "glepnir";
|
||||
repo = "lspsaga.nvim";
|
||||
rev = "b7b4777369b441341b2dcd45c738ea4167c11c9e";
|
||||
sha256 = "sciX/fMxzY1YOxXxjj1+ymrdMi451avcFFu+14R+/pk=";
|
||||
};
|
||||
};
|
||||
nvim-luapad = pkgs.vimUtils.buildVimPluginFrom2Nix {
|
||||
name = "nvim-luapad";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
|
@ -57,16 +66,6 @@ let
|
|||
};
|
||||
meta.homepage = "https://github.com/folke/which-key.nvim/";
|
||||
};
|
||||
my-conjure = pkgs.vimUtils.buildVimPluginFrom2Nix {
|
||||
pname = "conjure";
|
||||
version = "2022-05-04";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "olical";
|
||||
repo = "conjure";
|
||||
rev = "2e7f449d06753f2996e186954e96afc60edd5862";
|
||||
sha256 = "ZV0vPYiZI5/3Isw2l7rrLuiO+kA9G0vrA6OxHFkLTFw=";
|
||||
};
|
||||
};
|
||||
scnvim = pkgs.vimUtils.buildVimPluginFrom2Nix {
|
||||
pname = "scnvim";
|
||||
version = "2022-06-04";
|
||||
|
@ -261,6 +260,8 @@ in
|
|||
" Sexp in Conjure (since it's fennel)
|
||||
let g:sexp_filetypes = "clojure,scheme,lisp,janet,fennel,yuck"
|
||||
let g:conjure#filetype#fennel = "conjure.client.fennel.stdio"
|
||||
" let g:conjure#extract#tree_sitter#enabled = true
|
||||
map <localleader>lt :ConjureLogToggle<CR>
|
||||
|
||||
let g:rainbow_active = 0
|
||||
autocmd BufReadPost,BufNewFile c,clj,cljs RainbowParenthesesToggleAll
|
||||
|
@ -338,23 +339,25 @@ in
|
|||
let g:fzf_layout = { 'window': { 'width': 0.8, 'height': 0.8 } }
|
||||
|
||||
" lsp commands
|
||||
nnoremap <leader>vd :lua vim.lsp.buf.definition()<CR>
|
||||
" nnoremap <leader>vd :lua vim.lsp.buf.definition()<CR>
|
||||
nnoremap <leader>vi :lua require('telescope.builtin').lsp_implementation()<CR>
|
||||
nnoremap <leader>vsh :lua vim.lsp.buf.signature_help()<CR>
|
||||
nnoremap <leader>vrr :lua require('telescope.builtin').lsp_references()<CR>
|
||||
nnoremap <leader>vrn :lua vim.lsp.buf.rename()<CR>
|
||||
nnoremap <leader>vh :lua vim.lsp.buf.hover()<CR>
|
||||
nnoremap <leader>vca :lua vim.lsp.buf.code_action()<CR>
|
||||
nnoremap <leader>vsd :lua vim.lsp.util.show_line_diagnostics()<CR>
|
||||
nnoremap <leader>vn :lua vim.lsp.diagnostic.goto_next()<CR>
|
||||
nnoremap <leader>va :lua require('telescope.builtin').lsp_code_actions(require('telescope.themes').get_cursor())<cr>
|
||||
" nnoremap <leader>vrn :lua vim.lsp.buf.rename()<CR>
|
||||
" nnoremap <leader>vh :lua vim.lsp.buf.hover()<CR>
|
||||
" nnoremap <leader>vca :lua vim.lsp.buf.code_action()<CR>
|
||||
" nnoremap <leader>vsd :lua vim.lsp.util.show_line_diagnostics()<CR>
|
||||
" nnoremap <leader>vn :lua vim.lsp.diagnostic.goto_next()<CR>
|
||||
" nnoremap <leader>va :lua require('telescope.builtin').lsp_code_actions(require('telescope.themes').get_cursor())<cr>
|
||||
" lspsaga stuff doesn't work
|
||||
" nnoremap <leader>vd :call Lspsaga peek_definition<CR>
|
||||
" nnoremap <leader>vrn :call Lspsaga rename<CR><CR>
|
||||
" nnoremap <leader>vh :call Lspsaga hover_doc<CR>
|
||||
" nnoremap <leader>vca :call Lspsaga code_action<CR>
|
||||
" nnoremap <leader>vsd :call Lspsaga show_line_diagnostics<CR>
|
||||
" nnoremap <leader>vn :call Lspsaga diagnostic_jump_prev<CR>
|
||||
nnoremap <leader>vd :Lspsaga peek_definition<CR>
|
||||
nnoremap <leader>vrn :Lspsaga rename<CR><CR>
|
||||
nnoremap <leader>vh :Lspsaga hover_doc<CR>
|
||||
nnoremap <leader>vca :Lspsaga code_action<CR>
|
||||
nnoremap <leader>vsd :Lspsaga show_line_diagnostics<CR>
|
||||
nnoremap <leader>vs :Dasht<Space>
|
||||
nnoremap <leader>vn :Lspsaga diagnostic_jump_prev<CR>
|
||||
nnoremap <leader>vo :LSoutlineToggle<CR>
|
||||
|
||||
" dashboard
|
||||
let g:dashboard_custom_header = [
|
||||
|
@ -582,18 +585,37 @@ in
|
|||
local navic = require("nvim-navic")
|
||||
|
||||
-- lspsaga, code_action lightbulb is annoying
|
||||
-- local saga = require('lspsaga')
|
||||
-- saga.init_lsp_saga({
|
||||
-- code_action_lightbulb = {
|
||||
-- enable = true,
|
||||
-- enable_in_insert = true,
|
||||
-- cache_code_action = true,
|
||||
-- sign = true,
|
||||
-- update_time = 150,
|
||||
-- sign_priority = 4,
|
||||
-- virtual_text = false,
|
||||
-- },
|
||||
-- })
|
||||
local saga = require('lspsaga')
|
||||
saga.init_lsp_saga({
|
||||
border_style = "rounded",
|
||||
code_action_icon = "",
|
||||
code_action_num_shortcut = true,
|
||||
code_action_lightbulb = {
|
||||
enable = false,
|
||||
enable_in_insert = false,
|
||||
cache_code_action = true,
|
||||
sign = true,
|
||||
update_time = 150,
|
||||
sign_priority = 20,
|
||||
virtual_text = false,
|
||||
},
|
||||
code_action_keys = {
|
||||
quit = 'q',
|
||||
exec = '<CR>',
|
||||
},
|
||||
-- show outline
|
||||
show_outline = {
|
||||
win_position = 'right',
|
||||
--set special filetype win that outline window split.like NvimTree neotree
|
||||
-- defx, db_ui
|
||||
auto_enter = true,
|
||||
auto_preview = true,
|
||||
virt_text = '┃',
|
||||
jump_key = 'o',
|
||||
-- auto refresh when change buffer
|
||||
auto_refresh = true,
|
||||
},
|
||||
})
|
||||
|
||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities)
|
||||
|
@ -806,6 +828,11 @@ in
|
|||
}
|
||||
require('twilight').setup{}
|
||||
|
||||
-- hologram
|
||||
require('hologram').setup{
|
||||
auto_display = true -- WIP automatic markdown image display, may be prone to breaking
|
||||
}
|
||||
|
||||
EOF
|
||||
|
||||
'';
|
||||
|
@ -855,7 +882,8 @@ in
|
|||
nvim-peekup
|
||||
zen-mode-nvim
|
||||
twilight-nvim
|
||||
lspsaga-nvim
|
||||
my-lspsaga
|
||||
vim-dasht
|
||||
|
||||
# language
|
||||
vim-nix
|
||||
|
@ -870,6 +898,7 @@ in
|
|||
vimwiki
|
||||
taskwiki
|
||||
vim-zettel
|
||||
hologram-nvim
|
||||
|
||||
# lsp stuff
|
||||
# nvim-lint
|
||||
|
|
Loading…
Reference in a new issue