Skip to content

Instantly share code, notes, and snippets.

@pbarker
Last active August 29, 2015 14:08
Show Gist options
  • Save pbarker/04e61e015ae200cf8de2 to your computer and use it in GitHub Desktop.
Save pbarker/04e61e015ae200cf8de2 to your computer and use it in GitHub Desktop.
My .vimrc
execute pathogen#infect()
filetype plugin indent on
syntax enable
colorscheme Mustang
map <C-n> :NERDTreeToggle<CR>
nmap <C-a> :set invnumber<CR>
set showmode " always show what mode we're currently editing in
set nowrap " don't wrap lines
set tabstop=4 " a tab is four spaces
set softtabstop=4 " when hitting <BS>, pretend like a tab is removed, even if spaces
set expandtab " expand tabs by default (overloadable per file type later)
set shiftwidth=4 " number of spaces to use for autoindenting
set shiftround " use multiple of shiftwidth when indenting with '<' and '>'
set backspace=indent,eol,start " allow backspacing over everything in insert mode
set autoindent " always set autoindenting on
set copyindent " copy the previous indentation on autoindenting
set number " always show line numbers
set showmatch " set show matching parenthesis
set ignorecase " ignore case when searching
set smartcase " ignore case if search pattern is all lowercase,
" case-sensitive otherwise
set smarttab " insert tabs on the start of a line according to
" shiftwidth, not tabstop
set scrolloff=4 " keep 4 lines off the edges of the screen when scrolling
set virtualedit=all " allow the cursor to go in to "invalid" places
set hlsearch " highlight search terms
set incsearch " show search matches as you type
set gdefault " search/replace "globally" (on a line) by default
set pastetoggle=<C-y> " when in insert mode, press <F2> to go to
" paste mode, where you can paste mass data non auto indented
set mouse=a " enable using the mouse if terminal emulator
" supports it (xterm does)
set title " change the terminal's title
set showcmd " show (partial) command in the last line of the screen
" this also shows visual selection info
if $TERM_PROGRAM =~ "iTerm"
let &t_SI = "\<Esc>]50;CursorShape=1\x7" " Vertical bar in insert mode
let &t_EI = "\<Esc>]50;CursorShape=0\x7" " Block in normal mode
endif
"move lines
" Normal mode
nnoremap <C-j> :m .+1<CR>==
nnoremap <C-k> :m .-2<CR>==
" Insert mode
inoremap <C-j> <ESC>:m .+1<CR>==gi
inoremap <C-k> <ESC>:m .-2<CR>==gi
" Visual mode
vnoremap <C-j> :m '>+1<CR>gv=gv
vnoremap <C-k> :m '<-2<CR>gv=gv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment