Created
August 15, 2012 14:24
-
-
Save imagelife/3360569 to your computer and use it in GitHub Desktop.
vimrc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" vim | |
call pathogen#runtime_append_all_bundles() " adding pathogen to vimrc | |
call pathogen#helptags() | |
set nocompatible " choose no compatibility with legacy vi | |
syntax enable | |
set encoding=utf-8 | |
set showcmd " display incomplete commands | |
filetype plugin indent on " load file type plugins + indentation | |
" Whitespace | |
set nowrap " don't wrap lines | |
set tabstop=4 shiftwidth=4 " a tab is two spaces (or set this to 4) | |
set expandtab " use spaces, not tabs | |
set backspace=indent,eol,start " backspace through everything in insert mode | |
set list | |
" MacVim Settings | |
"set guifont=Monaco:h12 | |
set guifont=Monaco\ for\ Powerline:h12 | |
"Auto Commands | |
autocmd BufWrite *.py %retab " retab python files on write | |
":autocmd BufWrite *.html :normal gg=G " reindent html files on save | |
" Searching | |
set hlsearch " highlight matches | |
set incsearch " incremental searching | |
set ignorecase " searches are case insensitive... | |
set smartcase " ... unless they contain at least one capital letter | |
" Mappings | |
nmap <F8> :TagbarToggle<CR> " mapping f8 to TagbarToggle | |
nmap <F2> :NERDTreeToggle<CR> " mapping f2 to NERDTreeToggle | |
noremap <F5> :GundoToggle<CR> " mapping f5 to Gundo | |
noremap <F9> :Gcommit<CR> " mapping f9 to Gcommit | |
noremap! jj <Esc> "<Esc> to jj | |
" Enbale f3 on NumbersToggle | |
let g:NumberToggleTrigger="<F3>" | |
" Mapping | |
let mapleader = "," " setting leader to , | |
" Color Scheme | |
colorscheme tomorrow-night " Tomorrow Theme | |
" Disable Pylint on Save | |
"let g:pymode_lint_write = 0 " python-mode | |
" Enable python folding | |
let g:pymode_folding = 0 " python-mode | |
set laststatus=2 " Always show the statusline | |
" Enable fancy mode | |
let g:Powerline_symbols = 'fancy' " Powerline | |
"SWAGG | |
set relativenumber " setting line numbers | |
"set colorcolumn=81 " line to show 81 character mark | |
set cursorline " shows the horizontal cursor line | |
nmap <leader>ev :vsplit $MYVIMRC<cr> " mapping to edit my vimrc quickly | |
nmap <leader>sv :source $MYVIMRC<cr> " mapping to source my vimrc quickly | |
"Badass Functions | |
function! OpenChangedFiles() | |
only " Close all windows, unless they're modified | |
let status = system('git status -s | grep "^ \?\(M\|A\|UU\)" | sed "s/^.\{3\}//"') | |
let filenames = split(status, "\n") | |
exec "edit " . filenames[0] | |
for filename in filenames[1:] | |
exec "sp " . filename | |
endfor | |
endfunction | |
command! OpenChangedFiles :call OpenChangedFiles() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment