Skip to content

Instantly share code, notes, and snippets.

@tonyfinn
Created November 30, 2011 15:08
Show Gist options
  • Save tonyfinn/1409379 to your computer and use it in GitHub Desktop.
Save tonyfinn/1409379 to your computer and use it in GitHub Desktop.
My vimrc
" Add filetype dependent plugins
filetype plugin on
filetype plugin indent on
" Easier to type
let mapleader=","
" General junk
set modelines=0
set encoding=utf-8
set showcmd " Always show command when typing
set ttyfast " Faster redraws when in CLI
set scrolloff=3 " Ensure there is always 3 lines above and below the cursor visible
set laststatus=2 " Always have a status line
set nocompatible
" Tabs and indentation
set tabstop=4
set shiftwidth=4
set softtabstop=4
set noexpandtab
set autoindent
" Screen width
set wrap
set textwidth=78
set colorcolumn=80
" Not Even easy to type anymore as they're small on my new laptop- stop using them!
nnoremap <up> <nop>
nnoremap <down> <nop>
nnoremap <left> <nop>
nnoremap <right> <nop>
inoremap <up> <nop>
inoremap <down> <nop>
inoremap <left> <nop>
inoremap <right> <nop>
" Backspace off lines
set backspace=indent,eol,start
" Aesthetics
set t_Co=256
syntax on
set background=dark
colors wombat
set gfn=Inconsolata\ 9
" Line numbers
set nu!
" Directories
set backupdir=~/.vim/backup,/tmp
" Searching
set hlsearch
set incsearch
set showmatch
highlight MatchParen ctermbg=4
" Shift-less commands
nnoremap ; :
nnoremap : ;
" Make j and k display line oriented
noremap j gj
noremap k gk
" Zen HTML
let g:user_zen_expandabbr_key = '<c-e>'
let g:use_zen_complete_tag = 1
" Nice file opening
set wildmenu
set wildmode=list:longest
" Don't autocomplete these
set wildignore+=.hg,.git.svn " Version control
set wildignore+=*.jpg,*.bmp,*.gif,*.png,*.jpeg " Images
set wildignore+=*.sw? " Swap files
" Resize splits when window resized
au VimResized * exe "normal! \<c-w="
" KILL ANNOYING BELL
set noeb vb t_vb=
" Remove trailing whitespace
nnoremap <leader>W :%s/\s\+$//<cr>:let @/=''<CR>
" Open new split and switch to it
nnoremap <leader>w <C-w>v<C-w>l
" Split movement
nnoremap <C-h> <C-w>h
nnoremap <C-j> <C-w>j
nnoremap <C-k> <C-w>k
nnoremap <C-l> <C-w>l
" Remove GUI options
set go-=T " Toolbar
set go-=l " Normal left scrollbar
set go-=L " Split left toolbar
set go-=r " Normal right scrollbar
set go-=R " Split right scrollbar
@tonyfinn
Copy link
Author

A lot of the stuff from this came from this vimrc but I think mine is a bit better commented (and much shorter too).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment