mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-01-23 17:40:06 +08:00
feat(lang#nix): Add additional LSP command bindings
This commit is contained in:
parent
29c10f0b3b
commit
0fdf5c8c07
@ -10,8 +10,8 @@
|
|||||||
" @section lang#nix, layers-lang-nix
|
" @section lang#nix, layers-lang-nix
|
||||||
" @parentsection layers
|
" @parentsection layers
|
||||||
" @subsection Intro
|
" @subsection Intro
|
||||||
" The lang#nix layer provides syntax highlighting for the Nix
|
" The lang#nix layer provides syntax highlighting and basic LSP support for
|
||||||
" expression language.
|
" the Nix expression language.
|
||||||
|
|
||||||
function! SpaceVim#layers#lang#nix#plugins() abort
|
function! SpaceVim#layers#lang#nix#plugins() abort
|
||||||
let plugins = []
|
let plugins = []
|
||||||
@ -20,11 +20,27 @@ function! SpaceVim#layers#lang#nix#plugins() abort
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! SpaceVim#layers#lang#nix#config() abort
|
function! SpaceVim#layers#lang#nix#config() abort
|
||||||
|
call SpaceVim#mapping#space#regesit_lang_mappings('nix', function('s:language_specified_mappings'))
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! s:language_specified_mappings() abort
|
||||||
|
if SpaceVim#layers#lsp#check_filetype('nix')
|
||||||
|
call SpaceVim#mapping#space#langSPC('nnoremap', ['l', 'r'],
|
||||||
|
\ 'call SpaceVim#lsp#rename()', 'rename', 1)
|
||||||
|
call SpaceVim#mapping#space#langSPC('nnoremap', ['l', 's'],
|
||||||
|
\ 'call SpaceVim#lsp#show_line_diagnostics()', 'show-line-diagnostics', 1)
|
||||||
|
call SpaceVim#mapping#space#langSPC('nnoremap', ['l', 'd'],
|
||||||
|
\ 'call SpaceVim#lsp#go_to_def()', 'go-to-definition', 1)
|
||||||
|
call SpaceVim#mapping#space#langSPC('nnoremap', ['l', 'n'],
|
||||||
|
\ 'call SpaceVim#lsp#diagnostic_goto_next()', 'next-diagnostic', 1)
|
||||||
|
call SpaceVim#mapping#space#langSPC('nnoremap', ['l', 'p'],
|
||||||
|
\ 'call SpaceVim#lsp#diagnostic_goto_prev()', 'previous-diagnostic', 1)
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
function! SpaceVim#layers#lang#nix#health() abort
|
function! SpaceVim#layers#lang#nix#health() abort
|
||||||
call SpaceVim#layers#lang#nix#plugins()
|
call SpaceVim#layers#lang#nix#plugins()
|
||||||
call SpaceVim#layers#lang#nix#config()
|
call SpaceVim#layers#lang#nix#config()
|
||||||
return 1
|
return 1
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
@ -10,7 +10,6 @@ description: "This layer adds Nix language support to SpaceVim."
|
|||||||
- [Description](#description)
|
- [Description](#description)
|
||||||
- [Features](#features)
|
- [Features](#features)
|
||||||
- [Install](#install)
|
- [Install](#install)
|
||||||
- [Key bindings](#key-bindings)
|
|
||||||
|
|
||||||
<!-- vim-markdown-toc -->
|
<!-- vim-markdown-toc -->
|
||||||
|
|
||||||
@ -21,6 +20,9 @@ This layer adds [Nix](https://nixos.org/nix/manual/) language support to SpaceVi
|
|||||||
## Features
|
## Features
|
||||||
|
|
||||||
- syntax highlighting
|
- syntax highlighting
|
||||||
|
- symbol renaming (LSP)
|
||||||
|
- go to definition (LSP)
|
||||||
|
- syntax checking (LSP)
|
||||||
|
|
||||||
## Install
|
## Install
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user