Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
111 lines (87 sloc) 2.05 KB
" Based on http://stevelosh.com/blog/2010/09/coming-home-to-vim/#some-background-about-me
set guifont=Monaco:h12
colorschem jellybeans " https://github.com/nanotech/jellybeans.vim
set vb " Disable the audible bell
set nocompatible " Disable vi compatibility
set modelines=0 " Security related
set tabstop=4
set shiftwidth=4
set softtabstop=4
set expandtab
set encoding=utf-8
set scrolloff=3
set autoindent
set showmode
set showcmd
set hidden
set wildmenu
set wildmode=list:longest
set visualbell
set cursorline
set ttyfast
set ruler
set backspace=indent,eol,start
set laststatus=2
set relativenumber
set undofile
let mapleader = ","
nnoremap / /\v
vnoremap / /\v
set ignorecase
set smartcase
set gdefault
set incsearch
set showmatch
set hlsearch
nnoremap <leader><space> :noh<cr>
nnoremap <tab> %
vnoremap <tab> %
set wrap
set textwidth=79
set formatoptions=qrn1
set colorcolumn=85
set list
set listchars=tab:▸\ ,eol
" prevent using normal keys when learning Vim
nnoremap <up> <nop>
nnoremap <down> <nop>
nnoremap <left> <nop>
nnoremap <right> <nop>
inoremap <up> <nop>
inoremap <down> <nop>
inoremap <left> <nop>
inoremap <right> <nop>
nnoremap j gj
nnoremap k gk
inoremap <F1> <ESC>
nnoremap <F1> <ESC>
vnoremap <F1> <ESC>
nnoremap ; :
au FocusLost * :wa " autosave when losing focus
nnoremap <leader>W :%s/\s\+$//<cr>:let @/=''<CR> " Strip whitelines
" reselect just pasted text
nnoremap <leader>v V`]
inoremap jj <ESC>
nnoremap <leader>w <C-w>v<C-w>l
" Easy navigation through open windows
nnoremap <C-h> <C-w>h
nnoremap <C-j> <C-w>j
nnoremap <C-k> <C-w>k
nnoremap <C-l> <C-w>l
" jump to beginning and end of line
nnoremap <tab> 0
nnoremap \ $
" move current line up / down
nnoremap <S-space> ddkP
nnoremap <space> ddp
" uppercase current word
nnoremap <C-u> vawUe
inoremap <C-u> <ESC>vawUi
" quickly edit this file
nnoremap <leader>ev :vsplit $MYGVIMRC<cr>
nnoremap <leader>sv :source $MYGVIMRC<cr>
" automatically fix common typs
iabbrev teh the
" NERDTree config https://github.com/scrooloose/nerdtree
let NERDTreeIgnore = ['\.pyc$']
nnoremap nt :NERDTreeToggle<cr>