Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

file 155 lines (121 sloc) 2.975 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155
"pathogen
call pathogen#runtime_append_all_bundles()

"no comaptibility with vi
set nocompatible

"enable filetypes
filetype on
filetype plugin on
filetype indent on
syntax on

"display current cursor position in lower right corner.
set ruler

"switch between buffers without saving
set hidden

"tabs default to two spaces
set tabstop=2
set shiftwidth=2
set softtabstop=2
set expandtab

"show command on bottom right
set showcmd

"line numbers
set number

"smart indenting
set smartindent
set autoindent

"always show the status line
set laststatus=2

"better line wrapping
set wrap
set textwidth=79
set formatoptions=qrn1

"set incremental searching
set incsearch

"case insensitive search
set ignorecase
set smartcase

"disable code folding
set nofoldenable

"hide mouse when typing
set mousehide

"split windows below the current window.
set splitbelow

"session settings
set sessionoptions=resize,winpos,winsize,buffers,tabpages,folds,curdir,help

"leader key
let mapleader='s'

"shortcut for editing vimrc file in a new tab
nmap <Leader>ev :tabedit $MYVIMRC<cr>

"faster shortcut for commenting. Requires T-Comment plugin
map <Leader>c <c-_><c-_>

"saves time; maps the spacebar to colon
nmap <space> :

"code completion
imap <C-j> <C-n>
imap <C-k> <C-p>
set completeopt=longest,menuone

"more useful command-line completion
set wildmenu

"auto-completion menu
set wildmode=list:longest

"source the vimrc file after saving it
if has("autocmd")
 augroup myvimrchooks
  au!
  autocmd bufwritepost .vimrc source ~/.vimrc
 augroup END
endif

"easier window navigation
nmap <C-h> <C-w>h
nmap <C-j> <C-w>j
nmap <C-k> <C-w>k
nmap <C-l> <C-w>l

"CommandT Plugin Settings
nmap <C-p> :CommandT<CR>
nmap <C-f> :CommandTFlush<CR>
set wildignore=.git,node_modules
let g:CommandTMaxHeight=10
let g:CommandTCancelMap=['<C-c>', '<Esc>']

"helpful shortcuts
nmap <Leader>l :vsplit<CR><C-l>
nmap <Leader>j :split<CR>
nmap <Leader>r :redraw!<CR>
nmap <Leader>s :set spell! spell?<CR>
nmap <Leader>h :set hls! hls?<CR>
nmap <Leader>2 :set ts=2 sts=2 sw=2 et<CR>
nmap <Leader>4 :set ts=4 sts=4 sw=4 et<CR>
nmap <Leader>p :set invpaste paste?<CR>
nmap <C-t> :tabnew<CR>
nmap ˙ :tabprev<CR>
nmap ¬ :tabnext<CR>
nmap <C-w><C-w> :q<CR>

"end brace shortcut
function! CleverBrace()
  if strpart( getline('.'), col('.')-2, 1 ) =~ '{'
    return "\<CR>}\<ESC>O"
  else
    return "\<CR>"
endfunction
inoremap <CR> <C-R>=CleverBrace()<CR>

"spelling corrections
iab teh the
iab Teh The

"commands
command! Run ! rcc %

"show current mode
set showmode

"file types
au BufNewFile,BufRead *.less set filetype=less
au BufNewFile,BufRead *.epy set filetype=htmldjango
au BufNewFile,BufRead *.json set filetype=json

"highlighting
highlight LineNr ctermfg=black
highlight Pmenu ctermbg=grey ctermfg=black
highlight PmenuSel ctermbg=red ctermfg=white

"line movement
nmap ∆ :m+<CR>==
nmap ˚ :m-2<CR>==
imap ∆ <Esc>:m+<CR>==gi
imap ˚ <Esc>:m-2<CR>==gi
vmap ∆ :m'>+<CR>gv=gv
vmap ˚ :m-2<CR>gv=gv
Something went wrong with that request. Please try again.