this repo has no description
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Make Vim use Nix for language servers

+52 -54
+1
vim/.config/.gitignore
··· 2 2 /tags/* 3 3 !/nvim/tags 4 4 /nvim/custom.vim 5 + /nvim/pack
+1 -1
vim/.config/nvim/after/ftplugin/erlang.vim
··· 1 - setlocal shiftwidth=2 1 + setlocal shiftwidth=4 2 2 3 3 let b:undo_ftplugin = 'setl sw&'
+3
vim/.config/nvim/after/ftplugin/nix.vim
··· 1 + setl path+=. 2 + 3 + let b:undo_ftplugin = 'setl path&'
+1 -1
vim/.config/nvim/after/ftplugin/tf.vim
··· 4 4 5 5 augroup autoformat 6 6 au! 7 - au BufWritePre <buffer> norm! gg=G`` 7 + " au BufWritePre <buffer> norm! gg=G`` 8 8 augroup END 9 9 10 10 let b:undo_ftplugin = 'setl mp& fp& sw&'
+11
vim/.config/nvim/autoload/open.vim
··· 1 + function! open#open() abort 2 + if a:0 > 0 3 + let l:name = a:1 4 + else 5 + let l:name = expand('<cfile>') 6 + endif 7 + 8 + call jobstart(['open', l:name], { 'detach': v:true }) 9 + 10 + echo 'Open '.l:name 11 + endfunction
+1 -1
vim/.config/nvim/autoload/plugins.vim
··· 11 11 12 12 func! plugins#spec() abort 13 13 packadd vim-packager 14 - 15 14 call packager#init({'dir': '~/.local/share/nvim/site/pack/packager'}) 16 15 " Package manager {{{ 17 16 call packager#add('kristijanhusak/vim-packager', {'type': 'opt'}) ··· 43 42 " File manager {{{ 44 43 call packager#add('justinmk/vim-dirvish') " Required for opening directories 45 44 call packager#add('tpope/vim-eunuch') 45 + call packager#add('srstevenson/vim-picker') 46 46 " }}} 47 47 " Completion {{{ 48 48 call packager#add('prabirshrestha/async.vim') " autoload-only
+18 -11
vim/.config/nvim/init.vim
··· 1 1 " vi: foldmethod=marker foldlevel=0 2 2 scriptencoding utf-8 3 3 4 - if exists('$IN_NIX_SHELL') 5 - set shell=fish 6 - endif 4 + set shell=fish 7 5 8 6 " Plugins {{{ 9 7 let g:loaded_netrwPlugin = 1 ··· 12 10 command! -bar PackUpdate call plugins#reload() | call packager#update() 13 11 command! -bar PackClean call plugins#reload() | call packager#clean() 14 12 command! -bar PackStatus call plugins#reload() | call packager#status() 15 - 16 - set runtimepath^=/usr/local/opt/fzf/ 17 13 " }}} 18 14 " Identation {{{ 19 15 set shiftwidth=4 expandtab ··· 34 30 set wildmode=full 35 31 " Colors {{{ 36 32 set termguicolors 37 - " set guicursor=n-v-c-sm:block,i-ci-ve:ver25,r-cr-o:hor20 33 + set guicursor=n-v-c-sm:block-Cursor,i-ci-ve:ver25-Cursor,r-cr-o:hor20-Cursor 38 34 colorscheme blame 39 35 " }}} 40 36 " Ignore all automatic files and folders {{{ ··· 68 64 " }}} 69 65 " }}} 70 66 " Diff options {{{ 71 - set diffopt-=internal 72 67 set diffopt+=indent-heuristic,algorithm:patience 73 68 " }}} 74 69 " Search {{{ ··· 84 79 " }}} 85 80 " Custom configurations {{{ 86 81 " Fuzzy file search {{{ 87 - nnoremap <Space><Space> :<C-u>FZF<CR> 82 + nnoremap <Space><Space> :<C-u>PickerEdit<CR> 83 + 84 + let g:picker_custom_find_executable = 'rg' 85 + let g:picker_custom_find_flags = '--color never --files --hidden --glob !.git' 88 86 89 87 set path=,, 90 88 " }}} ··· 93 91 nnoremap Up :<C-u>Gpush<CR> 94 92 nnoremap Us :<C-u>Gstatus<CR> 95 93 nnoremap Ud :<C-u>Gdiff<CR> 96 - nnoremap Ub :<C-u>MerginalToggle<CR> 97 - nnoremap UB :<C-u>Start tig blame %<CR> 94 + nnoremap UB :<C-u>Gblame<CR> 98 95 nnoremap Uc :<C-u>Gcommit<CR> 99 96 nnoremap Uu :<C-u>Gpull<CR> 100 97 nnoremap Ug :<C-u>Glog<CR> ··· 201 198 set complete=.,w,b,t,k,kspell 202 199 set completeopt=menuone,noselect,noinsert 203 200 201 + set tags^=./**/tags 202 + 204 203 let g:echodoc#enable_at_startup = v:true 205 204 let g:echodoc#type = 'virtual' 206 205 " }}} 207 206 208 - set sessionoptions-=help 207 + set sessionoptions=blank,buffers,curdir,folds,tabpages,winsize 209 208 210 209 if executable('direnv') 211 210 augroup autoreload_envrc ··· 214 213 augroup END 215 214 endif 216 215 216 + augroup hotfix 217 + autocmd! 218 + autocmd FocusGained * checktime 219 + autocmd CursorHold * checktime 220 + autocmd ColorScheme * highlight LspErrorHighlight gui=underline cterm=underline 221 + \ | highlight LspWarningHighlight gui=underline cterm=underline 222 + augroup END 217 223 " Needed for Projectionist and dadbod 218 224 command! -nargs=* Start <mods> split new <bar> call termopen(<q-args>) <bar> startinsert 219 225 command! -nargs=0 Ctags AsyncDo ctags -R 220 226 command! -nargs=? Dash call dash#open(<f-args>) 221 227 222 228 nnoremap gK :Dash<CR> 229 + nnoremap gx :<C-u>call open#open()<CR> 223 230 224 231 onoremap aG :<C-u>normal! ggVG<CR> 225 232
+16 -13
vim/.config/nvim/plugin/langclient.vim
··· 1 1 let g:lsp_log_file = expand('~/vim-lsp.log') 2 2 3 + func! s:set_colours(...) abort 4 + endfunc 5 + 3 6 func! s:setup_ls(...) abort 4 7 let l:servers = lsp#get_whitelisted_servers() 5 8 ··· 24 27 endfor 25 28 endfunc 26 29 30 + func! s:nix_shell(command, ...) abort 31 + let l:path = a:0 > 0 ? a:1 : a:command 32 + 33 + return {_->['nix-shell', '--show-trace', '-p', l:path, '--run', a:command]} 34 + endfunc 35 + 27 36 augroup LSC 28 37 autocmd! 29 38 autocmd User lsp_setup call lsp#register_server({ 30 39 \ 'name': 'ElixirLS', 31 - \ 'cmd': {_->[$HOME.'/.local/share/applications/lsp/language_server.sh']}, 40 + \ 'cmd': s:nix_shell('elixir-ls', 'elixirLS'), 32 41 \ 'whitelist': ['elixir', 'eelixir'] 33 42 \}) 34 43 autocmd User lsp_setup call lsp#register_server({ 44 + \ 'name': 'Sourcer', 45 + \ 'cmd': s:nix_shell('erlang_ls -t stdio --stdout', 'erlangSourcer'), 46 + \ 'whitelist': ['erlang'] 47 + \}) 48 + autocmd User lsp_setup call lsp#register_server({ 35 49 \ 'name': 'RLS', 36 - \ 'cmd': {_->['rls']}, 50 + \ 'cmd': s:nix_shell('rls'), 37 51 \ 'whitelist': ['rust'] 38 52 \}) 39 - autocmd User lsp_setup call lsp#register_server({ 40 - \ 'name': 'solargraph', 41 - \ 'cmd': {server_info->['solargraph', 'stdio']}, 42 - \ 'initialization_options': {"diagnostics": "true"}, 43 - \ 'whitelist': ['ruby'], 44 - \ }) 45 - autocmd User lsp_setup call lsp#register_server({ 46 - \ 'name': 'dot', 47 - \ 'cmd': {server_info->['dot-language-server', '--stdio']}, 48 - \ 'whitelist': ['dot'], 49 - \ }) 50 53 51 54 autocmd User lsp_server_init call <SID>setup_ls() 52 55 autocmd BufEnter * call <SID>setup_ls()
-27
vim/.config/nvim/plugin/manuclose.vim
··· 1 - if exists('g:loaded_manuclose') 2 - finish 3 - endif 4 - let g:loaded_manuclose = 1 5 - 6 - fun! s:manual_close() 7 - let cls = {} 8 - let opn = {} 9 - 10 - for [l:o, l:c] in map(split(&matchpairs, ','), 'split(v:val, ":")') 11 - let cls[l:o] = l:c 12 - let opn[l:c] = l:o 13 - endfor 14 - let stack = [] 15 - 16 - for c in split(getline('.'), '\zs') 17 - if match(join(keys(l:cls)) , c) > -1 18 - call insert(stack, c) 19 - elseif match(join(keys(l:opn)), c) > -1 20 - call remove(stack, index(stack, opn[c])) 21 - endif 22 - endfor 23 - 24 - return len(stack) ? cls[stack[0]] : '' 25 - endfun 26 - 27 - inoremap <expr> <C-]> <SID>manual_close()