yet another beauitful vimrc file
" Turn on syntax highlighting
syntax on
" No need for compatible mode
set nocompatible
colorscheme colorful256
set showmatch
set ignorecase
set showmode
set ts=4 sw=4 et
set fdm=syntax
filetype plugin indent on
set backspace=2
" automatically source changes to vimrc when the file is written.
let g:snips_author='Afsheen Bigdeli'
let g:author='Afsheen Bigdeli'
let g:snips_email='afsheenb@namecast.net'
let g:email='afsheenb@namecast.net'
let g:snips_github='https://github.com/afsheenb'
let g:github='https://github.com/afsheenb'
" this means you can test changes immediately.
autocmd! bufwritepost .vimrc source %
se t_Co=256
se background=dark
highlight clear SignColumn
nnoremap zr zR
nnoremap ZS :w<CR>
nnoremap ZX :qa<CR>
let g:bufferline_echo = 1
let g:sneak#streak = 1
set hidden
vnoremap . :norm.<CR>
au Filetype,BufRead,BufNewFile *.pp set filetype=puppet
au Filetype,BufRead,BufNewFile *.ncd set filetype=json
au Filetype,BufRead,BufNewFile *.service set filetype=systemd
let MRU_Exclude_Files = '^/tmp'
let g:startify_session_persistence = 1
" autocmd FileType ruby,eruby set filetype=ruby.eruby.chef
let mapleader=","
let g:yankring_history_dir='/home/afsheenb/.vim/'
set undodir=/home/afsheenb/.vim/undodir/
set undofile
" lazy git commit
nmap <leader>gc :Gcommit<CR>
" lazy git checkout
nmap <leader>gr :Gread<CR>
" lazy git write (add in a work tree, checkout if not)
nmap <leader>gw :Gwrite<CR>
hi link SneakPluginTarget DiffChange
hi clear Folded
hi clear FoldColumn
hi link Folded LineNr
hi link FoldColumn LineNr
hi link SneakStreakTarget DiffChange
hi link SneakStreakMask DiffChange
hi link SneakPluginScope Comment
hi clear Search
hi link Search User1
let CursorColumnI = 0 "the cursor column position in INSERT
autocmd InsertEnter * let CursorColumnI = col('.')
autocmd CursorMovedI * let CursorColumnI = col('.')
autocmd InsertLeave * if col('.') != CursorColumnI | call cursor(0, col('.')+1) | endif
nnoremap <Left> :bprev<CR>
nnoremap <Right> :bnext<CR>
nnoremap <Up> :buffers<CR>:buffer<SPACE>
nnoremap <Down> <C-^>
set wildignore+=*/Downloads
let g:netrw_scp_cmd = 'scp -q -F /home/afsheenb/.ssh/config'
ino <Leader>w <Esc>:w!<CR>
nmap <Leader>w <Esc>:w!<CR>
nmap <Leader>q <Esc>:q!<CR>
cmap w!! w !sudo tee > /dev/null %
nnoremap ; :
nmap <leader>r :MRU<CR>
nmap <leader>m <c-f>
nmap <leader>b <c-u>
map <leader>k <Plug>Howdoi
nmap <leader>c gcc
nnoremap <leader>u :GundoToggle<CR>
nnoremap <leader>yr :YRShow<CR>
" Copy to X CLIPBOARD
" map <leader>xc :w !xsel -i -b<CR>
" map <leader>xp :w !xsel -i -p<CR>
" map <leader>xs :w !xsel -i -s<CR>
" " Paste from X CLIPBOARD
map <leader>pp :r!xsel -p<CR>
map <leader>ps :r!xsel -s<CR>
map <leader>pb :r!xsel -b<CR>
highlight StatusLine ctermfg=grey ctermbg=darkblue cterm=NONE
highlight StatusLineNC ctermfg=grey ctermbg=darkblue cterm=NONE
set encoding=utf-8
map <leader>pt :set paste<CR>
map <leader>pn :set nopaste<CR>
map <leader>x :bd!<CR>
map <leader>n :NERDTreeToggle<CR>
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") && b:NERDTreeType == "primary") | q | endif
let get_vundle=1
let vundle_readme=expand('~/.vim/bundle/vundle/README.md')
if !filereadable(vundle_readme)
echo "Installing Vundle.."
echo ""
silent !mkdir -p ~/.vim/bundle
silent !git clone https://github.com/gmarik/vundle ~/.vim/bundle/vundle
let get_vundle=0
endif
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
if has('statusline')
set laststatus=2
set statusline=%<%f\ " Filename
set statusline+=%w%h%m%r " Options
set statusline+=%{fugitive#statusline()} " Git Hotness
set statusline+=\ [%{&ff}/%Y] " filetype
set statusline+=\ [%{getcwd()}] " current dir
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
let g:syntastic_enable_signs=1
set statusline+=%=%-14.(%l,%c%V%)\ %p%% " Right aligned file nav info
endif
set hlsearch
set autoindent
set smartindent
set number
set ttyfast
set noswapfile
set undofile
set nobackup
set nowritebackup
set laststatus=2
set enc=utf-8
set fencs=utf-8
set visualbell t_vb=
set history=1000
set undolevels=1000
let g:gundo_preview_bottom = 1
let g:gundo_close_on_revert= 1
let g:indent_guides_start_level = 1
let g:indent_guides_guide_size = 2
"hi IndentGuidesOdd ctermbg=red
"hi IndentGuidesEven ctermbg=yellow
let g:syntastic_php_checkers=['php']
let g:seek_subst_disable = 1
let g:ycm_autoclose_preview_window_after_completion = 1
let g:ycm_autoclose_preview_window_after_insertion = 1
let g:gitgutter_sign_added = '++'
let g:gitgutter_sign_modified = '~~'
let g:gitgutter_sign_removed = 'xx'
let g:gitgutter_sign_modified_removed = 'mr'
if ! has('gui_running')
set ttimeoutlen=10
augroup FastEscape
autocmd!
au InsertEnter * set timeoutlen=0
au InsertLeave * set timeoutlen=1000
augroup END
endif
" let sneak plugin replace easymotion
" s and then two chars in normal mode, takes a count or s again for next
" let g:sneak#streak = 1
let g:sneak#s_next = 0
fun! DelBlank()
let _s=@/
let l = line(".")
let c = col(".")
:g/^$/d
:%le
let @/=_s
call cursor(l, c)
endfun
map <special> <leader>d :keepjumps call DelBlank()<cr>
Bundle 'gmarik/vundle'
" original repos on github
Bundle 'mhinz/vim-startify'
Bundle 'myusuf3/numbers.vim'
Bundle 'gcmt/wildfire.vim'
" Handles relative and absolute line number toggling between insert and normal
Bundle 'bling/vim-bufferline'
" Show buffers in statusline
Bundle 'tpope/vim-fugitive'
"git integration - ,gc to commit ,gw to write
Bundle 'tpope/vim-commentary'
",c to comment and uncomment lines, takes a count
Bundle 'justinmk/vim-sneak'
Bundle 'Lokaltog/powerline'
Bundle 'rstacruz/sparkup', {'rtp': 'vim/'}
Bundle 'tpope/vim-rails.git'
Bundle 'MarcWeber/vim-addon-mw-utils'
Bundle 'tomtom/tlib_vim'
Bundle 'tommcdo/vim-lion'
Bundle 'mileszs/ack.vim'
Bundle 'airblade/vim-gitgutter'
Bundle 'tpope/vim-surround'
Bundle 'edsono/vim-matchit'
" Bundle "vadv/vim-chef"
Bundle "saltstack/salt-vim"
Bundle 'vim-scripts/mru.vim'
Bundle 'vim-scripts/netrw.vim'
Bundle 'vim-scripts/headers.vim'
Bundle 't9md/vim-chef.git'
Bundle 'SirVer/ultisnips'
Bundle 'Valloric/YouCompleteMe'
Bundle 'puppetlabs/puppet-syntax-vim.git'
Bundle 'kurayama/systemd-vim-syntax'
Bundle 'rodjek/vim-puppet'
Bundle 'ervandew/supertab'
Bundle 'kshenoy/vim-signature'
Bundle 'vim-scripts/sessionman.vim'
Bundle 'vim-scripts/repmo.vim'
Bundle 'vim-scripts/YankRing.vim'
Bundle 'nathanaelkane/vim-indent-guides'
" Bundle 'Shougo/neocomplcache'
Bundle 'flazz/vim-colorschemes'
Bundle 'laurentgoudet/vim-howdoi'
Bundle 'scrooloose/syntastic'
" Bundle 'Townk/vim-autoclose'
Bundle 'Raimondi/delimitMate'
Bundle 'scrooloose/nerdtree'
Bundle 'sjl/gundo.vim'
" Bundle 'garbas/vim-snipmate'
Bundle 'SirVer/vim-snippets'
" Bundle 'spf13/snipmate-snippets'
Bundle 'elzr/vim-json'
Bundle 'wellle/targets.vim'
" Source support_function.vim to support snipmate-snippets.
" source $HOME/.vim/bundle/snipmate-snippets/snippets/support_functions.vim"
" Bundle 'godlygeek/tabular'
if get_vundle == 0
echo "Installing Bundles, please ignore key map error messages"
echo ""
:BundleInstall
endif
function! g:UltiSnips_Complete()
call UltiSnips#ExpandSnippet()
if g:ulti_expand_res == 0
if pumvisible()
return "\<C-n>"
else
call UltiSnips#JumpForwards()
if g:ulti_jump_forwards_res == 0
return "\<TAB>"
endif
endif
endif
return ""
endfunction
au BufEnter * exec "inoremap <silent> " . g:UltiSnipsExpandTrigger . " <C-R>=g:UltiSnips_Complete()<cr>"
let g:UltiSnipsJumpForwardTrigger="<tab>"
augroup templates
au!
" read in templates files
autocmd BufNewFile *.* silent! execute '0r /home/afsheenb/.vim/templates/skeleton.'.expand("<afile>:e")
augroup END