Skip to content

Instantly share code, notes, and snippets.

@jokester
Created November 5, 2013 17:58
Show Gist options
  • Save jokester/7323259 to your computer and use it in GitHub Desktop.
Save jokester/7323259 to your computer and use it in GitHub Desktop.
vimrc
" vim: ft=vim
"appearance
set guioptions-=T
set guioptions-=m
"platform dependent settings
if(has("win32") || has("win95") || has("win64") || has("win16"))
"win
set lines=40
set columns=120
set guifont=Consolas:h13
set clipboard=unnamed
elseif (has("unix") && (system("uname") =~ "Darwin"))
"mac
set lines=40
set columns=120
set guifont=Monaco:h18
set clipboard=unnamed
set vb " visual bell, which disables alert sound
else
"linux
set lines=30
set columns=120
set guifont=Droid\ Sans\ Mono\ 14
set clipboard=unnamedplus
endif
"set cursorcolumn
"set cursorline
colorscheme tir_black
" tab navigation like firefox
nnoremap <C-S-tab> :tabprevious<CR>
nnoremap <C-tab> :tabnext<CR>
nnoremap <C-t> :tabnew<CR>
filetype off
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
"task-dependent plugins
Bundle 'gmarik/vundle'
Bundle 'vim-scripts/FencView.vim'
Bundle 'vim-scripts/DirDiff.vim'
Bundle 'vim-scripts/The-NERD-tree'
let g:NERDTreeDirArrows=0
let NERDTreeIgnore = ['\.pyc$', '\.aux$']
Bundle 'vim-scripts/TaskList.vim'
let g:tlTokenList = ["FIXME", "TODO", "XXX", "NOTE", "@todo"]
Bundle 'vim-scripts/Gundo'
Bundle 'majutsushi/tagbar'
let g:tagbar_iconchars=['+','-']
let g:tagbar_autofocus=1
if executable('coffeetags') " gem install CoffeeTags
let g:tagbar_type_coffee = {
\ 'ctagsbin' : 'coffeetags',
\ 'ctagsargs' : '--include-vars',
\ 'kinds' : [
\ 'f:functions',
\ 'o:object',
\ ],
\ 'sro' : ".",
\ 'kind2scope' : {
\ 'f' : 'object',
\ 'o' : 'object',
\ }
\ }
endif
Bundle 'godlygeek/tabular'
Bundle 'scrooloose/syntastic'
" Bundle 'vim-scripts/simple-pairs'
Bundle 'mileszs/ack.vim'
Bundle 'tpope/vim-rake'
Bundle 'tpope/vim-fugitive'
Bundle 'tpope/vim-surround'
Bundle 'tpope/vim-commentary'
Bundle 'vim-ruby/vim-ruby'
autocmd FileType ruby,eruby set omnifunc=rubycomplete#Complete
autocmd FileType ruby,eruby let g:rubycomplete_buffer_loading = 1
autocmd FileType ruby,eruby let g:rubycomplete_classes_in_global = 1
autocmd FileType ruby,eruby let g:rubycomplete_rails = 1
Bundle 'Valloric/YouCompleteMe'
let g:ycm_key_list_select_completion=[] " leave tab to me
let g:ycm_key_list_previous_completion=[]
let g:ycm_key_invoke_completion = '<C-a>'
Bundle 'SirVer/ultisnips'
Bundle 'othree/html5.vim'
Bundle 'ap/vim-css-color'
"Bundle 'twerth/ir_black'
Bundle 'vim-scripts/tir_black'
colorscheme tir_black
Bundle 'nathanaelkane/vim-indent-guides.git'
let g:indent_guides_enable_on_vim_startup = 1
let g:indent_guides_guide_size = 1
autocmd VimEnter,Colorscheme * :hi IndentGuidesOdd guibg=#ffc261 ctermbg=3 "applejack
autocmd VimEnter,Colorscheme * :hi IndentGuidesEven guibg=#f3b6cf ctermbg=4 "pinkie
Bundle 'tpope/vim-haml'
Bundle 'kchmck/vim-coffee-script'
Bundle 'jelera/vim-javascript-syntax'
"Bundle 'vim-scripts/TeX-9'
"let g:tex_flavor = 'xelatex'
"au BufReadPre * let b:init_tex_nine = 1
" move between visual lines
" nnoremap <j> <g><j>
" nnoremap <k> <g><k>
" move between windows
nnoremap <C-j> <C-w>j
nnoremap <C-k> <C-w>k
nnoremap <C-h> <C-w>h
nnoremap <C-l> <C-w>l
nnoremap <C-e> <C-w>c
nnoremap Q :qa<CR>
inoremap <C-k> <C-x><C-o>
nnoremap <F2> :NERDTreeToggle<CR>
nnoremap <F3> :TaskList<CR>
nnoremap <F5> :GundoToggle<CR>
nnoremap <F6> :TagbarToggle<CR>
nnoremap <F7> :Gdiff<CR>
nnoremap <F8> :Gstatus<CR>
nnoremap <C-g> :Ack
nnoremap gf <C-w>gf
nnoremap / :noh<CR>/
"platform dependent settings
if(has("win32") || has("win95") || has("win64") || has("win16"))
"win
set fileencodings=utf8,cp936,cp932
let g:fencview_autodetect=1
elseif (has("unix") && (system("uname") =~ "Darwin"))
"mac
set dictionary=/usr/share/dict/words
set spell
let g:fencview_autodetect=1
let g:fencview_checklines=30
colorscheme desert
else
"linux
set dictionary=/usr/share/dict/usa
set spell
let g:fencview_autodetect=1
let g:fencview_checklines=30
endif
set ambiwidth=double " set for width of CJK special charater font
"encodings
set encoding=utf8
set fileformats=unix,dos,mac
"ui language
"language messages en_us
set nocompatible
set nobackup
set noswapfile
set showtabline=2
set magic
set hlsearch
set incsearch
set ignorecase
set smartcase
set nowrap
set number
set ruler
set showcmd
set autoread
set scrolloff=5
set laststatus=2
"programming related
filetype on
filetype plugin on
filetype indent on
syntax on
set previewheight=5
set autoindent
set showmatch
"vimdiff related
set diffopt+=context:12
"auto refresh diff : see OnInsertEnter, OnInsertLeave
autocmd InsertLeave * call OnInsertLeave()
autocmd InsertEnter * call OnInsertEnter()
syn match EOLWS /^%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%/
function OnInsertEnter ()
if &diff == 1
diffupdate
endif
syn clear EOLWS
syn match EOLWS excludenl /\s\+\%#\@!$/
highlight EOLWS ctermbg=red guibg=red
endfunction
function OnInsertLeave ()
if &diff == 1
diffupdate
endif
syn clear EOLWS
syn match EOLWS excludenl /\s\+$/
highlight EOLWS ctermbg=red guibg=red
if pumvisible() == 0
pclose
endif
endfunction
" mouse in terminal
"set mouse=a
if has("autocmd") && exists("+omnifunc")
autocmd Filetype *
\ if &omnifunc == "" |
\ setlocal omnifunc=syntaxcomplete#Complete |
\ endif
endif
set statusline =%-F "filename
set statusline+=%=
set statusline+=%{&filetype!=''?(&filetype.'\ \|\ '):''} "ft
set statusline+=%{(&fenc!=''?&fenc:&enc).(&bomb?\",BOM\":\"\").','.(&ff)} "encoding
set statusline+=\ \|\
set statusline+=<%4l/%4L,%4c>\ %2p%% "position
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment