Created
January 15, 2013 20:12
-
-
Save anak10thn/4541606 to your computer and use it in GitHub Desktop.
vim config
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""""""""""""""""""" PLUGINS | |
filetype off | |
set rtp+=~/.vim/bundle/vundle/ | |
call vundle#rc() | |
Bundle 'gmarik/vundle' | |
Bundle 'matchit.zip' | |
Bundle 'The-NERD-Commenter' | |
Bundle 'The-NERD-tree' | |
Bundle 'vim-powerline' | |
Bundle 'Townk/vim-autoclose' | |
Bundle 'mileszs/ack.vim' | |
Bundle 'thisivan/vim-bufexplorer' | |
"Bundle 'xolox/vim-easytags' | |
Bundle 'majutsushi/tagbar' | |
Bundle 'techlivezheng/tagbar-phpctags' | |
Bundle 'scrooloose/nerdtree' | |
Bundle 'scrooloose/nerdcommenter.git' | |
Bundle 'vim-scripts/YankRing.vim.git' | |
Bundle 'tpope/vim-fugitive' | |
Bundle 'tpope/vim-repeat' | |
Bundle 'tpope/vim-surround' | |
Bundle 'tpope/vim-eunuch' | |
Bundle 'tpope/vim-markdown' | |
Bundle 'tpope/vim-endwise' | |
Bundle 'sukima/xmledit.git' | |
Bundle 'vim-scripts/matchit.zip' | |
Bundle 'Lokaltog/vim-easymotion' | |
"AutoComplete & snippets | |
Bundle 'Shougo/neocomplcache' | |
Bundle 'Shougo/neosnippet' | |
Bundle 'vim-scripts/OmniCppComplete' | |
""Syntac checking for lots of languages | |
Bundle 'scrooloose/syntastic' | |
"File fuzzy search | |
Bundle 'kien/ctrlp.vim' | |
" | |
""-------------------- | |
" for php | |
" "-------------------- | |
Bundle 'stephpy/vim-php-cs-fixer' | |
Bundle 'arnaud-lb/vim-php-namespace' | |
Bundle 'shawncplus/phpcomplete.vim' | |
" "Note: The follow plugin may cause wrong display of block comment | |
Bundle 'shawncplus/php.vim' | |
Bundle 'vim-scripts/PDV--phpDocumentor-for-Vim' | |
Bundle 'erikfercak/php-search-doc' | |
Bundle 'lucapette/vim-jquery-doc' | |
" | |
" "-------------------- | |
" " for html, haml, sass | |
" "-------------------- | |
Bundle 'concise/vim-html5-fix' | |
Bundle 'tpope/vim-haml' | |
" | |
" "-------------------- | |
" " for javascript | |
" "-------------------- | |
Bundle 'pangloss/vim-javascript' | |
Bundle 'itspriddle/vim-jquery' | |
Bundle 'hallettj/jslint.vim' | |
" | |
" " non github repos | |
"Bundle 'git://git.wincent.com/command-t.git' | |
"""""Bundle 'Command-T' | |
"""""""""""""""""""" GLOBAL | |
let mapleader="," | |
"colorscheme molokai | |
set gfn=terminus | |
set go= | |
syntax on | |
filetype plugin indent on | |
set encoding=utf-8 | |
set hidden | |
set showcmd | |
set nowrap | |
set backspace=indent,eol,start | |
set autoindent | |
set copyindent | |
set number | |
set shiftround | |
set ignorecase | |
set smartcase | |
set hlsearch | |
set incsearch | |
set history=1000 | |
set undolevels=1000 | |
set title | |
set visualbell | |
set noerrorbells | |
set list | |
set listchars=tab:>.,trail:.,extends:#,nbsp:. | |
set ttyfast | |
set mouse= | |
set nocompatible | |
set backup | |
set backupdir=~/.vim_backup | |
set noswapfile | |
set fileformats=unix,dos,mac | |
set laststatus=2 | |
set expandtab | |
set softtabstop=2 tabstop=2 shiftwidth=2 | |
set ruler | |
set wildignore=*.swp,*.bak | |
set wildmode=longest,list | |
"""""""""""""""""""" KEYBINDINGS | |
map cc <leader>c<space> | |
map # {v}! par 72<CR> | |
map & {v}! par 72j<CR> | |
map <F6> :setlocal spell! spelllang=en<CR> | |
map <F12> :set invhls<CR> | |
cmap <C-g> <C-u><ESC> | |
command! -bang W w<bang> | |
"""""""""""""""""""" PLUGINS | |
"let g:Powerline_symbols = 'fancy' | |
let g:CommandTMaxFiles=5000 | |
let g:CommandTMaxHeight=12 | |
map <C-o> :CommandT<CR> | |
let g:CommandTAcceptSelectionMap = '<CR>' | |
let g:CommandTCancelMap = '<C-g>' | |
let NERDChristmasTree = 1 | |
let NERDTreeSortOrder = ['\/$', '\.js*', '\.cpp$', '\.h$', '*'] | |
nmap <c-b> :NERDTreeToggle<cr> | |
nmap <C-n> <c-w><left><down><c-w><c-w> | |
nmap <C-p> <c-w><left><up><c-w><c-w> | |
nmap <C-o> <c-w><left><CR> | |
"""""""""""""""""""" FILES SPECIFIC | |
au BufRead mutt-* set ft=mail | |
au BufRead mutt-* set invhls | |
au BufNewFile *.html 0r ~/.vim/templates/html.txt | |
au BufRead,BufNewFile *.jsm setfiletype javascript | |
au BufRead,BufNewFile *.xul setfiletype xml | |
au filetype html,xml set listchars-=tab:>. | |
"""""""""""""""""""" CUSTOM FUNCTIONS | |
""" Toggle relative/absolute numbering | |
function! NumberToggle() | |
if(&relativenumber == 1) | |
set number | |
else | |
set relativenumber | |
endif | |
endfunc | |
nnoremap <F10> :call NumberToggle()<cr> | |
""" FocusMode | |
function! ToggleFocusMode() | |
if (&foldcolumn != 12) | |
set laststatus=0 | |
set numberwidth=10 | |
set foldcolumn=12 | |
set noruler | |
hi FoldColumn ctermbg=none | |
hi LineNr ctermfg=0 ctermbg=none | |
hi NonText ctermfg=0 | |
else | |
set laststatus=2 | |
set numberwidth=4 | |
set foldcolumn=0 | |
set ruler | |
execute 'colorscheme ' . g:colors_name | |
endif | |
endfunc | |
nnoremap <F1> :call ToggleFocusMode()<cr> | |
set guifont=MyFont\ for\ Powerline | |
let g:Powerline_symbols = 'fancy' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment