Cleanup vimrc, shift config in separate files
This commit is contained in:
parent
ec09654b44
commit
6421a095f1
5 changed files with 31 additions and 31 deletions
14
.vim/ale.vim
Normal file
14
.vim/ale.vim
Normal file
|
@ -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
|
3
.vim/nerdtree.vim
Normal file
3
.vim/nerdtree.vim
Normal file
|
@ -0,0 +1,3 @@
|
|||
let NERDTreeHighlightCursorLine=1
|
||||
let NERDTreeMouseMode=2
|
||||
let NERDTreeIgnore=['\.pyc$', '\.jp?g$', '\.gif$', '\.png$', '\~$', '\.o', '\.log', 'target']
|
5
.vim/rust.vim
Normal file
5
.vim/rust.vim
Normal file
|
@ -0,0 +1,5 @@
|
|||
autocmd FileType rust nmap gd <Plug>(rust-def)
|
||||
autocmd FileType rust nmap gs <Plug>(rust-def-split)
|
||||
autocmd FileType rust nmap gx <Plug>(rust-def-vertical)
|
||||
autocmd FileType rust nmap <leader>gd <Plug>(rust-doc)
|
||||
autocmd FileType rust set number
|
23
.vim/vimrc
23
.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 <Plug>(rust-def)
|
||||
autocmd FileType rust nmap gs <Plug>(rust-def-split)
|
||||
autocmd FileType rust nmap gx <Plug>(rust-def-vertical)
|
||||
autocmd FileType rust nmap <leader>gd <Plug>(rust-doc)
|
||||
autocmd FileType rust set number
|
||||
autocmd FileType html,yaml,css set softtabstop=2 shiftwidth=2
|
||||
|
||||
" Toggles on different plugins/modes
|
||||
noremap <F1> :ToggleMouse<CR>
|
||||
|
@ -72,6 +57,10 @@ nmap <leader>e :ALEDetail <cr>
|
|||
|
||||
" 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
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Add table
Reference in a new issue