Skip to content

Instantly share code, notes, and snippets.

@amackera
Created January 25, 2013 15:18
Show Gist options
  • Save amackera/4635161 to your computer and use it in GitHub Desktop.
Save amackera/4635161 to your computer and use it in GitHub Desktop.
My vimrc
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Maintainer: Anson MacKeracher (amackera)
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Fancy runtime path manipulation
call pathogen#infect()
"call pathogen#helptags()
" Enable filetype plugin
filetype plugin indent on
" Enable syntax highlighting
syntax on
" General Stuff
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
set history=700 " Remember 700 historical commands
set encoding=utf-8
" Set autoread (for changes outside of vim)
set autoread
" Set wildmenu to be on
set wildmenu
set wildmode=longest,list
set laststatus=2
set statusline=%<%f\%h%m%r%=%-20.(line=%l\ \ column=%c%V\ \ total=%L%)\ \ \%h%m%r%=%-40(bytval=0x%B,%n%Y%)\%P
set bs=eol,start,indent " Backspace config
set ruler " Show current position
" Tabs and indenting
set shiftwidth=4
set tabstop=4
set expandtab
set smarttab
set shiftround
set autoindent
set smartindent
set nowrap
set nocompatible " make Vim less Vi-like
set number " line numbers
set showmode " Show current mode down on the bottom
set hidden " Current buffer can be put into the background withour writing to disk
set title " Show buffer title in shell title
set scrolloff=3 " Start scrolling the buffer 3 lines before cursor hits bottom
set nofoldenable " Disable folding
set backupdir=~/.vim-tmp "Story backups swap files in a tmp dir
set directory=~/.vim-tmp
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Colors
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
set t_Co=256 "Set 256 colors
colorscheme jellybeans
" tags
let Tlist_Ctags_Cmd = '/usr/local/bin/ctags'
let Tlist_WinWidth = 50
"map <F5> :NERDTreeToggle<CR>
"nmap <F5> :w<CR>:make<CR>:cw<CR>
nmap <F5> :!ctags -R --c++-kinds=+p --fields=+iaS --extra=+q .<CR>
nmap <F6> :!jsctags .<CR>
set tags=tags;/ "Search upwards for tags file
autocmd BufEnter *.c set cindent|set cinoptions=l1
autocmd BufEnter *.cpp set cindent|set cinoptions=l1
autocmd BufEnter *.h set cindent|set cinoptions=l1
autocmd BufEnter *.mm setfiletype objcpp
autocmd BufEnter *.m setfiletype objc
autocmd BufEnter *.html setfiletype htmldjango
autocmd BufEnter *.html syntax include ~/.vim/syntax/html5.vim
" Reload .vimrc buffer on change
autocmd! bufwritepost .vimrc source %
" Space centers the screen on the current line
nmap <space> zz
" Orient string searches around the center of the screen
nmap n nzz
if bufwinnr(1)
" Window resizing
nmap + <C-W>+
nmap - <C-W>-
endif
" Show current line
set cursorline
" Enable clipboard sharing
set clipboard=unnamed
" Disable terminal bell
set noerrorbells visualbell t_vb=
:if $VIM_CRONTAB == "true"
:set nobackup
:set nowritebackup
:endif
let mapleader = ','
map <Leader>n <esc>:tabprevious<CR>
map <Leader>m <esc>:tabnext<CR>
" Set 'color column' basically a visual ruler at 80 characters
set colorcolumn=80
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment