Minimal vimrc file

This commit is contained in:
Mahesh Asolkar 2019-01-02 19:30:49 -08:00
commit 0b6ee42fc5

196
minimal.vimrc Normal file
View File

@ -0,0 +1,196 @@
"
" Vim customization and package management
"
" This uses Vundle for package management, so following (from Vundle README)
" must be run for rest of this vimrc to work:
"
" % mkdir -p ~/.vim/bundle
" % git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
"
" Then run the following to install plugins
"
" * Launch vim and run :PluginInstall
" * To install from command line: vim +PluginInstall +qall
" Base settings {{{
set nocompatible " be iMproved, required
filetype off " required
syntax on
set mouse=a
set mousehide
scriptencoding utf-8
let g:airline_powerline_fonts=1
let mapleader=","
let g:indent_guides_enable_on_vim_startup=1
" }}}
" Vundle setup - Preamble {{{
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
" }}}
" Vundle setup - Packages {{{
Plugin 'scrooloose/nerdtree'
Plugin 'tpope/vim-fugitive'
Plugin 'spf13/vim-colors'
Plugin 'tpope/vim-surround'
Plugin 'tpope/vim-repeat'
Plugin 'jiangmiao/auto-pairs'
Plugin 'terryma/vim-multiple-cursors'
Plugin 'vim-airline/vim-airline'
Plugin 'vim-airline/vim-airline-themes'
Plugin 'Shougo/denite.nvim'
Plugin 'pR0Ps/molokai-dark'
Plugin 'nathanaelkane/vim-indent-guides'
" }}}
" Vundle - Closing {{{
call vundle#end() " required
filetype plugin indent on " required
" }}}
" Customization {{{
" Base customization {{{
if has("gui_running")
set guifont=Iosevka:h13
set columns=120 lines=54
hi Search guifg=black guibg=yellow
hi Cursor guifg=white guibg=maroon
else
set background=dark
endif
colorscheme molokai-dark
set norelativenumber
set number
set visualbell t_vb=
set cindent
set noautoindent
set tabstop=2
set shiftwidth=2
set scrolloff=10
set expandtab
set showmatch
set cursorline
set mat=2
set showmode
set hlsearch
set incsearch
set wildmenu
set wildmode=list:longest,full " Command <Tab> completion, list matches, then longest common part, then all.
set backspace=indent,eol,start
set history=1024
set ruler
set hid
set viminfo='20,\"50
set backspace=2 whichwrap+=<,>,h,l
set cmdheight=2
set smartcase
set magic
set showmode
let g:spf13_no_autochdir=1
set backspace=indent,eol,start
set list
set listchars=tab:\ ,trail:•,extends:#,nbsp:. " Highlight problematic whitespace
" Directories {{{
set backup " backups are nice ...
set backupdir=$HOME/.vimbackup// " but not when they clog .
set directory=$HOME/.vimswap// " Same for swap files
set viewdir=$HOME/.vimviews// " same for view files
" Creating directories if they don't exist
silent execute '!mkdir -p $HOME/.vimbackup'
silent execute '!mkdir -p $HOME/.vimswap'
silent execute '!mkdir -p $HOME/.vimviews'
au BufWinLeave \* silent! mkview "make vim save view (state) (fds, cursor, etc)
au BufWinEnter \* silent! loadview "make vim load view (state) (fds, cursor, etc)
" }}}
" }}}
" Module customization {{{
if isdirectory(expand("~/.vim/bundle/nerdtree"))
map <C-e> <plug>NERDTreeTabsToggle<CR>
map <leader>e :NERDTreeFind<CR>
nmap <leader>nt :NERDTreeFind<CR>
let NERDTreeShowBookmarks=1
let NERDTreeIgnore=['\.py[cd]$', '\~$', '\.swo$', '\.swp$', '^\.git$', '^\.hg$', '^\.svn$', '\.bzr$']
let NERDTreeChDirMode=0
let NERDTreeQuitOnOpen=1
let NERDTreeMouseMode=2
let NERDTreeShowHidden=1
let NERDTreeKeepTreeInNewTab=1
let g:nerdtree_tabs_open_on_gui_startup=0
endif
let g:airline#extensions#tabline#enabled = 1
let g:airline_theme='molokai'
" }}}
" Key bindings {{{
map <C-e> :NERDTreeToggle<CR>
nnoremap <F5> :e<CR> G
nnoremap <F6> <C-W>w
nnoremap <S-F6> <C-W>W
nnoremap <C-F11> :confirm bd<CR>
nnoremap <F7> <C-w>o
nnoremap <S-F8> <C-w>s
nnoremap <F8> <C-w>v
nnoremap <F9> :Denite buffer<CR>
nnoremap <leader>b :Denite buffer<CR>
nnoremap <S-F10> :set wrap!<CR>
nnoremap <S-F1> :set spell!<CR>
nnoremap <C-N> :next<CR>
nnoremap <C-P> :prev<CR>
vnoremap <C-r> "hy/<C-r>h<cr>
nnoremap <C-Z> :bnext <CR>
if has("gui_running")
nnoremap <C-Space> za
else
nnoremap <Nul> za
end
" Reflow text
nnoremap Q gqap
" reflow visually highlighted lines with Q:
vnoremap Q gq
" Remove trailing spaces
nnoremap <C-S-F3> :%s/\s\+$//g<CR>:noh<CR>
" }}}
" }}}
" vim: foldenable foldmethod=marker