diff --git a/.vim/.gitignore b/.vim/.gitignore new file mode 100644 index 0000000..a0e76af --- /dev/null +++ b/.vim/.gitignore @@ -0,0 +1 @@ +.netrwhist diff --git a/.vim/vimrc b/.vim/vimrc new file mode 100644 index 0000000..5adc4e3 --- /dev/null +++ b/.vim/vimrc @@ -0,0 +1,47 @@ +source ~/.vim/vundlerc.vim + +syntax on +filetype plugin indent on + +set omnifunc=syntaxcomplete#Complete + +" unset mouse +set mouse= + +" Default tab is 4 spaces +set tabstop=4 +set softtabstop=4 +set shiftwidth=4 +set expandtab + +" Highlight searches +set hlsearch +set showmatch + +" Use TAB to switch between buffers +noremap :bn +noremap :bp + +" Highlight trailing whitespace (darker red) +highlight WhitespaceEOL ctermbg=124* guibg=#ab0d0d +match WhitespaceEOL /\s\+\%#\@ :let _s=@/:%s/\s\+$//e:let @/=_s +autocmd FileType rst 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 + +" Toggles on different plugins/modes +noremap :ToggleMouse +inoremap :ToggleMousea +nmap :set nonumber! +nmap :NERDTreeToggle +set pastetoggle= + +" Enable vimrc files per project, e.g: ./project/.vimrc +set exrc + +" Disable unsafe commands in project vimrc +set secure diff --git a/.vim/vundlerc.vim b/.vim/vundlerc.vim new file mode 100644 index 0000000..0d52aab --- /dev/null +++ b/.vim/vundlerc.vim @@ -0,0 +1,32 @@ +" git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim +" :VundleInstall +" + +filetype off + +" set the runtime path to include Vundle and initialize +set rtp+=~/.vim/bundle/Vundle.vim +call vundle#begin() + +" let Vundle manage Vundle, required +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' +let g:scala_scaladoc_indent = 1 + +Plugin 'elmcast/elm-vim' +Plugin 'rust-lang/rust.vim' + +" Async Lint Engine +Plugin 'w0rp/ale' +let g:ale_linters = {'rust': ['rustc']} +let g:ale_completion_enabled = 1 + +call vundle#end()