Wednesday, November 4, 2015

My .vimrc file

I'm certainly no expert in vim or all the packages.  Here's what I have so far

vundle package manager
syntastic for syntax error flags
vim-airline for aesthetic bar and plugin integration
vim-commentary for easy comment/uncomment
vim-gitgutter to identify changes since last commit
YouCompleteMe for autocompletion (no longer bothering with it)

most of these can be installed by :PluginInstall inside vim
YouCompleteMe is a bit more indepth http://christopherpoole.github.io/setting-up-vim-with-YouCompleteMe/

vundle requires .vimrc edits to work

here is my .vimrc file

"""""""""""""""""""""""""""""
" Must Haves
"""""""""""""""""""""""""""""
filetype off

set nocompatible
set modelines=0
"""""""""""""""""""""""""""""
" Vundle
"""""""""""""""""""""""""""""
" set the runtime path to include vundle and initialize
set rtp+=~/.vim/bundle/vundle/
call vundle#begin()

" let vundle manage vundle, required
Plugin 'gmarik/vundle'

Plugin 'airblade/vim-gitgutter.git'
Plugin 'bling/vim-airline'
Plugin 'tpope/vim-commentary.git'
Plugin 'scrooloose/syntastic'
" Plugin 'Valloric/YouCompleteMe'

call vundle#end()

filetype plugin indent on

"""""""""""""""""""""""""""""
" Tabs
"""""""""""""""""""""""""""""
set tabstop=2
set shiftwidth=2
set softtabstop=2
set expandtab

"""""""""""""""""""""""""""""
" General Improvements
"""""""""""""""""""""""""""""
set t_Co=256
set encoding=utf-8
set scrolloff=3
set autoindent
set showmode
set showcmd
set hidden
set wildmenu
set wildmode=list:longest
set visualbell
set cursorline
set ttyfast
set ruler
set backspace=indent,eol,start
set laststatus=2
set relativenumber
set number
"set undofile

"""""""""""""""""""""""""""""
" Leader
"""""""""""""""""""""""""""""
let mapleader = ","

"""""""""""""""""""""""""""""
" Searching and Moving
"""""""""""""""""""""""""""""
set ignorecase
set smartcase
set gdefault
set incsearch
set showmatch
set hlsearch
nnoremap :noh
nnoremap %
vnoremap %

""""""""""""""""""""""""""""
" Long Lines
""""""""""""""""""""""""""""
set nowrap
" set textwidth=79
" set formatoptions=qrn1
" set colorcolumn=85

""""""""""""""""""""""""""""
" Invisible Characters (tabs, returns, etc.)
""""""""""""""""""""""""""""
" set list

""""""""""""""""""""""""""""
" Disable arrow keys
""""""""""""""""""""""""""""
" nnoremap
" nnoremap
" nnoremap
" nnoremap
" inoremap
" inoremap
" inoremap
" inoremap
" nnoremap j gj
" nnoremap k gk

"""""""""""""""""""""""""""
" Help Key Remap
"""""""""""""""""""""""""""
"inoremap
"nnoremap
"vnoremap

"""""""""""""""""""""""""""
" Save when not focus
"""""""""""""""""""""""""""
:au FocusLost * :wa
" set autowriteall

"""""""""""""""""""""""""""
" Fortran Free-form
"""""""""""""""""""""""""""
let fortran_free_source=1
let fortran_do_enddo=1

"""""""""""""""""""""""""""
" Automatically Close Delimiters
"""""""""""""""""""""""""""
" inoremap {     {}
inoremap { {}O
inoremap {{ {}
inoremap {} {}

" inoremap (     ()
inoremap ( ()O
inoremap (( ()
inoremap () ()

" inoremap [     []
inoremap [ []O
inoremap [[ []
inoremap [] []

" inoremap [ []O
inoremap '' ''
inoremap "" ""
" inoremap [] []

""""""""""""""""""""""""""""
" ColorSchemes
""""""""""""""""""""""""""""
set background=dark
colorscheme gruvbox

""""""""""""""""""""""""""""
" Enable Mouse
""""""""""""""""""""""""""""
set mouse=a

syntax on
""""""""""""""""""""""""""""
" Delete buffer without closing split
""""""""""""""""""""""""""""

let g:airline#extensions#tabline#enabled=1
" let g:airline_powerline_fonts=1


nmap ,d :b#bd#

:nnoremap :let _s=@/:%s/\s\+$//e:let @/=_s:nohl

No comments: