All Projects → glepnir → Lspsaga.nvim

glepnir / Lspsaga.nvim

Licence: mit
neovim lsp plugin

Programming Languages

lua
6591 projects

Labels

Projects that are alternatives of or similar to Lspsaga.nvim

Nvim Lspconfig
Quickstart configurations for the Nvim LSP client
Stars: ✭ 3,410 (+799.74%)
Mutual labels:  lsp, neovim
Nvim Lsputils
Better defaults for nvim-lsp actions
Stars: ✭ 142 (-62.53%)
Mutual labels:  lsp, neovim
Coc Angular
Angular Language Service coc extension for (neo)vim
Stars: ✭ 95 (-74.93%)
Mutual labels:  lsp, neovim
Thinkvim
Vim configuration in the 21st century
Stars: ✭ 832 (+119.53%)
Mutual labels:  lsp, neovim
null-ls.nvim
Use Neovim as a language server to inject LSP diagnostics, code actions, and more via Lua.
Stars: ✭ 965 (+154.62%)
Mutual labels:  neovim, lsp
Diagnostic Languageserver
diagnostic language server integrate with linters
Stars: ✭ 186 (-50.92%)
Mutual labels:  lsp, neovim
Coc Metals
coc.nvim extension for Metals, the Scala language server
Stars: ✭ 124 (-67.28%)
Mutual labels:  lsp, neovim
Coc Flutter
flutter support for (Neo)vim
Stars: ✭ 259 (-31.66%)
Mutual labels:  lsp, neovim
lsp-fastaction.nvim
lsp codeaction UI for neovim
Stars: ✭ 39 (-89.71%)
Mutual labels:  neovim, lsp
Lsp Status.nvim
Utility functions for getting diagnostic status and progress messages from LSP servers, for use in the Neovim statusline
Stars: ✭ 201 (-46.97%)
Mutual labels:  lsp, neovim
vimrc
My neovim config
Stars: ✭ 43 (-88.65%)
Mutual labels:  neovim, lsp
Vim Language Server
VImScript language server, LSP for vim script
Stars: ✭ 264 (-30.34%)
Mutual labels:  lsp, neovim
Rigel
🌌 Colorscheme for vim, terminal, vscode and slack - based on the star Rigel ✨.
Stars: ✭ 324 (-14.51%)
Mutual labels:  neovim
Mydotfiles
All my dot configuration files.
Stars: ✭ 359 (-5.28%)
Mutual labels:  neovim
Vim Dadbod Ui
Simple UI for https://github.com/tpope/vim-dadbod
Stars: ✭ 315 (-16.89%)
Mutual labels:  neovim
Vim
An ambitious theme for vim
Stars: ✭ 313 (-17.41%)
Mutual labels:  neovim
Dotfiles
Configuration for Linux, Nix, i3, Kitty, Fish, Neovim and more
Stars: ✭ 379 (+0%)
Mutual labels:  neovim
Awesome Neovim
Collections of awesome neovim plugins.
Stars: ✭ 336 (-11.35%)
Mutual labels:  neovim
Tailwindcss Classnames
TypeScript support for TailwindCSS
Stars: ✭ 305 (-19.53%)
Mutual labels:  neovim
Vimpyter
Edit your Jupyter notebooks in Vim/Neovim
Stars: ✭ 308 (-18.73%)
Mutual labels:  neovim

lspsaga.nvim

A light-weight lsp plugin based on neovim built-in lsp with highly a performant UI.

Install

  • vim-plug
Plug 'neovim/nvim-lspconfig'
Plug 'glepnir/lspsaga.nvim'

Usage

Lspsaga support use command Lspsaga with completion or use lua function

local saga = require 'lspsaga'

-- add your config value here
-- default value
-- use_saga_diagnostic_sign = true
-- error_sign = '',
-- warn_sign = '',
-- hint_sign = '',
-- infor_sign = '',
-- dianostic_header_icon = '   ',
-- code_action_icon = ' ',
-- code_action_prompt = {
--   enable = true,
--   sign = true,
--   sign_priority = 20,
--   virtual_text = true,
-- },
-- finder_definition_icon = '  ',
-- finder_reference_icon = '  ',
-- max_preview_lines = 10, -- preview lines of lsp_finder and definition preview
-- finder_action_keys = {
--   open = 'o', vsplit = 's',split = 'i',quit = 'q',scroll_down = '<C-f>', scroll_up = '<C-b>' -- quit can be a table
-- },
-- code_action_keys = {
--   quit = 'q',exec = '<CR>'
-- },
-- rename_action_keys = {
--   quit = '<C-c>',exec = '<CR>'  -- quit can be a table
-- },
-- definition_preview_icon = '  '
-- 1: thin border | 2: rounded border | 3: thick border | 4: ascii border
-- border_style = 1
-- rename_prompt_prefix = '➤',
-- if you don't use nvim-lspconfig you must pass your server name and
-- the related filetypes into this table
-- like server_filetype_map = {metals = {'sbt', 'scala'}}
-- server_filetype_map = {}

