feat(prog/nvim): add nix lang
This commit is contained in:
parent
1b30d62546
commit
194141778e
1 changed files with 36 additions and 35 deletions
|
@ -39,8 +39,8 @@ aug END
|
||||||
call plug#begin()
|
call plug#begin()
|
||||||
Plug 'junegunn/seoul256.vim' " theme
|
Plug 'junegunn/seoul256.vim' " theme
|
||||||
Plug 'Yggdroot/indentLine' " tab and space indentation
|
Plug 'Yggdroot/indentLine' " tab and space indentation
|
||||||
Plug 'mg979/vim-visual-multi', {'branch': 'master'} " multi cursors
|
Plug 'mg979/vim-visual-multi', {'branch': 'master'} " multi cursors
|
||||||
Plug 'preservim/nerdtree' " file tree
|
Plug 'preservim/nerdtree' " file tree
|
||||||
Plug 'Xuyuanp/nerdtree-git-plugin'
|
Plug 'Xuyuanp/nerdtree-git-plugin'
|
||||||
|
|
||||||
Plug 'prabirshrestha/vim-lsp' " lsp for many langs
|
Plug 'prabirshrestha/vim-lsp' " lsp for many langs
|
||||||
|
@ -48,17 +48,18 @@ call plug#begin()
|
||||||
Plug 'prabirshrestha/asyncomplete-lsp.vim'
|
Plug 'prabirshrestha/asyncomplete-lsp.vim'
|
||||||
Plug 'mattn/vim-lsp-settings' " settings for lsp plugin
|
Plug 'mattn/vim-lsp-settings' " settings for lsp plugin
|
||||||
|
|
||||||
Plug 'sbdchd/neoformat' " format langs via official tools
|
Plug 'sbdchd/neoformat' " format langs via official tools
|
||||||
Plug 'easymotion/vim-easymotion' " fast navigation
|
Plug 'easymotion/vim-easymotion' " fast navigation
|
||||||
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } " fuzzy find files
|
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } " fuzzy find files
|
||||||
Plug 'junegunn/fzf.vim' " fzf integration
|
Plug 'junegunn/fzf.vim' " fzf integration
|
||||||
Plug 'dyng/ctrlsf.vim' " async searching
|
Plug 'dyng/ctrlsf.vim' " async searching
|
||||||
Plug 'christoomey/vim-tmux-navigator' " navigation inside tmux
|
Plug 'christoomey/vim-tmux-navigator' " navigation inside tmux
|
||||||
Plug 'editorconfig/editorconfig-vim' " editorconfig
|
Plug 'editorconfig/editorconfig-vim' " editorconfig
|
||||||
Plug 'cespare/vim-toml', { 'branch': 'main' } " toml lang
|
Plug 'cespare/vim-toml', { 'branch': 'main' } " toml lang
|
||||||
Plug 'rust-lang/rust.vim' " rust lang
|
Plug 'rust-lang/rust.vim' " rust lang
|
||||||
Plug 'jparise/vim-graphql' " graphql lang with gql tag
|
Plug 'jparise/vim-graphql' " graphql lang with gql tag
|
||||||
Plug 'lifepillar/pgsql.vim' " postgresql lang support
|
Plug 'lifepillar/pgsql.vim' " postgresql lang support
|
||||||
|
Plug 'LnL7/vim-nix' " nix lang
|
||||||
call plug#end()
|
call plug#end()
|
||||||
" }}}
|
" }}}
|
||||||
|
|
||||||
|
@ -70,7 +71,7 @@ let g:neoformat_try_node_exe = 1
|
||||||
aug fmt
|
aug fmt
|
||||||
au!
|
au!
|
||||||
au FileType javascript,javascriptreact,typescript,typescriptreact,rust
|
au FileType javascript,javascriptreact,typescript,typescriptreact,rust
|
||||||
\ au BufWritePre <buffer> undojoin | Neoformat
|
\ au BufWritePre <buffer> undojoin | Neoformat
|
||||||
aug END
|
aug END
|
||||||
" }}}
|
" }}}
|
||||||
|
|
||||||
|
@ -86,16 +87,16 @@ nnoremap <C-t> :NERDTreeToggle<CR>
|
||||||
" Plugin: NerdTreeGit {{{
|
" Plugin: NerdTreeGit {{{
|
||||||
let g:NERDTreeGitStatusShowIgnored = 1
|
let g:NERDTreeGitStatusShowIgnored = 1
|
||||||
let g:NERDTreeGitStatusIndicatorMapCustom = {
|
let g:NERDTreeGitStatusIndicatorMapCustom = {
|
||||||
\ "Modified" : "ᵐ",
|
\ "Modified" : "ᵐ",
|
||||||
\ "Staged" : "ˢ",
|
\ "Staged" : "ˢ",
|
||||||
\ "Untracked" : "ᵘ",
|
\ "Untracked" : "ᵘ",
|
||||||
\ "Renamed" : "ʳ",
|
\ "Renamed" : "ʳ",
|
||||||
\ "Unmerged" : "ᶴ",
|
\ "Unmerged" : "ᶴ",
|
||||||
\ "Deleted" : "ˣ",
|
\ "Deleted" : "ˣ",
|
||||||
\ "Dirty" : "˜",
|
\ "Dirty" : "˜",
|
||||||
\ "Clean" : "ᵅ",
|
\ "Clean" : "ᵅ",
|
||||||
\ "Unknown" : "?"
|
\ "Unknown" : "?"
|
||||||
\ }
|
\ }
|
||||||
" }}}
|
" }}}
|
||||||
|
|
||||||
" Plugin: LSP {{{
|
" Plugin: LSP {{{
|
||||||
|
@ -103,27 +104,27 @@ let g:lsp_preview_max_width = 60
|
||||||
let g:lsp_diagnostics_float_cursor = 1
|
let g:lsp_diagnostics_float_cursor = 1
|
||||||
|
|
||||||
function! s:on_lsp_buffer_enabled() abort
|
function! s:on_lsp_buffer_enabled() abort
|
||||||
setlocal omnifunc=lsp#complete
|
setlocal omnifunc=lsp#complete
|
||||||
if exists('+tagfunc') | setlocal tagfunc=lsp#tagfunc | endif
|
if exists('+tagfunc') | setlocal tagfunc=lsp#tagfunc | endif
|
||||||
nmap <buffer> gd <plug>(lsp-definition)
|
nmap <buffer> gd <plug>(lsp-definition)
|
||||||
nmap <buffer> gs <plug>(lsp-document-symbol-search)
|
nmap <buffer> gs <plug>(lsp-document-symbol-search)
|
||||||
nmap <buffer> gS <plug>(lsp-workspace-symbol-search)
|
nmap <buffer> gS <plug>(lsp-workspace-symbol-search)
|
||||||
nmap <buffer> gr <plug>(lsp-references)
|
nmap <buffer> gr <plug>(lsp-references)
|
||||||
nmap <buffer> gi <plug>(lsp-implementation)
|
nmap <buffer> gi <plug>(lsp-implementation)
|
||||||
nmap <buffer> gt <plug>(lsp-type-definition)
|
nmap <buffer> gt <plug>(lsp-type-definition)
|
||||||
nmap <buffer> <leader>rn <plug>(lsp-rename)
|
nmap <buffer> <leader>rn <plug>(lsp-rename)
|
||||||
nmap <buffer> [g <plug>(lsp-previous-diagnostic)
|
nmap <buffer> [g <plug>(lsp-previous-diagnostic)
|
||||||
nmap <buffer> ]g <plug>(lsp-next-diagnostic)
|
nmap <buffer> ]g <plug>(lsp-next-diagnostic)
|
||||||
nmap <buffer> K <plug>(lsp-hover)
|
nmap <buffer> K <plug>(lsp-hover)
|
||||||
nnoremap <buffer> <expr><c-f> lsp#scroll(+4)
|
nnoremap <buffer> <expr><c-f> lsp#scroll(+4)
|
||||||
nnoremap <buffer> <expr><c-d> lsp#scroll(-4)
|
nnoremap <buffer> <expr><c-d> lsp#scroll(-4)
|
||||||
" refer to doc to add more commands
|
" refer to doc to add more commands
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
aug lsp_install
|
aug lsp_install
|
||||||
au!
|
au!
|
||||||
" call s:on_lsp_buffer_enabled only for languages that has the server registered.
|
" call s:on_lsp_buffer_enabled only for languages that has the server registered.
|
||||||
au User lsp_buffer_enabled call s:on_lsp_buffer_enabled()
|
au User lsp_buffer_enabled call s:on_lsp_buffer_enabled()
|
||||||
aug END
|
aug END
|
||||||
" }}}
|
" }}}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue