nicer lsp

This commit is contained in:
Anish Lakhwara 2022-12-21 21:43:00 +10:00
parent 3bea51a834
commit a309cf3fb3

View file

@ -19,6 +19,15 @@ let
sha256 = "rs3NTZwWdsmBGXnrgUeVxUiNjbN/ULxJHifPYJD9mT4="; 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 { nvim-luapad = pkgs.vimUtils.buildVimPluginFrom2Nix {
name = "nvim-luapad"; name = "nvim-luapad";
src = pkgs.fetchFromGitHub { src = pkgs.fetchFromGitHub {
@ -57,16 +66,6 @@ let
}; };
meta.homepage = "https://github.com/folke/which-key.nvim/"; 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 { scnvim = pkgs.vimUtils.buildVimPluginFrom2Nix {
pname = "scnvim"; pname = "scnvim";
version = "2022-06-04"; version = "2022-06-04";
@ -261,6 +260,8 @@ in
" Sexp in Conjure (since it's fennel) " Sexp in Conjure (since it's fennel)
let g:sexp_filetypes = "clojure,scheme,lisp,janet,fennel,yuck" let g:sexp_filetypes = "clojure,scheme,lisp,janet,fennel,yuck"
let g:conjure#filetype#fennel = "conjure.client.fennel.stdio" 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 let g:rainbow_active = 0
autocmd BufReadPost,BufNewFile c,clj,cljs RainbowParenthesesToggleAll autocmd BufReadPost,BufNewFile c,clj,cljs RainbowParenthesesToggleAll
@ -338,23 +339,25 @@ in
let g:fzf_layout = { 'window': { 'width': 0.8, 'height': 0.8 } } let g:fzf_layout = { 'window': { 'width': 0.8, 'height': 0.8 } }
" lsp commands " 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>vi :lua require('telescope.builtin').lsp_implementation()<CR>
nnoremap <leader>vsh :lua vim.lsp.buf.signature_help()<CR> nnoremap <leader>vsh :lua vim.lsp.buf.signature_help()<CR>
nnoremap <leader>vrr :lua require('telescope.builtin').lsp_references()<CR> nnoremap <leader>vrr :lua require('telescope.builtin').lsp_references()<CR>
nnoremap <leader>vrn :lua vim.lsp.buf.rename()<CR> " nnoremap <leader>vrn :lua vim.lsp.buf.rename()<CR>
nnoremap <leader>vh :lua vim.lsp.buf.hover()<CR> " nnoremap <leader>vh :lua vim.lsp.buf.hover()<CR>
nnoremap <leader>vca :lua vim.lsp.buf.code_action()<CR> " nnoremap <leader>vca :lua vim.lsp.buf.code_action()<CR>
nnoremap <leader>vsd :lua vim.lsp.util.show_line_diagnostics()<CR> " nnoremap <leader>vsd :lua vim.lsp.util.show_line_diagnostics()<CR>
nnoremap <leader>vn :lua vim.lsp.diagnostic.goto_next()<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>va :lua require('telescope.builtin').lsp_code_actions(require('telescope.themes').get_cursor())<cr>
" lspsaga stuff doesn't work " lspsaga stuff doesn't work
" nnoremap <leader>vd :call Lspsaga peek_definition<CR> nnoremap <leader>vd :Lspsaga peek_definition<CR>
" nnoremap <leader>vrn :call Lspsaga rename<CR><CR> nnoremap <leader>vrn :Lspsaga rename<CR><CR>
" nnoremap <leader>vh :call Lspsaga hover_doc<CR> nnoremap <leader>vh :Lspsaga hover_doc<CR>
" nnoremap <leader>vca :call Lspsaga code_action<CR> nnoremap <leader>vca :Lspsaga code_action<CR>
" nnoremap <leader>vsd :call Lspsaga show_line_diagnostics<CR> nnoremap <leader>vsd :Lspsaga show_line_diagnostics<CR>
" nnoremap <leader>vn :call Lspsaga diagnostic_jump_prev<CR> nnoremap <leader>vs :Dasht<Space>
nnoremap <leader>vn :Lspsaga diagnostic_jump_prev<CR>
nnoremap <leader>vo :LSoutlineToggle<CR>
" dashboard " dashboard
let g:dashboard_custom_header = [ let g:dashboard_custom_header = [
@ -582,18 +585,37 @@ in
local navic = require("nvim-navic") local navic = require("nvim-navic")
-- lspsaga, code_action lightbulb is annoying -- lspsaga, code_action lightbulb is annoying
-- local saga = require('lspsaga') local saga = require('lspsaga')
-- saga.init_lsp_saga({ saga.init_lsp_saga({
-- code_action_lightbulb = { border_style = "rounded",
-- enable = true, code_action_icon = "",
-- enable_in_insert = true, code_action_num_shortcut = true,
-- cache_code_action = true, code_action_lightbulb = {
-- sign = true, enable = false,
-- update_time = 150, enable_in_insert = false,
-- sign_priority = 4, cache_code_action = true,
-- virtual_text = false, 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() local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities) capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities)
@ -806,6 +828,11 @@ in
} }
require('twilight').setup{} require('twilight').setup{}
-- hologram
require('hologram').setup{
auto_display = true -- WIP automatic markdown image display, may be prone to breaking
}
EOF EOF
''; '';
@ -855,7 +882,8 @@ in
nvim-peekup nvim-peekup
zen-mode-nvim zen-mode-nvim
twilight-nvim twilight-nvim
lspsaga-nvim my-lspsaga
vim-dasht
# language # language
vim-nix vim-nix
@ -870,6 +898,7 @@ in
vimwiki vimwiki
taskwiki taskwiki
vim-zettel vim-zettel
hologram-nvim
# lsp stuff # lsp stuff
# nvim-lint # nvim-lint