saga.init_lsp_saga {
  your custom option here
}

or --use default config
saga.init_lsp_saga()

Async Lsp Finder

-- lsp provider to find the cursor word definition and reference
nnoremap <silent> gh <cmd>lua require'lspsaga.provider'.lsp_finder()<CR>
-- or use command LspSagaFinder
nnoremap <silent> gh :Lspsaga lsp_finder<CR>

Code Action

-- code action
nnoremap <silent><leader>ca <cmd>lua require('lspsaga.codeaction').code_action()<CR>
vnoremap <silent><leader>ca :<C-U>lua require('lspsaga.codeaction').range_code_action()<CR>
-- or use command
nnoremap <silent><leader>ca :Lspsaga code_action<CR>
vnoremap <silent><leader>ca :<C-U>Lspsaga range_code_action<CR>
  • code action auto prompt

Hover Doc

-- show hover doc
nnoremap <silent> K <cmd>lua require('lspsaga.hover').render_hover_doc()<CR>
-- or use command
nnoremap <silent>K :Lspsaga hover_doc<CR>

-- scroll down hover doc or scroll in definition preview
nnoremap <silent> <C-f> <cmd>lua require('lspsaga.action').smart_scroll_with_saga(1)<CR>
-- scroll up hover doc
nnoremap <silent> <C-b> <cmd>lua require('lspsaga.action').smart_scroll_with_saga(-1)<CR>

SignatureHelp

-- show signature help
nnoremap <silent> gs <cmd>lua require('lspsaga.signaturehelp').signature_help()<CR>
-- or command
nnoremap <silent> gs :Lspsaga signature_help<CR>

and you also can use smart_scroll_with_saga to scroll in signature help win

Rename

-- rename
nnoremap <silent>gr <cmd>lua require('lspsaga.rename').rename()<CR>
-- or command
nnoremap <silent>gr :Lspsaga rename<CR>
-- close rename win use <C-c> in insert mode or `q` in noremal mode or `:q`

Preview Definition

-- preview definition
nnoremap <silent> gd <cmd>lua require'lspsaga.provider'.preview_definition()<CR>
-- or use command
nnoremap <silent> gd :Lspsaga preview_definition<CR>

can use smart_scroll_with_saga to scroll

Jump Diagnostic and Show Diagnostics

-- show
nnoremap <silent><leader>cd <cmd>lua
require'lspsaga.diagnostic'.show_line_diagnostics()<CR>

nnoremap <silent> <leader>cd :Lspsaga show_line_diagnostics<CR>
-- jump diagnostic
nnoremap <silent> [e <cmd>lua require'lspsaga.diagnostic'.lsp_jump_diagnostic_prev()<CR>
nnoremap <silent> ]e <cmd>lua require'lspsaga.diagnostic'.lsp_jump_diagnostic_next()<CR>
-- or use command
nnoremap <silent> [e :Lspsaga diagnostic_jump_next<CR>
nnoremap <silent> ]e :Lspsaga diagnostic_jump_prev<CR>

Float Terminal

-- float terminal also you can pass the cli command in open_float_terminal function
nnoremap <silent> <A-d> <cmd>lua require('lspsaga.floaterm').open_float_terminal()<CR> -- or open_float_terminal('lazygit')<CR>
tnoremap <silent> <A-d> <C-\><C-n>:lua require('lspsaga.floaterm').close_float_terminal()<CR>
-- or use command
nnoremap <silent> <A-d> :Lspsaga open_floaterm<CR>
tnoremap <silent> <A-d> <C-\><C-n>:Lspsaga close_floaterm<CR>

Customize Appearance

Colors

Colors can be simply changed by overwriting the default highlights groups LspSaga is using.

highlight link LspSagaFinderSelection Search
" or
highlight link LspSagaFinderSelection guifg='#ff0000' guibg='#00ff00' gui='bold'

The available highlight groups are:

Group Name Description
LspSagaFinderSelection Currently active entry in the finder window that gets previewed.
LspFloatWinBorder
LspSagaBorderTitle
TargetWord
ReferencesCount
DefinitionCount
TargetFileName
DefinitionIcon
ReferencesIcon
ProviderTruncateLine
SagaShadow
LspSagaFinderSelection
DiagnosticTruncateLine
DiagnosticError
DiagnosticWarning
DiagnosticInformation
DiagnosticHint
DefinitionPreviewTitle
LspSagaShTruncateLine
LspSagaDocTruncateLine
LineDiagTuncateLine
LspSagaCodeActionTitle
LspSagaCodeActionTruncateLine
LspSagaCodeActionContent
LspSagaRenamePromptPrefix
LspSagaRenameBorder
LspSagaHoverBorder
LspSagaSignatureHelpBorder
LspSagaCodeActionBorder
LspSagaAutoPreview
LspSagaDefPreviewBorder
LspLinesDiagBorder

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].