diff options
| -rw-r--r-- | .vimrc | 74 |
1 files changed, 19 insertions, 55 deletions
@@ -16,14 +16,10 @@ Plug 'tpope/vim-eunuch' " Easy UNIX shell commands Plug 'alvan/vim-closetag' " Automatically add HTML closing tags Plug 'kien/tabman.vim' " Show open buffers + Plug 'ervandew/supertab' " Makes <Tab> be nicer to use with Omnicompletion """ Software development - Plug 'prabirshrestha/vim-lsp' " LSP servers in Vim - Plug 'prabirshrestha/asyncomplete.vim' " Autocompletion from LSP server - Plug 'prabirshrestha/asyncomplete-lsp.vim' " Integration with vim-lsp - Plug 'prabirshrestha/asyncomplete-file.vim' " File path autocompletion - Plug 'htlsne/asyncomplete-look' " Word (dictionary) autocompletion (via look and words linux packages) - Plug 'mattn/vim-lsp-settings' " Automatic LSP server configuration + Plug 'dense-analysis/ale' " Linting with LSP Plug 'honza/vim-snippets' " Ready snippets for some languages Plug 'editorconfig/editorconfig-vim' " Support for EditorConfig Plug 'zivyangll/git-blame.vim' " Show who last edited a line @@ -32,6 +28,7 @@ """ Language integration Plug 'dNitro/vim-pug-complete', { 'for': ['jade', 'pug'] } " Pug: Omnicompletion integration Plug 'digitaltoad/vim-pug' " Pug: Filetype detection, identation, syntax highlighting + Plug 'bfrg/vim-cpp-modern' " C/C++: Better syntax highlighting call plug#end() " }}} @@ -83,13 +80,14 @@ " Folding {{{ filetype plugin indent on - syntax on - autocmd FileType vim,text,sh,zsh setlocal foldmethod=marker + syntax on " Syntax highlighting + autocmd FileType * set foldmethod=syntax " Syntax folding for all + autocmd FileType vim,text,sh,zsh,xdefaults setlocal foldmethod=marker " Overrides folding to marker for types set foldlevel=99 " Open all folds by default - autocmd FileType vim,sh,zsh setlocal foldlevel=0 + autocmd FileType vim,sh,zsh,xdefaults setlocal foldlevel=0 " Close all folds by defualt on filetypes - set foldtext=MyFoldText() + set foldtext=MyFoldText() " Custom text for a fold function MyFoldText() let line = substitute(getline(v:foldstart), "\t", repeat(" ", shiftwidth(0)), "") " Gets the first fold line and replace tabs with spaces (as many as shiftwidth is set to) let linecount = v:foldend - v:foldstart " Calculates amount of folded lines @@ -98,7 +96,7 @@ endfunction " }}} - " Bindings {{{ + " Mappings {{{ " Don't get into insert mode after adding a line with o/O nnoremap o o<Esc> nnoremap O O<Esc> @@ -340,50 +338,16 @@ " }}} " }}} -" asyncomplete {{{ - " General {{{ - inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>" - inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>" - " inoremap <expr> <cr> pumvisible() ? asyncomplete#close_popup() : "\<cr>" - imap <c-space> <Plug>(asyncomplete_force_refresh) +" ALE {{{ + map <F2> <ESC>:ALERename<CR> + map gd <ESC>:ALEGoToDefinition<CR> + map gi <ESC>:ALEHover<CR> - " allow modifying the completeopt variable, or it will - " be overridden all the time - let g:asyncomplete_auto_completeopt = 0 - - set completeopt=menuone,noinsert,noselect,preview - - autocmd! CompleteDone * if pumvisible() == 0 | pclose | endif - " }}} - - " Registering {{{ - au User asyncomplete_setup call asyncomplete#register_source(asyncomplete#sources#file#get_source_options({ - \ 'name': 'file', - \ 'allowlist': ['*'], - \ 'priority': 10, - \ 'completor': function('asyncomplete#sources#file#completor') - \ })) - au User asyncomplete_setup call asyncomplete#register_source({ - \ 'name': 'look', - \ 'allowlist': ['text', 'markdown'], - \ 'completor': function('asyncomplete#sources#look#completor'), - \ }) - " }}} -" }}} - -" vim-lsp {{{ - let g:lsp_diagnostics_echo_cursor = 1 - let g:lsp_diagnostics_float_cursor = 1 - let g:lsp_diagnostics_signs_error = {'text': ' '} - let g:lsp_diagnostics_signs_warning = {'text': ' '} - let g:lsp_diagnostics_signs_hint = {'text': ' '} - let g:lsp_document_code_action_signs_hint = {'text': ' '} + let g:ale_completion_enabled = 1 + set omnifunc=ale#completion#OmniFunc - let g:lsp_semantic_enabled = 1 - let g:lsp_format_sync_timeout = 1000 - let g:lsp_document_did_save_delay = 1000 -" }}} - -" vim-lsp-settings {{{ - let g:lsp_settings_enable_suggestions = 0 + let g:ale_floating_preview = 1 " Use floating window + let g:ale_floating_window_border = ['│', '─', '╭', '╮', '╯', '╰'] " Nicer borders + + let g:ale_typescript_tsserver_use_global = 1 " Use global tsserver package " }}} |
