From 6421a095f120a3588a40e8831f649458f5ab4ed0 Mon Sep 17 00:00:00 2001 From: Vladan Popovic Date: Sun, 25 Aug 2019 18:59:39 +0200 Subject: [PATCH] Cleanup vimrc, shift config in separate files --- .vim/ale.vim | 14 ++++++++++++++ .vim/nerdtree.vim | 3 +++ .vim/rust.vim | 5 +++++ .vim/vimrc | 25 +++++++------------------ .vim/vundlerc.vim | 15 ++------------- 5 files changed, 31 insertions(+), 31 deletions(-) create mode 100644 .vim/ale.vim create mode 100644 .vim/nerdtree.vim create mode 100644 .vim/rust.vim diff --git a/.vim/ale.vim b/.vim/ale.vim new file mode 100644 index 0000000..5a3c1e2 --- /dev/null +++ b/.vim/ale.vim @@ -0,0 +1,14 @@ +let g:ale_linters = {} +let g:ale_completion_enabled = 1 +let g:ale_sign_error = "✗" +let g:ale_sign_warning = "⚠" + +" Rust linting options +let g:ale_rust_cargo_use_clippy = 1 " installed with `rustup component add clippy-preview` +let g:rustfmt_autosave = 1 " installed with `rustup component add rustfmt` + +" ALE colors +highlight ALEWarning ctermbg=Yellow +highlight ALEWarning ctermfg=Black +highlight ALEError ctermbg=DarkRed +highlight ALEError ctermfg=White diff --git a/.vim/nerdtree.vim b/.vim/nerdtree.vim new file mode 100644 index 0000000..7310490 --- /dev/null +++ b/.vim/nerdtree.vim @@ -0,0 +1,3 @@ +let NERDTreeHighlightCursorLine=1 +let NERDTreeMouseMode=2 +let NERDTreeIgnore=['\.pyc$', '\.jp?g$', '\.gif$', '\.png$', '\~$', '\.o', '\.log', 'target'] diff --git a/.vim/rust.vim b/.vim/rust.vim new file mode 100644 index 0000000..528fda7 --- /dev/null +++ b/.vim/rust.vim @@ -0,0 +1,5 @@ +autocmd FileType rust nmap gd (rust-def) +autocmd FileType rust nmap gs (rust-def-split) +autocmd FileType rust nmap gx (rust-def-vertical) +autocmd FileType rust nmap gd (rust-doc) +autocmd FileType rust set number diff --git a/.vim/vimrc b/.vim/vimrc index 7911703..5ab9988 100644 --- a/.vim/vimrc +++ b/.vim/vimrc @@ -2,7 +2,6 @@ source ~/.vim/vundlerc.vim syntax on filetype plugin indent on - set omnifunc=syntaxcomplete#Complete " unset mouse @@ -44,23 +43,9 @@ highlight LineNr ctermbg=232 highlight Folded ctermbg=DarkGreen highlight Folded ctermfg=Black -" ALE colors -highlight ALEWarning ctermbg=Yellow -highlight ALEWarning ctermfg=Black -highlight ALEError ctermbg=DarkRed -highlight ALEError ctermfg=White - " Language indents and line lengths -autocmd FileType py,rst,md set textwidth=79 -autocmd FileType html set softtabstop=2 shiftwidth=2 omnifunc=htmlcomplete#CompleteTags -autocmd FileType yaml set softtabstop=2 shiftwidth=2 -autocmd FileType css set softtabstop=2 shiftwidth=2 omnifunc=csscomplete#CompleteCSS - -autocmd FileType rust nmap gd (rust-def) -autocmd FileType rust nmap gs (rust-def-split) -autocmd FileType rust nmap gx (rust-def-vertical) -autocmd FileType rust nmap gd (rust-doc) -autocmd FileType rust set number +autocmd FileType py,rst,md set textwidth=79 +autocmd FileType html,yaml,css set softtabstop=2 shiftwidth=2 " Toggles on different plugins/modes noremap :ToggleMouse @@ -72,6 +57,10 @@ nmap e :ALEDetail " Enable vimrc files per project, e.g: ./project/.vimrc set exrc - " Disable unsafe commands in project vimrc set secure + +" Plugin/language configuration +source ~/.vim/rust.vim +source ~/.vim/ale.vim +source ~/.vim/nerdtree.vim diff --git a/.vim/vundlerc.vim b/.vim/vundlerc.vim index 09c12d0..a3aba1a 100644 --- a/.vim/vundlerc.vim +++ b/.vim/vundlerc.vim @@ -13,9 +13,6 @@ Plugin 'VundleVim/Vundle.vim' " NERDTree config Plugin 'scrooloose/nerdtree' -let NERDTreeHighlightCursorLine=1 -let NERDTreeMouseMode=2 -let NERDTreeIgnore=['\.pyc$', '\.jp?g$', '\.gif$', '\.png$', '\~$', '\.o', '\.log'] " Scala config Plugin 'derekwyatt/vim-scala' @@ -23,18 +20,10 @@ let g:scala_scaladoc_indent = 1 Plugin 'elmcast/elm-vim' Plugin 'rust-lang/rust.vim' -Plugin 'racer-rust/vim-racer' -Plugin 'Rykka/riv.vim' +Plugin 'racer-rust/vim-racer' " Rust Language Server +Plugin 'Rykka/riv.vim' " rst formatter and highlighter " Async Lint Engine Plugin 'w0rp/ale' -let g:ale_linters = {} -let g:ale_completion_enabled = 1 -let g:ale_sign_error = "✗" -let g:ale_sign_warning = "⚠" -" -" Rust linting options -let g:ale_rust_cargo_use_clippy = 1 " installed with `rustup component add clippy-preview` -let g:rustfmt_autosave = 1 " installed with `rustup component add rustfmt` call vundle#end()