feat: nvim with lsp
This commit is contained in:
parent
7b690a7714
commit
380be27b0a
19 changed files with 627 additions and 569 deletions
18
flake.lock
generated
18
flake.lock
generated
|
|
@ -344,19 +344,19 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nnn-vim": {
|
"nnn-nvim": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1661779055,
|
"lastModified": 1681744148,
|
||||||
"narHash": "sha256-OLghcQP0vQ0ZceFja1SbFqkevjREzNPCMBGRVnVbt/s=",
|
"narHash": "sha256-Kods3PyV1iN+/owXuJxztWpAqAUW76ct96ALTQj3i98=",
|
||||||
"owner": "mcchrish",
|
"owner": "luukvbaal",
|
||||||
"repo": "nnn.vim",
|
"repo": "nnn.nvim",
|
||||||
"rev": "46bb8355a3bbe7df9f466bb116534dda4f257895",
|
"rev": "a2394f3a7a963587a38fb7349d939b12c1c7a757",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "mcchrish",
|
"owner": "luukvbaal",
|
||||||
"repo": "nnn.vim",
|
"repo": "nnn.nvim",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -492,7 +492,7 @@
|
||||||
"nixpkgs": "nixpkgs_2",
|
"nixpkgs": "nixpkgs_2",
|
||||||
"nixpkgs-darwin": "nixpkgs-darwin",
|
"nixpkgs-darwin": "nixpkgs-darwin",
|
||||||
"nixpkgs-master": "nixpkgs-master",
|
"nixpkgs-master": "nixpkgs-master",
|
||||||
"nnn-vim": "nnn-vim",
|
"nnn-nvim": "nnn-nvim",
|
||||||
"noice-nvim": "noice-nvim",
|
"noice-nvim": "noice-nvim",
|
||||||
"notify-nvim": "notify-nvim",
|
"notify-nvim": "notify-nvim",
|
||||||
"octoprint-spoolmanager": "octoprint-spoolmanager",
|
"octoprint-spoolmanager": "octoprint-spoolmanager",
|
||||||
|
|
|
||||||
|
|
@ -30,8 +30,8 @@
|
||||||
rnix-lsp.inputs.nixpkgs.follows = "nixpkgs";
|
rnix-lsp.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
|
||||||
## vim
|
## vim
|
||||||
nnn-vim.url = "github:mcchrish/nnn.vim";
|
nnn-nvim.url = "github:luukvbaal/nnn.nvim";
|
||||||
nnn-vim.flake = false;
|
nnn-nvim.flake = false;
|
||||||
notify-nvim.url = "github:rcarriga/nvim-notify";
|
notify-nvim.url = "github:rcarriga/nvim-notify";
|
||||||
notify-nvim.flake = false;
|
notify-nvim.flake = false;
|
||||||
noice-nvim.url = "github:folke/noice.nvim";
|
noice-nvim.url = "github:folke/noice.nvim";
|
||||||
|
|
|
||||||
|
|
@ -1,41 +0,0 @@
|
||||||
{
|
|
||||||
"rust-analyzer.procMacro.enable": true,
|
|
||||||
"cSpellExt.enableDictionaries": ["german"],
|
|
||||||
"cSpell.language": "en,de",
|
|
||||||
"rust-analyzer.updates.channel": "nightly",
|
|
||||||
"texlab.build.executable": "tectonic",
|
|
||||||
"texlab.build.args": [
|
|
||||||
"%f",
|
|
||||||
"--keep-logs",
|
|
||||||
"--synctex",
|
|
||||||
],
|
|
||||||
"texlab.build.onSave": true,
|
|
||||||
"texlab.chktex.onOpenAndSave": true,
|
|
||||||
"texlab.build.forwardSearchAfter": false,
|
|
||||||
"texlab.forwardSearch.executable": "/Applications/Skim.app/Contents/SharedSupport/displayline",
|
|
||||||
"texlab.forwardSearch.args": ["-r", "-d", "%l","%p","%f"],
|
|
||||||
"html.validate.scripts": true,
|
|
||||||
"languageserver": {
|
|
||||||
"nix": {
|
|
||||||
"command": "nil",
|
|
||||||
"filetypes": ["nix"],
|
|
||||||
"settings": {
|
|
||||||
"nil": {
|
|
||||||
"formatting": { "command": ["nixpkgs-fmt"] }
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"rootPatterns": ["flake.nix"]
|
|
||||||
},
|
|
||||||
"csharp-ls": {
|
|
||||||
"command": "csharp-ls",
|
|
||||||
"filetypes": ["cs", "razor"]
|
|
||||||
},
|
|
||||||
"terraform": {
|
|
||||||
"command": "terraform-ls",
|
|
||||||
"args": ["serve"],
|
|
||||||
"filetypes": ["terraform", "tf"],
|
|
||||||
"initializationOptions": {},
|
|
||||||
"settings": {}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,145 +0,0 @@
|
||||||
" if system('id -u') > 500
|
|
||||||
" let g:coc_global_extensions = [ 'coc-markdownlint', 'coc-diagnostic', 'coc-angular', 'coc-css', 'coc-docker', 'coc-flutter-tools', 'coc-git', 'coc-homeassistant', 'coc-html', 'coc-json', 'coc-marketplace', 'coc-prettier', 'coc-pyright', 'coc-rls', 'coc-rust-analyzer', 'coc-scssmodules', 'coc-sh', 'coc-snippets', 'coc-stylelintplus', 'coc-swagger', 'coc-tabnine', 'coc-eslint', 'coc-tsserver', 'coc-webpack', 'coc-yaml' ]
|
|
||||||
" endif
|
|
||||||
" \coc Some servers have issues with backup files, see #649.
|
|
||||||
set nobackup
|
|
||||||
set nowritebackup
|
|
||||||
" \coc Don't pass messages to |ins-completion-menu|.
|
|
||||||
set shortmess+=c
|
|
||||||
" \coc Always show the signcolumn, otherwise it would shift the text each time
|
|
||||||
" diagnostics appear/become resolved.
|
|
||||||
set signcolumn=number
|
|
||||||
function! s:check_back_space() abort
|
|
||||||
let col = col('.') - 1
|
|
||||||
return !col || getline('.')[col - 1] =~# '\s'
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
" c-space to trigger completion
|
|
||||||
inoremap <silent><expr> <c-space> coc#refresh()
|
|
||||||
" Make <CR> auto-select the first completion item and notify coc.nvim to
|
|
||||||
" format on enter, <cr> could be remapped by other vim plugin
|
|
||||||
inoremap <silent><expr> <cr> pumvisible() ? coc#_select_confirm()
|
|
||||||
\: "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>"
|
|
||||||
|
|
||||||
" Use `[g` and `]g` to navigate diagnostics
|
|
||||||
" Use `:CocDiagnostics` to get all diagnostics of current buffer in location list.
|
|
||||||
nmap <silent> [g <Plug>(coc-diagnostic-prev)
|
|
||||||
nmap <silent> ]g <Plug>(coc-diagnostic-next)
|
|
||||||
|
|
||||||
inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
|
|
||||||
inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>"
|
|
||||||
|
|
||||||
" GoTo code navigation.
|
|
||||||
nmap <silent> gd <Plug>(coc-definition)
|
|
||||||
nmap <silent> gy <Plug>(coc-type-definition)
|
|
||||||
nmap <silent> gi <Plug>(coc-implementation)
|
|
||||||
nmap <silent> gr <Plug>(coc-references)
|
|
||||||
" Use K to show documentation in preview window.
|
|
||||||
nnoremap <silent> K :call <SID>show_documentation()<CR>
|
|
||||||
function! s:show_documentation()
|
|
||||||
if (index(['vim','help'], &filetype) >= 0)
|
|
||||||
execute 'h '.expand('<cword>')
|
|
||||||
elseif (coc#rpc#ready())
|
|
||||||
call CocActionAsync('doHover')
|
|
||||||
else
|
|
||||||
execute '!' . &keywordprg . " " . expand('<cword>')
|
|
||||||
endif
|
|
||||||
endfunction
|
|
||||||
" Highlight the symbol and its references when holding the cursor.
|
|
||||||
autocmd CursorHold * silent call CocActionAsync('highlight')
|
|
||||||
" Symbol renaming.
|
|
||||||
nmap <leader>rn <Plug>(coc-rename)
|
|
||||||
|
|
||||||
" coc snippets
|
|
||||||
" Use <C-l> for trigger snippet expand.
|
|
||||||
imap <C-l> <Plug>(coc-snippets-expand)
|
|
||||||
|
|
||||||
" Use <C-j> for select text for visual placeholder of snippet.
|
|
||||||
vmap <C-j> <Plug>(coc-snippets-select)
|
|
||||||
|
|
||||||
" Use <C-j> for jump to next placeholder, it's default of coc.nvim
|
|
||||||
let g:coc_snippet_next = '<c-j>'
|
|
||||||
|
|
||||||
" Use <C-k> for jump to previous placeholder, it's default of coc.nvim
|
|
||||||
let g:coc_snippet_prev = '<c-k>'
|
|
||||||
|
|
||||||
" Use <C-j> for both expand and jump (make expand higher priority.)
|
|
||||||
imap <C-j> <Plug>(coc-snippets-expand-jump)
|
|
||||||
|
|
||||||
" Use <leader>x for convert visual selected code to snippet
|
|
||||||
xmap <leader>x <Plug>(coc-convert-snippet)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
" Formatting selected code.
|
|
||||||
xmap <leader>f <Plug>(coc-format-selected)
|
|
||||||
nmap <leader>f <Plug>(coc-format-selected)
|
|
||||||
augroup mygroup
|
|
||||||
autocmd!
|
|
||||||
" Setup formatexpr specified filetype(s).
|
|
||||||
autocmd FileType typescript,json setl formatexpr=CocAction('formatSelected')
|
|
||||||
" Update signature help on jump placeholder.
|
|
||||||
autocmd User CocJumpPlaceholder call CocActionAsync('showSignatureHelp')
|
|
||||||
augroup end
|
|
||||||
|
|
||||||
" Applying codeAction to the selected region.
|
|
||||||
" Example: `<leader>aap` for current paragraph
|
|
||||||
xmap <leader>a <Plug>(coc-codeaction-selected)
|
|
||||||
nmap <leader>a <Plug>(coc-codeaction-selected)
|
|
||||||
|
|
||||||
" Remap keys for applying codeAction to the current buffer.
|
|
||||||
nmap <leader>ac <Plug>(coc-codeaction)
|
|
||||||
" Apply AutoFix to problem on the current line.
|
|
||||||
nmap <leader>qf <Plug>(coc-fix-current)
|
|
||||||
nmap <leader>f :CocFix<CR>
|
|
||||||
|
|
||||||
" Map function and class text objects
|
|
||||||
" NOTE: Requires 'textDocument.documentSymbol' support from the language server.
|
|
||||||
xmap if <Plug>(coc-funcobj-i)
|
|
||||||
omap if <Plug>(coc-funcobj-i)
|
|
||||||
xmap af <Plug>(coc-funcobj-a)
|
|
||||||
omap af <Plug>(coc-funcobj-a)
|
|
||||||
xmap ic <Plug>(coc-classobj-i)
|
|
||||||
omap ic <Plug>(coc-classobj-i)
|
|
||||||
xmap ac <Plug>(coc-classobj-a)
|
|
||||||
omap ac <Plug>(coc-classobj-a)
|
|
||||||
|
|
||||||
" Remap <C-f> and <C-b> for scroll float windows/popups.
|
|
||||||
nnoremap <silent><nowait><expr> <C-f> coc#float#has_scroll() ? coc#float#scroll(1) : "\<C-f>"
|
|
||||||
nnoremap <silent><nowait><expr> <C-b> coc#float#has_scroll() ? coc#float#scroll(0) : "\<C-b>"
|
|
||||||
inoremap <silent><nowait><expr> <C-f> coc#float#has_scroll() ? "\<c-r>=coc#float#scroll(1)\<cr>" : "\<Right>"
|
|
||||||
inoremap <silent><nowait><expr> <C-b> coc#float#has_scroll() ? "\<c-r>=coc#float#scroll(0)\<cr>" : "\<Left>"
|
|
||||||
vnoremap <silent><nowait><expr> <C-f> coc#float#has_scroll() ? coc#float#scroll(1) : "\<C-f>"
|
|
||||||
vnoremap <silent><nowait><expr> <C-b> coc#float#has_scroll() ? coc#float#scroll(0) : "\<C-b>"
|
|
||||||
|
|
||||||
" Use CTRL-S for selections ranges.
|
|
||||||
" Requires 'textDocument/selectionRange' support of language server.
|
|
||||||
nmap <silent> <C-a> <Plug>(coc-range-select)
|
|
||||||
xmap <silent> <C-a> <Plug>(coc-range-select)
|
|
||||||
|
|
||||||
" Add `:Format` command to format current buffer.
|
|
||||||
command! -nargs=0 Format :call CocAction('format')
|
|
||||||
|
|
||||||
" Add `:Fold` command to fold current buffer.
|
|
||||||
command! -nargs=? Fold :call CocAction('fold', <f-args>)
|
|
||||||
|
|
||||||
" Add `:OR` command for organize imports of the current buffer.
|
|
||||||
command! -nargs=0 OR :call CocAction('runCommand', 'editor.action.organizeImport')
|
|
||||||
|
|
||||||
" Mappings for CoCList
|
|
||||||
" Show all diagnostics.
|
|
||||||
nnoremap <silent><nowait> <space>a :<C-u>CocList diagnostics<cr>
|
|
||||||
" Manage extensions.
|
|
||||||
nnoremap <silent><nowait> <space>e :<C-u>CocList extensions<cr>
|
|
||||||
" Show commands.
|
|
||||||
nnoremap <silent><nowait> <space>c :<C-u>CocList commands<cr>
|
|
||||||
" Find symbol of current document.
|
|
||||||
nnoremap <silent><nowait> <space>o :<C-u>CocList outline<cr>
|
|
||||||
" Search workspace symbols.
|
|
||||||
nnoremap <silent><nowait> <space>s :<C-u>CocList -I symbols<cr>
|
|
||||||
" Do default action for next item.
|
|
||||||
nnoremap <silent><nowait> <space>j :<C-u>CocNext<CR>
|
|
||||||
" Do default action for previous item.
|
|
||||||
nnoremap <silent><nowait> <space>k :<C-u>CocPrev<CR>
|
|
||||||
" Resume latest coc list.
|
|
||||||
nnoremap <silent><nowait> <space>p :<C-u>CocListResume<CR>
|
|
||||||
137
hm-imports/nvim/config/lua/.luarc.json
Normal file
137
hm-imports/nvim/config/lua/.luarc.json
Normal file
|
|
@ -0,0 +1,137 @@
|
||||||
|
{
|
||||||
|
"$schema": "https://raw.githubusercontent.com/sumneko/vscode-lua/master/setting/schema.json",
|
||||||
|
"Lua.workspace.checkThirdParty": false,
|
||||||
|
"Lua.workspace.library": [
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/cmp-buffer",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/cmp-cmdline",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/cmp-nvim-lsp",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/cmp-path",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/cmp_luasnip",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/gruvbox",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/luasnip",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/nnn-nvim",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/noice-nvim",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/notify-nvim",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/nui.nvim",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/nvim-cmp",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/nvim-lspconfig",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/nvim-treesitter",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/nvim-treesitter-bash-grammar",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/nvim-treesitter-beancount-grammar",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/nvim-treesitter-bibtex-grammar",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/nvim-treesitter-c-grammar",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/nvim-treesitter-clojure-grammar",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/nvim-treesitter-cmake-grammar",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/nvim-treesitter-comment-grammar",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/nvim-treesitter-commonlisp-grammar",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/nvim-treesitter-cpp-grammar",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/nvim-treesitter-css-grammar",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/nvim-treesitter-cuda-grammar",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/nvim-treesitter-c_sharp-grammar",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/nvim-treesitter-dart-grammar",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/nvim-treesitter-devicetree-grammar",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/nvim-treesitter-dockerfile-grammar",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/nvim-treesitter-dot-grammar",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/nvim-treesitter-eex-grammar",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/nvim-treesitter-elisp-grammar",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/nvim-treesitter-elixir-grammar",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/nvim-treesitter-elm-grammar",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/nvim-treesitter-embedded_template-grammar",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/nvim-treesitter-erlang-grammar",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/nvim-treesitter-fennel-grammar",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/nvim-treesitter-fish-grammar",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/nvim-treesitter-fortran-grammar",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/nvim-treesitter-gdscript-grammar",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/nvim-treesitter-glimmer-grammar",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/nvim-treesitter-glsl-grammar",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/nvim-treesitter-go-grammar",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/nvim-treesitter-godot_resource-grammar",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/nvim-treesitter-gomod-grammar",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/nvim-treesitter-gowork-grammar",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/nvim-treesitter-graphql-grammar",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/nvim-treesitter-haskell-grammar",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/nvim-treesitter-hcl-grammar",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/nvim-treesitter-heex-grammar",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/nvim-treesitter-hjson-grammar",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/nvim-treesitter-html-grammar",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/nvim-treesitter-http-grammar",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/nvim-treesitter-janet_simple-grammar",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/nvim-treesitter-java-grammar",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/nvim-treesitter-javascript-grammar",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/nvim-treesitter-jsdoc-grammar",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/nvim-treesitter-json-grammar",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/nvim-treesitter-json5-grammar",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/nvim-treesitter-jsonnet-grammar",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/nvim-treesitter-julia-grammar",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/nvim-treesitter-kotlin-grammar",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/nvim-treesitter-latex-grammar",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/nvim-treesitter-ledger-grammar",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/nvim-treesitter-llvm-grammar",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/nvim-treesitter-lua-grammar",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/nvim-treesitter-make-grammar",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/nvim-treesitter-markdown-grammar",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/nvim-treesitter-markdown_inline-grammar",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/nvim-treesitter-nickel-grammar",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/nvim-treesitter-nix-grammar",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/nvim-treesitter-norg-grammar",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/nvim-treesitter-ocaml-grammar",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/nvim-treesitter-ocaml_interface-grammar",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/nvim-treesitter-org-grammar",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/nvim-treesitter-perl-grammar",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/nvim-treesitter-pgn-grammar",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/nvim-treesitter-php-grammar",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/nvim-treesitter-pioasm-grammar",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/nvim-treesitter-prisma-grammar",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/nvim-treesitter-pug-grammar",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/nvim-treesitter-python-grammar",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/nvim-treesitter-ql-grammar",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/nvim-treesitter-ql_dbscheme-grammar",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/nvim-treesitter-query-grammar",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/nvim-treesitter-r-grammar",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/nvim-treesitter-regex-grammar",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/nvim-treesitter-rego-grammar",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/nvim-treesitter-rst-grammar",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/nvim-treesitter-ruby-grammar",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/nvim-treesitter-rust-grammar",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/nvim-treesitter-scala-grammar",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/nvim-treesitter-scheme-grammar",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/nvim-treesitter-scss-grammar",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/nvim-treesitter-smithy-grammar",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/nvim-treesitter-sparql-grammar",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/nvim-treesitter-sql-grammar",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/nvim-treesitter-supercollider-grammar",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/nvim-treesitter-surface-grammar",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/nvim-treesitter-svelte-grammar",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/nvim-treesitter-tiger-grammar",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/nvim-treesitter-tlaplus-grammar",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/nvim-treesitter-toml-grammar",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/nvim-treesitter-tsq-grammar",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/nvim-treesitter-tsx-grammar",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/nvim-treesitter-turtle-grammar",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/nvim-treesitter-typescript-grammar",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/nvim-treesitter-verilog-grammar",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/nvim-treesitter-vim-grammar",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/nvim-treesitter-vue-grammar",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/nvim-treesitter-yaml-grammar",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/nvim-treesitter-yang-grammar",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/nvim-treesitter-zig-grammar",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/plenary.nvim",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/rust-tools.nvim",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/telescope.nvim",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/toggleterm.nvim",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/vim-tmux-navigator",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/vimspector",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/__python3_dependencies",
|
||||||
|
"/Users/ragon/.config/nvim",
|
||||||
|
"/Users/ragon/.local/share/nvim/site",
|
||||||
|
"/nix/store/j5myw4djaj1hmi5r8p5hxaynhingy8k5-neovim-unwrapped-0ecb4d7/share/nvim/runtime",
|
||||||
|
"/nix/store/j5myw4djaj1hmi5r8p5hxaynhingy8k5-neovim-unwrapped-0ecb4d7/lib/nvim",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/cmp-buffer/after",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/cmp-cmdline/after",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/cmp-nvim-lsp/after",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/cmp-path/after",
|
||||||
|
"/nix/store/y7fc4px5ijgv7wpls3r0xiw2hd600q7n-vim-pack-dir/pack/myNeovimPackages/start/cmp_luasnip/after",
|
||||||
|
"${3rd}/love2d/library"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
@ -1,186 +0,0 @@
|
||||||
-- Some servers have issues with backup files, see #649
|
|
||||||
vim.opt.backup = false
|
|
||||||
vim.opt.writebackup = false
|
|
||||||
|
|
||||||
-- Having longer updatetime (default is 4000 ms = 4s) leads to noticeable
|
|
||||||
-- delays and poor user experience
|
|
||||||
vim.opt.updatetime = 100
|
|
||||||
|
|
||||||
-- Always show the signcolumn, otherwise it would shift the text each time
|
|
||||||
-- diagnostics appeared/became resolved
|
|
||||||
vim.opt.signcolumn = "yes"
|
|
||||||
|
|
||||||
local keyset = vim.keymap.set
|
|
||||||
-- Autocomplete
|
|
||||||
function _G.check_back_space()
|
|
||||||
local col = vim.fn.col('.') - 1
|
|
||||||
return col == 0 or vim.fn.getline('.'):sub(col, col):match('%s') ~= nil
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Use Tab for trigger completion with characters ahead and navigate
|
|
||||||
-- NOTE: There's always a completion item selected by default, you may want to enable
|
|
||||||
-- no select by setting `"suggest.noselect": true` in your configuration file
|
|
||||||
-- NOTE: Use command ':verbose imap <tab>' to make sure Tab is not mapped by
|
|
||||||
-- other plugins before putting this into your config
|
|
||||||
local opts = {silent = true, noremap = true, expr = true, replace_keycodes = false}
|
|
||||||
keyset("i", "<TAB>", 'coc#pum#visible() ? coc#pum#next(1) : v:lua.check_back_space() ? "<TAB>" : coc#refresh()', opts)
|
|
||||||
keyset("i", "<S-TAB>", [[coc#pum#visible() ? coc#pum#prev(1) : "\<C-h>"]], opts)
|
|
||||||
|
|
||||||
-- Make <CR> to accept selected completion item or notify coc.nvim to format
|
|
||||||
-- <C-g>u breaks current undo, please make your own choice
|
|
||||||
keyset("i", "<cr>", [[coc#pum#visible() ? coc#pum#confirm() : "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>"]], opts)
|
|
||||||
|
|
||||||
-- Use <c-j> to trigger snippets
|
|
||||||
keyset("i", "<c-j>", "<Plug>(coc-snippets-expand-jump)")
|
|
||||||
-- Use <c-space> to trigger completion
|
|
||||||
keyset("i", "<c-space>", "coc#refresh()", {silent = true, expr = true})
|
|
||||||
|
|
||||||
-- Use `[g` and `]g` to navigate diagnostics
|
|
||||||
-- Use `:CocDiagnostics` to get all diagnostics of current buffer in location list
|
|
||||||
keyset("n", "[g", "<Plug>(coc-diagnostic-prev)", {silent = true})
|
|
||||||
keyset("n", "]g", "<Plug>(coc-diagnostic-next)", {silent = true})
|
|
||||||
|
|
||||||
-- GoTo code navigation
|
|
||||||
keyset("n", "gd", "<Plug>(coc-definition)", {silent = true})
|
|
||||||
keyset("n", "gy", "<Plug>(coc-type-definition)", {silent = true})
|
|
||||||
keyset("n", "gi", "<Plug>(coc-implementation)", {silent = true})
|
|
||||||
keyset("n", "gr", "<Plug>(coc-references)", {silent = true})
|
|
||||||
|
|
||||||
|
|
||||||
-- Use K to show documentation in preview window
|
|
||||||
function _G.show_docs()
|
|
||||||
local cw = vim.fn.expand('<cword>')
|
|
||||||
if vim.fn.index({'vim', 'help'}, vim.bo.filetype) >= 0 then
|
|
||||||
vim.api.nvim_command('h ' .. cw)
|
|
||||||
elseif vim.api.nvim_eval('coc#rpc#ready()') then
|
|
||||||
vim.fn.CocActionAsync('doHover')
|
|
||||||
else
|
|
||||||
vim.api.nvim_command('!' .. vim.o.keywordprg .. ' ' .. cw)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
keyset("n", "K", '<CMD>lua _G.show_docs()<CR>', {silent = true})
|
|
||||||
|
|
||||||
|
|
||||||
-- Highlight the symbol and its references on a CursorHold event(cursor is idle)
|
|
||||||
vim.api.nvim_create_augroup("CocGroup", {})
|
|
||||||
vim.api.nvim_create_autocmd("CursorHold", {
|
|
||||||
group = "CocGroup",
|
|
||||||
command = "silent call CocActionAsync('highlight')",
|
|
||||||
desc = "Highlight symbol under cursor on CursorHold"
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
-- Symbol renaming
|
|
||||||
keyset("n", "<leader>rn", "<Plug>(coc-rename)", {silent = true})
|
|
||||||
|
|
||||||
|
|
||||||
-- Formatting selected code
|
|
||||||
keyset("x", "<leader>f", "<Plug>(coc-format-selected)", {silent = true})
|
|
||||||
keyset("n", "<leader>f", "<Plug>(coc-format-selected)", {silent = true})
|
|
||||||
|
|
||||||
|
|
||||||
-- Setup formatexpr specified filetype(s)
|
|
||||||
vim.api.nvim_create_autocmd("FileType", {
|
|
||||||
group = "CocGroup",
|
|
||||||
pattern = "typescript,json",
|
|
||||||
command = "setl formatexpr=CocAction('formatSelected')",
|
|
||||||
desc = "Setup formatexpr specified filetype(s)."
|
|
||||||
})
|
|
||||||
|
|
||||||
-- Update signature help on jump placeholder
|
|
||||||
vim.api.nvim_create_autocmd("User", {
|
|
||||||
group = "CocGroup",
|
|
||||||
pattern = "CocJumpPlaceholder",
|
|
||||||
command = "call CocActionAsync('showSignatureHelp')",
|
|
||||||
desc = "Update signature help on jump placeholder"
|
|
||||||
})
|
|
||||||
|
|
||||||
-- Apply codeAction to the selected region
|
|
||||||
-- Example: `<leader>aap` for current paragraph
|
|
||||||
local opts = {silent = true, nowait = true}
|
|
||||||
keyset("x", "<leader>a", "<Plug>(coc-codeaction-selected)", opts)
|
|
||||||
keyset("n", "<leader>a", "<Plug>(coc-codeaction-selected)", opts)
|
|
||||||
|
|
||||||
-- Remap keys for apply code actions at the cursor position.
|
|
||||||
keyset("n", "<leader>ac", "<Plug>(coc-codeaction-cursor)", opts)
|
|
||||||
-- Remap keys for apply code actions affect whole buffer.
|
|
||||||
keyset("n", "<leader>as", "<Plug>(coc-codeaction-source)", opts)
|
|
||||||
-- Remap keys for applying codeActions to the current buffer
|
|
||||||
keyset("n", "<leader>ac", "<Plug>(coc-codeaction)", opts)
|
|
||||||
-- Apply the most preferred quickfix action on the current line.
|
|
||||||
keyset("n", "<leader>qf", "<Plug>(coc-fix-current)", opts)
|
|
||||||
|
|
||||||
-- Remap keys for apply refactor code actions.
|
|
||||||
keyset("n", "<leader>re", "<Plug>(coc-codeaction-refactor)", { silent = true })
|
|
||||||
keyset("x", "<leader>r", "<Plug>(coc-codeaction-refactor-selected)", { silent = true })
|
|
||||||
keyset("n", "<leader>r", "<Plug>(coc-codeaction-refactor-selected)", { silent = true })
|
|
||||||
|
|
||||||
-- Run the Code Lens actions on the current line
|
|
||||||
keyset("n", "<leader>cl", "<Plug>(coc-codelens-action)", opts)
|
|
||||||
|
|
||||||
|
|
||||||
-- Map function and class text objects
|
|
||||||
-- NOTE: Requires 'textDocument.documentSymbol' support from the language server
|
|
||||||
keyset("x", "if", "<Plug>(coc-funcobj-i)", opts)
|
|
||||||
keyset("o", "if", "<Plug>(coc-funcobj-i)", opts)
|
|
||||||
keyset("x", "af", "<Plug>(coc-funcobj-a)", opts)
|
|
||||||
keyset("o", "af", "<Plug>(coc-funcobj-a)", opts)
|
|
||||||
keyset("x", "ic", "<Plug>(coc-classobj-i)", opts)
|
|
||||||
keyset("o", "ic", "<Plug>(coc-classobj-i)", opts)
|
|
||||||
keyset("x", "ac", "<Plug>(coc-classobj-a)", opts)
|
|
||||||
keyset("o", "ac", "<Plug>(coc-classobj-a)", opts)
|
|
||||||
|
|
||||||
|
|
||||||
-- Remap <C-f> and <C-b> to scroll float windows/popups
|
|
||||||
---@diagnostic disable-next-line: redefined-local
|
|
||||||
local opts = {silent = true, nowait = true, expr = true}
|
|
||||||
keyset("n", "<C-f>", 'coc#float#has_scroll() ? coc#float#scroll(1) : "<C-f>"', opts)
|
|
||||||
keyset("n", "<C-b>", 'coc#float#has_scroll() ? coc#float#scroll(0) : "<C-b>"', opts)
|
|
||||||
keyset("i", "<C-f>",
|
|
||||||
'coc#float#has_scroll() ? "<c-r>=coc#float#scroll(1)<cr>" : "<Right>"', opts)
|
|
||||||
keyset("i", "<C-b>",
|
|
||||||
'coc#float#has_scroll() ? "<c-r>=coc#float#scroll(0)<cr>" : "<Left>"', opts)
|
|
||||||
keyset("v", "<C-f>", 'coc#float#has_scroll() ? coc#float#scroll(1) : "<C-f>"', opts)
|
|
||||||
keyset("v", "<C-b>", 'coc#float#has_scroll() ? coc#float#scroll(0) : "<C-b>"', opts)
|
|
||||||
|
|
||||||
|
|
||||||
-- Use CTRL-S for selections ranges
|
|
||||||
-- Requires 'textDocument/selectionRange' support of language server
|
|
||||||
keyset("n", "<C-f>", "<Plug>(coc-range-select)", {silent = true})
|
|
||||||
keyset("x", "<C-f>", "<Plug>(coc-range-select)", {silent = true})
|
|
||||||
|
|
||||||
|
|
||||||
-- Add `:Format` command to format current buffer
|
|
||||||
vim.api.nvim_create_user_command("Format", "call CocAction('format')", {})
|
|
||||||
|
|
||||||
-- " Add `:Fold` command to fold current buffer
|
|
||||||
vim.api.nvim_create_user_command("Fold", "call CocAction('fold', <f-args>)", {nargs = '?'})
|
|
||||||
|
|
||||||
-- Add `:OR` command for organize imports of the current buffer
|
|
||||||
vim.api.nvim_create_user_command("OR", "call CocActionAsync('runCommand', 'editor.action.organizeImport')", {})
|
|
||||||
|
|
||||||
-- Add (Neo)Vim's native statusline support
|
|
||||||
-- NOTE: Please see `:h coc-status` for integrations with external plugins that
|
|
||||||
-- provide custom statusline: lightline.vim, vim-airline
|
|
||||||
vim.opt.statusline:prepend("%{coc#status()}%{get(b:,'coc_current_function','')}")
|
|
||||||
|
|
||||||
-- Mappings for CoCList
|
|
||||||
-- code actions and coc stuff
|
|
||||||
---@diagnostic disable-next-line: redefined-local
|
|
||||||
local opts = {silent = true, nowait = true}
|
|
||||||
-- Show all diagnostics
|
|
||||||
keyset("n", ",a", ":<C-u>CocList diagnostics<cr>", opts)
|
|
||||||
-- Manage extensions
|
|
||||||
keyset("n", ",e", ":<C-u>CocList extensions<cr>", opts)
|
|
||||||
-- Show commands
|
|
||||||
keyset("n", ",c", ":<C-u>CocList commands<cr>", opts)
|
|
||||||
-- Find symbol of current document
|
|
||||||
keyset("n", ",o", ":<C-u>CocList outline<cr>", opts)
|
|
||||||
-- Search workspace symbols
|
|
||||||
keyset("n", ",s", ":<C-u>CocList -I symbols<cr>", opts)
|
|
||||||
-- Do default action for next item
|
|
||||||
keyset("n", ",j", ":<C-u>CocNext<cr>", opts)
|
|
||||||
-- Do default action for previous item
|
|
||||||
keyset("n", ",k", ":<C-u>CocPrev<cr>", opts)
|
|
||||||
-- Resume latest coc list
|
|
||||||
keyset("n", ",p", ":<C-u>CocListResume<cr>", opts)
|
|
||||||
|
|
@ -15,8 +15,6 @@ map { 'n', '<C-j>', '<C-w>j', noremap = true, silent = true}
|
||||||
map { 'n', '<C-k>', '<C-w>k', noremap = true, silent = true}
|
map { 'n', '<C-k>', '<C-w>k', noremap = true, silent = true}
|
||||||
map { 'n', '<C-l>', '<C-w>l', noremap = true, silent = true}
|
map { 'n', '<C-l>', '<C-w>l', noremap = true, silent = true}
|
||||||
|
|
||||||
-- buffer binds
|
|
||||||
map { 'n', '<leader>q', '<cmd>bd<CR>', noremap = false, silent = true}
|
|
||||||
-- telescope
|
-- telescope
|
||||||
map { 'n', '<leader>b', '<cmd>Telescope buffers<CR>', noremap = false, silent = true}
|
map { 'n', '<leader>b', '<cmd>Telescope buffers<CR>', noremap = false, silent = true}
|
||||||
--map { 'n', '<leader>ff', '<cmd>Telescope find_files<CR>', noremap = false, silent = true}
|
--map { 'n', '<leader>ff', '<cmd>Telescope find_files<CR>', noremap = false, silent = true}
|
||||||
|
|
@ -43,10 +41,6 @@ map { 'x', '<leader>di', '<Plug>VimspectorBalloonEval', noremap = false, silent
|
||||||
-- map { 'n', '<leader>t', ':term<CR>', noremap = false, silent = true}
|
-- map { 'n', '<leader>t', ':term<CR>', noremap = false, silent = true}
|
||||||
-- map { 't', '<C-b>', '<C-\\><C-n>', noremap = true, silent = true}
|
-- map { 't', '<C-b>', '<C-\\><C-n>', noremap = true, silent = true}
|
||||||
|
|
||||||
-- plugins - commentary
|
|
||||||
map { 'n', '<leader>c', '<cmd>Commentary<CR>', noremap = false, silent = true}
|
|
||||||
-- plugins - vista
|
|
||||||
map { 'n', '<leader>v', '<cmd>Vista!!<CR>', noremap = false, silent = true}
|
|
||||||
-- plugins - nnn
|
-- plugins - nnn
|
||||||
map { 'n', '<tab>', '<cmd>:NnnPicker %:p:h<CR>', noremap = true, silent = true}
|
map { 'n', '<tab>', '<cmd>:NnnPicker %:p:h<CR>', noremap = true, silent = true}
|
||||||
map { 'n', '<s-tab>', '<cmd>:NnnExplorer %:p:h<CR>', noremap = true, silent = true}
|
map { 'n', '<s-tab>', '<cmd>:NnnExplorer %:p:h<CR>', noremap = true, silent = true}
|
||||||
|
|
@ -54,3 +48,9 @@ map { 'n', '<s-tab>', '<cmd>:NnnExplorer %:p:h<CR>', noremap = true, silent = tr
|
||||||
-- plugins - terminal
|
-- plugins - terminal
|
||||||
map {"n", "<leader>gg", "<cmd>lua _lazygit_toggle()<CR>", {noremap = true, silent = true}}
|
map {"n", "<leader>gg", "<cmd>lua _lazygit_toggle()<CR>", {noremap = true, silent = true}}
|
||||||
map {"n", "<leader>gp", "<cmd>lua _pipeline_toggle()<CR>", {noremap = true, silent = true}}
|
map {"n", "<leader>gp", "<cmd>lua _pipeline_toggle()<CR>", {noremap = true, silent = true}}
|
||||||
|
|
||||||
|
-- diagnostic
|
||||||
|
map {"n", "<leader>e", "<cmd>lua require\'telescope.builtin\'.lsp_diagnostics{}<CR>", { noremap = true, silent = true}}
|
||||||
|
map {"n", "<leader>q", "<cmd>lua vim.diagnostic.setloclist()<CR>", { noremap = true, silent = true}}
|
||||||
|
map {"n", "]g", "<cmd>lua vim.diagnostic.goto_next()<CR>", { noremap = true, silent = true}}
|
||||||
|
map {"n", "[g", "<cmd>lua vim.diagnostic.goto_prev()<CR>", { noremap = true, silent = true}}
|
||||||
|
|
|
||||||
52
hm-imports/nvim/config/lua/plugin/cmp.lua
Normal file
52
hm-imports/nvim/config/lua/plugin/cmp.lua
Normal file
|
|
@ -0,0 +1,52 @@
|
||||||
|
local cmp = require 'cmp'
|
||||||
|
local lspkind = require 'lspkind'
|
||||||
|
local luasnip = require 'luasnip'
|
||||||
|
local has_words_before = function()
|
||||||
|
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
|
||||||
|
return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
|
||||||
|
end
|
||||||
|
|
||||||
|
cmp.setup({
|
||||||
|
snippet = {
|
||||||
|
expand = function(args)
|
||||||
|
require('luasnip').lsp_expand(args.body)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
mapping = {
|
||||||
|
['<CR>'] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
|
||||||
|
["<Tab>"] = cmp.mapping(function(fallback)
|
||||||
|
if cmp.visible() then
|
||||||
|
cmp.select_next_item()
|
||||||
|
elseif luasnip.expand_or_jumpable() then
|
||||||
|
luasnip.expand_or_jump()
|
||||||
|
elseif has_words_before() then
|
||||||
|
cmp.complete()
|
||||||
|
else
|
||||||
|
fallback() -- The fallback function sends a already mapped key. In this case, it's probably `<Tab>`.
|
||||||
|
end
|
||||||
|
end, { "i", "s" }),
|
||||||
|
["<S-Tab>"] = cmp.mapping(function()
|
||||||
|
if cmp.visible() then
|
||||||
|
cmp.select_prev_item()
|
||||||
|
elseif luasnip.jumpable(-1) then
|
||||||
|
luasnip.jump(-1)
|
||||||
|
end
|
||||||
|
end, { "i", "s" }),
|
||||||
|
},
|
||||||
|
sources = cmp.config.sources({
|
||||||
|
{ name = "nvim_lsp" },
|
||||||
|
{ name = "luasnip" },
|
||||||
|
}, { name = "buffer" }),
|
||||||
|
formatting = {
|
||||||
|
format = lspkind.cmp_format({
|
||||||
|
mode = "symbol_text",
|
||||||
|
menu = ({
|
||||||
|
buffer = "[Buffer]",
|
||||||
|
nvim_lsp = "[LSP]",
|
||||||
|
luasnip = "[LuaSnip]",
|
||||||
|
nvim_lua = "[Lua]",
|
||||||
|
latex_symbols = "[Latex]",
|
||||||
|
})
|
||||||
|
}),
|
||||||
|
},
|
||||||
|
})
|
||||||
1
hm-imports/nvim/config/lua/plugin/gitsigns.lua
Normal file
1
hm-imports/nvim/config/lua/plugin/gitsigns.lua
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
require('gitsigns').setup {}
|
||||||
101
hm-imports/nvim/config/lua/plugin/lsp.lua
Normal file
101
hm-imports/nvim/config/lua/plugin/lsp.lua
Normal file
|
|
@ -0,0 +1,101 @@
|
||||||
|
local lspconfig = require 'lspconfig'
|
||||||
|
local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
||||||
|
-- lsp keymaps
|
||||||
|
local lsp_attach_keymappings = {
|
||||||
|
['gD'] = 'vim.lsp.buf.declaration()',
|
||||||
|
['gd'] = 'vim.lsp.buf.definition()',
|
||||||
|
['K'] = 'vim.lsp.buf.hover()',
|
||||||
|
['gi'] = 'vim.lsp.buf.implementation()',
|
||||||
|
['<C-k>'] = 'vim.lsp.buf.signature_help()',
|
||||||
|
['<leader>wa'] = 'vim.lsp.buf.add_workspace_folder()',
|
||||||
|
['<leader>wr'] = 'vim.lsp.buf.remove_workspace_folder()',
|
||||||
|
['<leader>ws'] = 'vim.lsp.buf.workspace_symbol()',
|
||||||
|
['<leader>wl'] = 'print(vim.inspect(vim.lsp.buf.list_workspace_folders()))',
|
||||||
|
['<leader>D'] = 'vim.lsp.buf.type_definition()',
|
||||||
|
['<leader>rn'] = 'vim.lsp.buf.rename()',
|
||||||
|
['<leader>ca'] = 'vim.lsp.buf.code_action()',
|
||||||
|
['gr'] = 'vim.lsp.buf.references()',
|
||||||
|
['<leader>f'] = 'vim.lsp.buf.format()'
|
||||||
|
}
|
||||||
|
local buf_nnoremap_lua = function(bufnr, keys, command)
|
||||||
|
vim.api.nvim_buf_set_keymap(bufnr, 'n', keys, '<cmd>lua ' .. command .. '<CR>', { noremap = true, silent = true })
|
||||||
|
end
|
||||||
|
local on_lsp_attach = function(_, bufnr)
|
||||||
|
-- Enable completion triggered by <c-x><c-o>:
|
||||||
|
vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc')
|
||||||
|
for key, cmd in pairs(lsp_attach_keymappings) do buf_nnoremap_lua(bufnr, key, cmd) end
|
||||||
|
end
|
||||||
|
|
||||||
|
lspconfig.gopls.setup { capabilities = capabilities, on_attach = on_lsp_attach }
|
||||||
|
lspconfig.pyright.setup { capabilities = capabilities, on_attach = on_lsp_attach }
|
||||||
|
lspconfig.nil_ls.setup { capabilities = capabilities, on_attach = on_lsp_attach } -- nix
|
||||||
|
-- lspconfig.rnix.setup { capabilities = capabilities, on_attach = on_lsp_attach } -- nix
|
||||||
|
lspconfig.terraformls.setup { capabilities = capabilities, on_attach = on_lsp_attach }
|
||||||
|
lspconfig.tsserver.setup { capabilities = capabilities, on_attach = on_lsp_attach }
|
||||||
|
lspconfig.vimls.setup {
|
||||||
|
capabilities = capabilities,
|
||||||
|
on_attach = on_lsp_attach,
|
||||||
|
isNeovim = true,
|
||||||
|
}
|
||||||
|
|
||||||
|
lspconfig.csharp_ls.setup {
|
||||||
|
capabilities = capabilities,
|
||||||
|
on_attach = on_lsp_attach,
|
||||||
|
cmd = {vim.env.HOME .. "/.dotnet/tools/csharp-ls"},
|
||||||
|
}
|
||||||
|
lspconfig.ltex.setup { capabilities = capabilities, on_attach = on_lsp_attach }
|
||||||
|
-- start vscode included language servers
|
||||||
|
lspconfig.eslint.setup { capabilities = capabilities, on_attach = on_lsp_attach }
|
||||||
|
lspconfig.html.setup { capabilities = capabilities, on_attach = on_lsp_attach }
|
||||||
|
lspconfig.cssls.setup { capabilities = capabilities, on_attach = on_lsp_attach }
|
||||||
|
lspconfig.jsonls.setup { capabilities = capabilities, on_attach = on_lsp_attach }
|
||||||
|
-- end vscode included language servers
|
||||||
|
lspconfig.texlab.setup { capabilities = capabilities, on_attach = on_lsp_attach, settings = { texlab = {
|
||||||
|
build = {
|
||||||
|
executable = "tectonic",
|
||||||
|
args = { "%f", "--keep-logs", "--synctex"},
|
||||||
|
onSave = true,
|
||||||
|
forwardSearchAfter = true,
|
||||||
|
},
|
||||||
|
chktex = { onOpenAndSave = true, },
|
||||||
|
forwardSearch = {
|
||||||
|
executable = "/Applications/Skim.app/Contents/SharedSupport/displayline",
|
||||||
|
args = {"-r", "-d", "%l","%p","%f"},
|
||||||
|
},
|
||||||
|
}} }
|
||||||
|
lspconfig.sumneko_lua.setup {
|
||||||
|
capabilities = capabilities, on_attach = on_lsp_attach,
|
||||||
|
settings = {
|
||||||
|
Lua = {
|
||||||
|
runtime = {
|
||||||
|
version = 'LuaJIT'
|
||||||
|
},
|
||||||
|
diagnostics = { globals = { 'vim' } },
|
||||||
|
workspace = {
|
||||||
|
-- Make the LSP aware of Neovim runtime files:
|
||||||
|
library = vim.api.nvim_get_runtime_file('', true)
|
||||||
|
},
|
||||||
|
format = {
|
||||||
|
enable = true,
|
||||||
|
defaultConfig = {
|
||||||
|
indent_style = 'space',
|
||||||
|
indent_size = '2',
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
local rt = require("rust-tools")
|
||||||
|
rt.setup({
|
||||||
|
tools = {
|
||||||
|
inlay_hints = {
|
||||||
|
auto = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
server = {
|
||||||
|
capabilities = capabilities, on_attach = on_lsp_attach,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
@ -1,28 +1,215 @@
|
||||||
require('lualine').setup {
|
-- Eviline config for lualine
|
||||||
|
-- Author: shadmansaleh
|
||||||
|
-- Credit: glepnir
|
||||||
|
local lualine = require('lualine')
|
||||||
|
|
||||||
|
-- Color table for highlights
|
||||||
|
-- stylua: ignore
|
||||||
|
local colors = {
|
||||||
|
bg = '#202328',
|
||||||
|
fg = '#bbc2cf',
|
||||||
|
yellow = '#ECBE7B',
|
||||||
|
cyan = '#008080',
|
||||||
|
darkblue = '#081633',
|
||||||
|
green = '#98be65',
|
||||||
|
orange = '#FF8800',
|
||||||
|
violet = '#a9a1e1',
|
||||||
|
magenta = '#c678dd',
|
||||||
|
blue = '#51afef',
|
||||||
|
red = '#ec5f67',
|
||||||
|
}
|
||||||
|
|
||||||
|
local conditions = {
|
||||||
|
buffer_not_empty = function()
|
||||||
|
return vim.fn.empty(vim.fn.expand('%:t')) ~= 1
|
||||||
|
end,
|
||||||
|
hide_in_width = function()
|
||||||
|
return vim.fn.winwidth(0) > 80
|
||||||
|
end,
|
||||||
|
check_git_workspace = function()
|
||||||
|
local filepath = vim.fn.expand('%:p:h')
|
||||||
|
local gitdir = vim.fn.finddir('.git', filepath .. ';')
|
||||||
|
return gitdir and #gitdir > 0 and #gitdir < #filepath
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
|
||||||
|
-- Config
|
||||||
|
local config = {
|
||||||
options = {
|
options = {
|
||||||
icons_enabled = true,
|
-- Disable sections and component separators
|
||||||
|
component_separators = '',
|
||||||
|
section_separators = '',
|
||||||
theme = 'gruvbox',
|
theme = 'gruvbox',
|
||||||
--component_separators = { left = '', right = ''},
|
|
||||||
--section_separators = { left = '', right = ''},
|
|
||||||
disabled_filetypes = {},
|
|
||||||
always_divide_middle = true,
|
|
||||||
},
|
},
|
||||||
sections = {
|
sections = {
|
||||||
lualine_a = {'mode'},
|
-- these are to remove the defaults
|
||||||
lualine_b = {'branch', 'diff', 'diagnostics'},
|
|
||||||
lualine_c = {'filename'},
|
|
||||||
lualine_x = {'encoding', 'fileformat', 'filetype'},
|
|
||||||
lualine_y = {'progress'},
|
|
||||||
lualine_z = {'location'}
|
|
||||||
},
|
|
||||||
inactive_sections = {
|
|
||||||
lualine_a = {},
|
lualine_a = {},
|
||||||
lualine_b = {},
|
lualine_b = {},
|
||||||
lualine_c = {'filename'},
|
|
||||||
lualine_x = {'location'},
|
|
||||||
lualine_y = {},
|
lualine_y = {},
|
||||||
lualine_z = {}
|
lualine_z = {},
|
||||||
|
-- These will be filled later
|
||||||
|
lualine_c = {},
|
||||||
|
lualine_x = {},
|
||||||
|
},
|
||||||
|
inactive_sections = {
|
||||||
|
-- these are to remove the defaults
|
||||||
|
lualine_a = {},
|
||||||
|
lualine_b = {},
|
||||||
|
lualine_y = {},
|
||||||
|
lualine_z = {},
|
||||||
|
lualine_c = {},
|
||||||
|
lualine_x = {},
|
||||||
},
|
},
|
||||||
tabline = {},
|
|
||||||
extensions = {}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
-- Inserts a component in lualine_c at left section
|
||||||
|
local function ins_left(component)
|
||||||
|
table.insert(config.sections.lualine_c, component)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Inserts a component in lualine_x at right section
|
||||||
|
local function ins_right(component)
|
||||||
|
table.insert(config.sections.lualine_x, component)
|
||||||
|
end
|
||||||
|
|
||||||
|
ins_left {
|
||||||
|
function()
|
||||||
|
return '▊'
|
||||||
|
end,
|
||||||
|
color = { fg = colors.blue }, -- Sets highlighting of component
|
||||||
|
padding = { left = 0, right = 1 }, -- We don't need space before this
|
||||||
|
}
|
||||||
|
|
||||||
|
ins_left {
|
||||||
|
-- mode component
|
||||||
|
function()
|
||||||
|
return ''
|
||||||
|
end,
|
||||||
|
color = function()
|
||||||
|
-- auto change color according to neovims mode
|
||||||
|
local mode_color = {
|
||||||
|
n = colors.red,
|
||||||
|
i = colors.green,
|
||||||
|
v = colors.blue,
|
||||||
|
[''] = colors.blue,
|
||||||
|
V = colors.blue,
|
||||||
|
c = colors.magenta,
|
||||||
|
no = colors.red,
|
||||||
|
s = colors.orange,
|
||||||
|
S = colors.orange,
|
||||||
|
[''] = colors.orange,
|
||||||
|
ic = colors.yellow,
|
||||||
|
R = colors.violet,
|
||||||
|
Rv = colors.violet,
|
||||||
|
cv = colors.red,
|
||||||
|
ce = colors.red,
|
||||||
|
r = colors.cyan,
|
||||||
|
rm = colors.cyan,
|
||||||
|
['r?'] = colors.cyan,
|
||||||
|
['!'] = colors.red,
|
||||||
|
t = colors.red,
|
||||||
|
}
|
||||||
|
return { fg = mode_color[vim.fn.mode()] }
|
||||||
|
end,
|
||||||
|
padding = { right = 1 },
|
||||||
|
}
|
||||||
|
|
||||||
|
ins_left {
|
||||||
|
-- filesize component
|
||||||
|
'filesize',
|
||||||
|
cond = conditions.buffer_not_empty,
|
||||||
|
}
|
||||||
|
|
||||||
|
ins_left {
|
||||||
|
'filename',
|
||||||
|
cond = conditions.buffer_not_empty,
|
||||||
|
color = { fg = colors.magenta, gui = 'bold' },
|
||||||
|
}
|
||||||
|
|
||||||
|
ins_left { 'location' }
|
||||||
|
|
||||||
|
ins_left { 'progress', color = { fg = colors.fg, gui = 'bold' } }
|
||||||
|
|
||||||
|
ins_left {
|
||||||
|
'diagnostics',
|
||||||
|
sources = { 'nvim_diagnostic' },
|
||||||
|
symbols = { error = ' ', warn = ' ', info = ' ' },
|
||||||
|
diagnostics_color = {
|
||||||
|
color_error = { fg = colors.red },
|
||||||
|
color_warn = { fg = colors.yellow },
|
||||||
|
color_info = { fg = colors.cyan },
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
-- Insert mid section. You can make any number of sections in neovim :)
|
||||||
|
-- for lualine it's any number greater then 2
|
||||||
|
ins_left {
|
||||||
|
function()
|
||||||
|
return '%='
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
|
||||||
|
ins_left {
|
||||||
|
-- Lsp server name .
|
||||||
|
function()
|
||||||
|
local msg = 'No Active Lsp'
|
||||||
|
local buf_ft = vim.api.nvim_buf_get_option(0, 'filetype')
|
||||||
|
local clients = vim.lsp.get_active_clients()
|
||||||
|
if next(clients) == nil then
|
||||||
|
return msg
|
||||||
|
end
|
||||||
|
for _, client in ipairs(clients) do
|
||||||
|
local filetypes = client.config.filetypes
|
||||||
|
if filetypes and vim.fn.index(filetypes, buf_ft) ~= -1 then
|
||||||
|
return client.name
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return msg
|
||||||
|
end,
|
||||||
|
icon = ' LSP:',
|
||||||
|
color = { fg = '#ffffff', gui = 'bold' },
|
||||||
|
}
|
||||||
|
|
||||||
|
-- Add components to right sections
|
||||||
|
ins_right {
|
||||||
|
'o:encoding', -- option component same as &encoding in viml
|
||||||
|
fmt = string.upper, -- I'm not sure why it's upper case either ;)
|
||||||
|
cond = conditions.hide_in_width,
|
||||||
|
color = { fg = colors.green, gui = 'bold' },
|
||||||
|
}
|
||||||
|
|
||||||
|
ins_right {
|
||||||
|
'fileformat',
|
||||||
|
fmt = string.upper,
|
||||||
|
icons_enabled = false, -- I think icons are cool but Eviline doesn't have them. sigh
|
||||||
|
color = { fg = colors.green, gui = 'bold' },
|
||||||
|
}
|
||||||
|
|
||||||
|
ins_right {
|
||||||
|
'branch',
|
||||||
|
icon = '',
|
||||||
|
color = { fg = colors.violet, gui = 'bold' },
|
||||||
|
}
|
||||||
|
|
||||||
|
ins_right {
|
||||||
|
'diff',
|
||||||
|
-- Is it me or the symbol for modified us really weird
|
||||||
|
symbols = { added = ' ', modified = '柳 ', removed = ' ' },
|
||||||
|
diff_color = {
|
||||||
|
added = { fg = colors.green },
|
||||||
|
modified = { fg = colors.orange },
|
||||||
|
removed = { fg = colors.red },
|
||||||
|
},
|
||||||
|
cond = conditions.hide_in_width,
|
||||||
|
}
|
||||||
|
|
||||||
|
ins_right {
|
||||||
|
function()
|
||||||
|
return '▊'
|
||||||
|
end,
|
||||||
|
color = { fg = colors.blue },
|
||||||
|
padding = { left = 1 },
|
||||||
|
}
|
||||||
|
|
||||||
|
-- Now don't forget to initialize lualine
|
||||||
|
lualine.setup(config)
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,13 @@ require("noice").setup({
|
||||||
merge = true,
|
merge = true,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
lsp = {
|
||||||
|
override = {
|
||||||
|
["vim.lsp.util.convert_input_to_markdown_lines"] = true,
|
||||||
|
["vim.lsp.util.stylize_markdown"] = true,
|
||||||
|
["cmp.entry.get_documentation"] = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
-- you can enable a preset for easier configuration
|
-- you can enable a preset for easier configuration
|
||||||
presets = {
|
presets = {
|
||||||
bottom_search = true, -- use a classic bottom cmdline for search
|
bottom_search = true, -- use a classic bottom cmdline for search
|
||||||
|
|
@ -14,6 +21,6 @@ require("noice").setup({
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
require("notify").setup({
|
require("notify").setup({
|
||||||
stages = "static",
|
-- stages = "static",
|
||||||
max_width = 70,
|
-- max_width = 70,
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
require('project_nvim').setup {
|
|
||||||
detection_methods = { "pattern" },
|
|
||||||
}
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
vim.g.rainbow_active = 1
|
|
||||||
|
|
@ -1,2 +1,11 @@
|
||||||
require('telescope').setup {}
|
local telescope = require('telescope')
|
||||||
require('telescope').load_extension('projects')
|
telescope.setup {
|
||||||
|
extensions = {
|
||||||
|
["ui-select"] = {
|
||||||
|
require("telescope.themes").get_dropdown {
|
||||||
|
-- even more opts
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
telescope.load_extension('ui-select')
|
||||||
|
|
|
||||||
|
|
@ -1,20 +1,22 @@
|
||||||
|
local treesitter_parser_install_dir = '/var/tmp/nvim-treesitter/parser'
|
||||||
require'nvim-treesitter.configs'.setup {
|
require'nvim-treesitter.configs'.setup {
|
||||||
highlight = {
|
highlight = {
|
||||||
enable = true,
|
enable = true,
|
||||||
use_languagetree = true,
|
-- use_languagetree = true,
|
||||||
},
|
|
||||||
indent = {
|
|
||||||
enable = true,
|
|
||||||
},
|
|
||||||
autotag = {
|
|
||||||
enable = true,
|
|
||||||
},
|
|
||||||
context_commentstring = {
|
|
||||||
enable = true,
|
|
||||||
enable_autocmd = false,
|
|
||||||
},
|
|
||||||
refactor = {
|
|
||||||
highlight_definitions = { enable = true },
|
|
||||||
highlight_current_scope = { enable = false },
|
|
||||||
},
|
},
|
||||||
|
parser_install_dir = treesitter_parser_install_dir,
|
||||||
|
-- indent = {
|
||||||
|
-- enable = true,
|
||||||
|
-- },
|
||||||
|
-- autotag = {
|
||||||
|
-- enable = true,
|
||||||
|
-- },
|
||||||
|
-- context_commentstring = {
|
||||||
|
-- enable = true,
|
||||||
|
-- enable_autocmd = false,
|
||||||
|
-- },
|
||||||
|
-- refactor = {
|
||||||
|
-- highlight_definitions = { enable = true },
|
||||||
|
-- highlight_current_scope = { enable = false },
|
||||||
|
-- },
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,28 +6,10 @@ vim.cmd [[
|
||||||
syntax on
|
syntax on
|
||||||
]]
|
]]
|
||||||
-- mapleader
|
-- mapleader
|
||||||
|
local opt = vim.opt
|
||||||
vim.g.mapleader = ' '
|
vim.g.mapleader = ' '
|
||||||
vim.g.maplocalleader = ','
|
vim.g.maplocalleader = ','
|
||||||
|
|
||||||
require('utils')
|
|
||||||
require('keybindings')
|
|
||||||
require('filetypes')
|
|
||||||
local opt = vim.opt
|
|
||||||
|
|
||||||
-- load plugin luas (idk how to do that autmagically)
|
|
||||||
--require('plugin.treesitter')
|
|
||||||
require('plugin.nnn')
|
|
||||||
require('plugin.rainbow')
|
|
||||||
require('plugin.terminal')
|
|
||||||
require('plugin.project')
|
|
||||||
require('plugin.noice')
|
|
||||||
require('plugin.telescope')
|
|
||||||
|
|
||||||
|
|
||||||
-- plugins - coc
|
|
||||||
--vim.cmd 'source ~/.config/nvim/coc.vim' -- too lazy to convert all the shit to lua
|
|
||||||
require('coc')
|
|
||||||
|
|
||||||
-- color stuff
|
-- color stuff
|
||||||
opt.termguicolors = true -- 24bit color
|
opt.termguicolors = true -- 24bit color
|
||||||
vim.g.gruvbox_italic = 1
|
vim.g.gruvbox_italic = 1
|
||||||
|
|
@ -56,4 +38,18 @@ opt.softtabstop = 2
|
||||||
opt.hidden = true
|
opt.hidden = true
|
||||||
-- low updatetime so it isnt as slow
|
-- low updatetime so it isnt as slow
|
||||||
opt.updatetime = 100
|
opt.updatetime = 100
|
||||||
|
|
||||||
|
require('utils')
|
||||||
|
require('keybindings')
|
||||||
|
require('filetypes')
|
||||||
|
|
||||||
|
-- load plugin luas (idk how to do that autmagically)
|
||||||
|
require('plugin.treesitter')
|
||||||
|
require('plugin.nnn')
|
||||||
|
require('plugin.terminal')
|
||||||
|
require('plugin.noice')
|
||||||
|
require('plugin.telescope')
|
||||||
|
require('plugin.cmp')
|
||||||
|
require('plugin.lsp')
|
||||||
require('plugin.lualine')
|
require('plugin.lualine')
|
||||||
|
require('plugin.gitsigns')
|
||||||
|
|
|
||||||
|
|
@ -1,9 +0,0 @@
|
||||||
augroup neovim_terminal
|
|
||||||
autocmd!
|
|
||||||
" Enter Terminal-mode (insert) automatically
|
|
||||||
autocmd TermOpen * startinsert
|
|
||||||
" Disables number lines on terminal buffers
|
|
||||||
autocmd TermOpen * :set nonumber norelativenumber
|
|
||||||
" allows you to use Ctrl-c on terminal window
|
|
||||||
autocmd TermOpen * nnoremap <buffer> <C-c> i<C-c>
|
|
||||||
augroup END
|
|
||||||
|
|
@ -1,22 +1,35 @@
|
||||||
{ pkgs, config, lib, inputs, ... }:
|
{ pkgs, config, lib, inputs, ... }:
|
||||||
{
|
{
|
||||||
home.packages = with pkgs;[
|
home.packages = with pkgs;[
|
||||||
python3 # ultisnips
|
# telescope
|
||||||
|
ripgrep
|
||||||
|
# embedded terminal
|
||||||
lazygit
|
lazygit
|
||||||
nodejs # coc-nvim
|
|
||||||
yarn # coc-nvim
|
|
||||||
#inputs.rnix-lsp.packages."${pkgs.system}".rnix-lsp
|
|
||||||
nil
|
|
||||||
neovim-remote
|
|
||||||
tectonic
|
|
||||||
|
|
||||||
# lsp
|
|
||||||
shfmt
|
|
||||||
shellcheck
|
|
||||||
vim-vint
|
|
||||||
glab
|
glab
|
||||||
nodePackages.write-good
|
|
||||||
ctags
|
# language servers
|
||||||
|
nil # nix
|
||||||
|
#inputs.rnix-lsp.packages."${pkgs.system}".rnix-lsp
|
||||||
|
gopls # go
|
||||||
|
pyright # python3
|
||||||
|
terraform-ls
|
||||||
|
terraform
|
||||||
|
nodePackages.typescript
|
||||||
|
nodePackages.typescript-language-server
|
||||||
|
sumneko-lua-language-server
|
||||||
|
ltex-ls # languageTool
|
||||||
|
nodePackages.vscode-langservers-extracted # eslint, ...
|
||||||
|
texlab # latex
|
||||||
|
tectonic
|
||||||
|
# rust completion
|
||||||
|
cargo
|
||||||
|
rustc
|
||||||
|
rustfmt
|
||||||
|
rust-analyzer
|
||||||
|
|
||||||
|
|
||||||
|
# other stuff
|
||||||
|
neovim-remote
|
||||||
];
|
];
|
||||||
home.file.".config/nvim".source = ./config;
|
home.file.".config/nvim".source = ./config;
|
||||||
home.file.".config/nvim".recursive = true;
|
home.file.".config/nvim".recursive = true;
|
||||||
|
|
@ -32,10 +45,10 @@
|
||||||
viAlias = true;
|
viAlias = true;
|
||||||
plugins =
|
plugins =
|
||||||
let
|
let
|
||||||
nnn-vim = pkgs.vimUtils.buildVimPlugin {
|
nnn-nvim = pkgs.vimUtils.buildVimPlugin {
|
||||||
pname = "nnn-vim";
|
pname = "nnn-nvim";
|
||||||
version = "1.0.0";
|
version = "1.0.0";
|
||||||
src = inputs.nnn-vim;
|
src = inputs.nnn-nvim;
|
||||||
};
|
};
|
||||||
notify-nvim = pkgs.vimUtils.buildVimPlugin {
|
notify-nvim = pkgs.vimUtils.buildVimPlugin {
|
||||||
pname = "notify-nvim";
|
pname = "notify-nvim";
|
||||||
|
|
@ -47,107 +60,45 @@
|
||||||
version = "1.0.0";
|
version = "1.0.0";
|
||||||
src = inputs.noice-nvim;
|
src = inputs.noice-nvim;
|
||||||
};
|
};
|
||||||
#coc-ltex = pkgs.vimUtils.buildVimPlugin {
|
|
||||||
# name = "coc-nvim";
|
|
||||||
# src = inputs.coc-nvim;
|
|
||||||
#};
|
|
||||||
#dart-vim = pkgs.vimUtils.buildVimPlugin {
|
|
||||||
# name = "dart-vim";
|
|
||||||
# src = inputs.dart-vim;
|
|
||||||
#};
|
|
||||||
in
|
in
|
||||||
map (x: { plugin = x; }) (with pkgs.vimPlugins; [
|
map (x: { plugin = x; }) (with pkgs.vimPlugins; [
|
||||||
vim-tmux-navigator
|
vim-tmux-navigator # tmux
|
||||||
galaxyline-nvim
|
nnn-nvim # nnn as filebrowser
|
||||||
nvim-web-devicons
|
gruvbox # theme
|
||||||
nnn-vim
|
# complete ui overhaul
|
||||||
rainbow
|
|
||||||
vista-vim
|
|
||||||
polyglot
|
|
||||||
vim-commentary
|
|
||||||
vim-table-mode
|
|
||||||
vim-speeddating
|
|
||||||
vim-nix
|
|
||||||
gruvbox
|
|
||||||
incsearch-vim
|
|
||||||
vim-highlightedyank
|
|
||||||
vim-fugitive
|
|
||||||
#fzf-vim
|
|
||||||
lualine-nvim
|
|
||||||
#fzfWrapper
|
|
||||||
vim-devicons
|
|
||||||
toggleterm-nvim
|
|
||||||
undotree
|
|
||||||
vim-pandoc
|
|
||||||
vim-pandoc-syntax
|
|
||||||
#ultisnips
|
|
||||||
#dart-vim
|
|
||||||
|
|
||||||
nvim-treesitter.withAllGrammars
|
|
||||||
notify-nvim
|
notify-nvim
|
||||||
noice-nvim
|
|
||||||
nui-nvim
|
nui-nvim
|
||||||
|
noice-nvim
|
||||||
|
|
||||||
|
|
||||||
plenary-nvim
|
|
||||||
telescope-nvim
|
telescope-nvim
|
||||||
project-nvim
|
telescope-ui-select-nvim
|
||||||
|
# line
|
||||||
|
lualine-nvim
|
||||||
|
|
||||||
vimspector
|
# vcs integration
|
||||||
|
gitsigns-nvim
|
||||||
|
|
||||||
coc-nvim
|
# completion
|
||||||
|
nvim-lspconfig # lsp
|
||||||
|
vimspector # dap
|
||||||
|
pkgs.unstable.vimPlugins.rust-tools-nvim # rust special sauce
|
||||||
|
# completion - nvim-cmp
|
||||||
|
cmp-nvim-lsp
|
||||||
|
cmp-buffer
|
||||||
|
cmp-path
|
||||||
|
cmp-cmdline
|
||||||
|
nvim-cmp # completion ui
|
||||||
|
lspkind-nvim # icons for completion
|
||||||
|
# completion-snippets
|
||||||
|
luasnip
|
||||||
|
cmp_luasnip
|
||||||
|
|
||||||
#telescope-coc-nvim
|
|
||||||
#coc-yank
|
toggleterm-nvim # embed terminals (for lazygit,...)
|
||||||
coc-yaml
|
|
||||||
#coc-wxml
|
# treesitter
|
||||||
#coc-vimtex
|
(nvim-treesitter.withPlugins (
|
||||||
#coc-vimlsp
|
plugins: pkgs.tree-sitter.allGrammars
|
||||||
#coc-vetur # vue
|
))
|
||||||
#coc-ultisnips
|
|
||||||
coc-tsserver
|
|
||||||
#coc-tslint-plugin
|
|
||||||
#coc-tslint
|
|
||||||
coc-toml
|
|
||||||
coc-texlab
|
|
||||||
#coc-tailwindcss
|
|
||||||
#coc-tabnine
|
|
||||||
#coc-svelte
|
|
||||||
#coc-sumneko-lua
|
|
||||||
coc-stylelint
|
|
||||||
coc-sqlfluff
|
|
||||||
#coc-spell-checker
|
|
||||||
pkgs.nodePackages.coc-ltex
|
|
||||||
#coc-solargraph # ruby
|
|
||||||
coc-snippets
|
|
||||||
#coc-smartf
|
|
||||||
coc-sh
|
|
||||||
coc-rust-analyzer
|
|
||||||
#coc-rls
|
|
||||||
#coc-r-lsp
|
|
||||||
coc-python
|
|
||||||
#coc-pyright
|
|
||||||
coc-prettier
|
|
||||||
#coc-pairs
|
|
||||||
#coc-nginx
|
|
||||||
#coc-neco
|
|
||||||
#coc-metals
|
|
||||||
coc-markdownlint
|
|
||||||
coc-lua
|
|
||||||
#coc-lists
|
|
||||||
coc-json
|
|
||||||
coc-jest
|
|
||||||
coc-java
|
|
||||||
#coc-imselect
|
|
||||||
coc-html
|
|
||||||
coc-highlight
|
|
||||||
#coc-haxe
|
|
||||||
coc-go
|
|
||||||
#coc-git
|
|
||||||
#coc-fzf
|
|
||||||
coc-flutter
|
|
||||||
#coc-explorer
|
|
||||||
]);
|
]);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue