Skip to content

Instantly share code, notes, and snippets.

@jeffiar
Last active May 5, 2018 18:54
Show Gist options
  • Save jeffiar/087fa76f3c91f260c257 to your computer and use it in GitHub Desktop.
Save jeffiar/087fa76f3c91f260c257 to your computer and use it in GitHub Desktop.
my vimrc
" VUNDLE SETTINGS =========================================
" -easy packaging of plugins
"------------------------------------------------------------
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'gmarik/Vundle.vim' " itself
Plugin 'tomtom/tlib_vim' " dependency for other plugins
Plugin 'scrooloose/nerdcommenter' " commenting with <leader>c
Plugin 'Raimondi/delimitMate' " automatic () completion
Plugin 'godlygeek/tabular' " aligning things
Plugin 'kien/ctrlp.vim'
Plugin 'dkprice/vim-easygrep'
Plugin 'tpope/vim-fugitive'
call vundle#end()
" ------------------------------------------------------------
" END VUNDLE SETTINGS ========================================
filetype plugin indent on
syntax on
" Basic settings
set backspace=indent,eol,start " intuitive backspacing
set history=999 " more is better
set mouse=a " use mouse
set incsearch " incremental searching
set hlsearch " highlight searches
set wildmode=list:full
set noswapfile
set nohlsearch
"visual settings
set laststatus=2
set lazyredraw " no redraw during macros
set cindent tabstop=4 softtabstop=4 expandtab shiftwidth=4 nu
set guioptions-=T " No toolbar for gui
set ruler " show the cursor position all the time
set showcmd " display incomplete commands
set shortmess+=rm " shorter display messages
set nowarn " no [file not changed] shit
set noequalalways " window size doesn't change
set relativenumber " easier to go to a line
" Start at last place where read file
autocmd BufReadPost *
\ if line("'\"") > 1 && line("'\"") <= line("$") |
\ exe "normal! g`\"" |
\ endif
" -----------------------------------------------------------
" colorscheme
color darkblue
set background=dark
if has("gui_running")
set guioptions=ce
endif
" KEY MAPPINGS AND PLUGIN SETTINGS===========================
"------------------------------------------------------------
inoremap kj <ESC>
cnoremap kj <ESC>
nmap j gj
nmap k gk
nmap H ^
nmap L $
nnoremap Q @q
nmap Y y$
nnoremap <C-j> <C-w>j
nnoremap <C-h> <C-w>h
nnoremap <C-k> <C-w>k
nnoremap <C-l> <C-w>l
nnoremap <C-e> :b#<cr>
vnoremap . :normal .<CR>
" leader mappings
let mapleader=","
nnoremap <space> :
nnoremap <leader>w :w<cr>
nnoremap <leader>ef :e<cr>
nnoremap <leader>q :q<cr>
nnoremap <leader>, :set hlsearch!<cr>
nnoremap <leader>ev :e $MYVIMRC<cr>
nnoremap <leader>sv :so $MYVIMRC<cr>
nnoremap <leader>s. :so %<cr>
nnoremap <leader>ya mxggVG"+y'x
nnoremap <Leader>p "+p
vnoremap <Leader>p "+p
vnoremap <Leader>y "+y
nnoremap <Leader>f [{$zf%
nnoremap <Leader>a ggVG
nnoremap <leader>] :bp<cr>
nnoremap <leader>[ :bn<cr>
" Delimitmate settings
let delimitMate_expand_cr = 1
" NERDCommenter settings
let g:NERDCreateDefaultMappings = 0
let g:NERDSpaceDelims = 1
nmap <Leader>c <plug>NERDCommenterToggle
vmap <Leader>c <plug>NERDCommenterToggle
" Tabularize
nmap <Leader>l :Tab/
vmap <Leader>l :Tab/
let g:ctrlp_cmd='CtrlPMRU'
" ------------------------------------------------------------
" END KEY MAPPINGS ===========================================
"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment