dotfiles

:)
git clone https://git.sr.ht/~ashymad/dotfiles
Log | Files | Refs | Submodules | LICENSE

commit 5504141abdd2bc4da8141df771fa3f79b088cf9b
parent 8de0cd3947fea45c9be1b46c84faa96060b3fb80
Author: Szymon Mikulicz <szymon.mikulicz@posteo.net>
Date:   Tue, 17 Mar 2020 22:17:46 +0100

nvim: use nvim-lsp feature instead of vim-lsc

Diffstat:
Mnvim/.config/nvim/ginit.vim | 2+-
Mnvim/.config/nvim/init.vim | 110+++++++++++++++++++++++++++----------------------------------------------------
2 files changed, 38 insertions(+), 74 deletions(-)

diff --git a/nvim/.config/nvim/ginit.vim b/nvim/.config/nvim/ginit.vim @@ -1,5 +1,5 @@ if exists('g:GtkGuiLoaded') call rpcnotify(1, 'Gui', 'Font', 'Fira Code 13') elseif exists('g:GuiLoaded') - Guifont Fira Code:h13 + Guifont Fira Mono:h10 endif diff --git a/nvim/.config/nvim/init.vim b/nvim/.config/nvim/init.vim @@ -22,13 +22,12 @@ Plug 'Vimjas/vim-python-pep8-indent' Plug 'JuliaEditorSupport/julia-vim' Plug 'lervag/vimtex' +Plug 'PietroPate/vim-tex-conceal' Plug 'rust-lang/rust.vim' Plug 'dag/vim-fish' -Plug 'OmniSharp/omnisharp-vim' - Plug 'jalvesaq/Nvim-R' Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' } @@ -36,34 +35,17 @@ Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' } Plug 'Shougo/neosnippet.vim' Plug 'Shougo/neosnippet-snippets' -Plug 'natebosch/vim-lsc' - Plug 'paretje/deoplete-notmuch', {'for': 'mail'} Plug 'tpope/vim-fugitive' Plug 'chaoren/vim-wordmotion' -Plug 'vimwiki/vimwiki', { 'branch': 'dev' } - -call plug#end() +Plug 'neovim/nvim-lsp' -" Deoplete -inoremap <expr><C-h> deoplete#smart_close_popup()."\<C-h>" -inoremap <expr><BS> deoplete#smart_close_popup()."\<C-h>" +Plug 'Shougo/deoplete-lsp' -function! s:check_back_space() abort "{{{ - let col = col('.') - 1 - return !col || getline('.')[col - 1] =~ '\s' -endfunction"}}} -imap <silent><expr> <TAB> - \ pumvisible() ? "\<C-n>" : - \ <SID>check_back_space() ? "\<TAB>" : - \ neosnippet#expandable_or_jumpable() ? - \ "\<Plug>(neosnippet_expand_or_jump)" : - \ deoplete#manual_complete() - -let g:deoplete#enable_at_startup = 1 +call plug#end() " Neosnipet " Note: It must be "imap" and "smap". It uses <Plug> mappings. @@ -73,7 +55,8 @@ xmap <C-j> <Plug>(neosnippet_expand_target) " For conceal markers. if has('conceal') - set conceallevel=2 concealcursor=niv + set conceallevel=2 + let g:tex_conceal="abdgms" endif " lightline @@ -84,63 +67,42 @@ let g:lightline = { " vimtex let g:vimtex_view_method = 'zathura' let g:vimtex_compiler_progname = 'nvr' +let g:vimtex_quickfix_enabled = 0 -if !exists('g:deoplete#omni#input_patterns') - let g:deoplete#omni#input_patterns = {} -endif -let g:deoplete#omni#input_patterns.tex = g:vimtex#re#deoplete - -" eclim -let g:EclimCompletionMethod = 'omnifunc' -let g:deoplete#omni#input_patterns.java = '[^. *\t]\.\w*' +" nvim-lsp +lua require'nvim_lsp'.rust_analyzer.setup{} +lua require'nvim_lsp'.texlab.setup{} - -" Nvim-R -call deoplete#custom#option('omni_patterns', { - \ 'r': ['[^. *\t]\.\w*', '\h\w*::\w*', '\h\w*\$\w*'], - \}) - -" let R_latexcmd = ['latexmk','-pdf','-pdflatex="lualatex -synctex=1 -interaction=nonstopmode"'] - -" OmniSharp -call deoplete#custom#option('sources', { - \ 'cs': ['omnisharp'], - \ }) +autocmd Filetype rust setlocal omnifunc=v:lua.vim.lsp.omnifunc "NERDTree map <C-k> :NERDTreeToggle<CR> -" vim-lsc - -let g:lsc_server_commands = { - \ 'javascript': ['javascript-typescript-stdio'], - \ 'javascript.jsx': ['javascript-typescript-stdio'], - \ 'python': ['pyls'], - \ 'julia': ['julia', '--startup-file=no', '--history-file=no', '-e', ' - \ using LanguageServer; - \ using Pkg; - \ import StaticLint; - \ import SymbolServer; - \ env_path = dirname(Pkg.Types.Context().env.project_file); - \ debug = false; - \ - \ server = LanguageServer.LanguageServerInstance(stdin, stdout, debug, env_path, "", Dict()); - \ server.runlinter = true; - \ run(server); - \ '], - \ 'c': ['ccls', '--log-file=/tmp/cc.log'], - \ 'cpp': ['ccls', '--log-file=/tmp/cc.log'], - \ 'cuda': ['ccls', '--log-file=/tmp/cc.log'], - \ 'objc': ['ccls', '--log-file=/tmp/cc.log'], - \ 'rust': ['rls'], - \ } +" Deoplete +inoremap <expr><C-h> deoplete#smart_close_popup()."\<C-h>" +inoremap <expr><BS> deoplete#smart_close_popup()."\<C-h>" + +function! s:check_back_space() abort "{{{ + let col = col('.') - 1 + return !col || getline('.')[col - 1] =~ '\s' +endfunction"}}} +imap <silent><expr> <TAB> + \ pumvisible() ? "\<C-n>" : + \ <SID>check_back_space() ? "\<TAB>" : + \ neosnippet#expandable_or_jumpable() ? + \ "\<Plug>(neosnippet_expand_or_jump)" : + \ deoplete#manual_complete() -let g:lsc_auto_map = v:true -autocmd CompleteDone * silent! pclose +call deoplete#custom#option('omni_patterns', { + \ 'tex': g:vimtex#re#deoplete, + \ 'r': ['[^. *\t]\.\w*', '\h\w*::\w*', '\h\w*\$\w*'], + \}) + +call deoplete#custom#option('sources', { + \ 'notmuch': ['notmuch', 'address', '--format=json', '--deduplicate=address', '*'], + \}) -" vimwiki -" Workaround for https://github.com/lervag/vimtex/issues/1354 -let g:vimtex_syntax_enabled = 1 +let g:deoplete#enable_at_startup = 1 " vim settings @@ -179,5 +141,7 @@ function SetTeXOptions() setlocal sw=2 setlocal textwidth=79 setlocal iskeyword+=: - setlocal spell! spelllang=pl + setlocal spell! spelllang=en endfunction + +autocmd BufNewFile,BufRead *.none set filetype=mail