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
|
syntax on
|
||||||
filetype plugin indent on
|
filetype plugin indent on
|
||||||
|
|
||||||
set omnifunc=syntaxcomplete#Complete
|
set omnifunc=syntaxcomplete#Complete
|
||||||
|
|
||||||
" unset mouse
|
" unset mouse
|
||||||
|
@ -44,23 +43,9 @@ highlight LineNr ctermbg=232
|
||||||
highlight Folded ctermbg=DarkGreen
|
highlight Folded ctermbg=DarkGreen
|
||||||
highlight Folded ctermfg=Black
|
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
|
" Language indents and line lengths
|
||||||
autocmd FileType py,rst,md set textwidth=79
|
autocmd FileType py,rst,md set textwidth=79
|
||||||
autocmd FileType html set softtabstop=2 shiftwidth=2 omnifunc=htmlcomplete#CompleteTags
|
autocmd FileType html,yaml,css set softtabstop=2 shiftwidth=2
|
||||||
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
|
|
||||||
|
|
||||||
" Toggles on different plugins/modes
|
" Toggles on different plugins/modes
|
||||||
noremap <F1> :ToggleMouse<CR>
|
noremap <F1> :ToggleMouse<CR>
|
||||||
|
@ -72,6 +57,10 @@ nmap <leader>e :ALEDetail <cr>
|
||||||
|
|
||||||
" Enable vimrc files per project, e.g: ./project/.vimrc
|
" Enable vimrc files per project, e.g: ./project/.vimrc
|
||||||
set exrc
|
set exrc
|
||||||
|
|
||||||
" Disable unsafe commands in project vimrc
|
" Disable unsafe commands in project vimrc
|
||||||
set secure
|
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
|
" NERDTree config
|
||||||
Plugin 'scrooloose/nerdtree'
|
Plugin 'scrooloose/nerdtree'
|
||||||
let NERDTreeHighlightCursorLine=1
|
|
||||||
let NERDTreeMouseMode=2
|
|
||||||
let NERDTreeIgnore=['\.pyc$', '\.jp?g$', '\.gif$', '\.png$', '\~$', '\.o', '\.log']
|
|
||||||
|
|
||||||
" Scala config
|
" Scala config
|
||||||
Plugin 'derekwyatt/vim-scala'
|
Plugin 'derekwyatt/vim-scala'
|
||||||
|
@ -23,18 +20,10 @@ let g:scala_scaladoc_indent = 1
|
||||||
|
|
||||||
Plugin 'elmcast/elm-vim'
|
Plugin 'elmcast/elm-vim'
|
||||||
Plugin 'rust-lang/rust.vim'
|
Plugin 'rust-lang/rust.vim'
|
||||||
Plugin 'racer-rust/vim-racer'
|
Plugin 'racer-rust/vim-racer' " Rust Language Server
|
||||||
Plugin 'Rykka/riv.vim'
|
Plugin 'Rykka/riv.vim' " rst formatter and highlighter
|
||||||
|
|
||||||
" Async Lint Engine
|
" Async Lint Engine
|
||||||
Plugin 'w0rp/ale'
|
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()
|
call vundle#end()
|
||||||
|
|
Loading…
Add table
Reference in a new issue