Created
February 10, 2015 14:31
-
-
Save baghayi/5ca82068461e93f25439 to your computer and use it in GitHub Desktop.
My current vimrc file
This file contains 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
set nocompatible | |
call pathogen#infect() | |
filetype plugin indent on | |
let mapleader=',' | |
let g:used_javascript_libs = 'angularjs,angularui,jasmine,jquery' | |
set laststatus=2 | |
set fileencoding=utf-8 | |
set encoding=utf-8 | |
set backspace=indent,eol,start | |
set tabstop=4 | |
set shiftwidth=4 | |
set hlsearch | |
set ruler | |
set number | |
set title | |
set autoindent | |
set smartindent | |
set expandtab | |
set sm | |
set incsearch | |
set hlsearch | |
set noswapfile | |
set visualbell | |
"set undofile | |
set cursorline | |
syntax enable | |
set wrap | |
"colorscheme solarized | |
set background=dark | |
set linebreak | |
set wildmenu | |
set hidden | |
set showcmd | |
set ruler | |
set nrformats-=octal | |
set shiftround | |
"autocmd BufReadPre *.js let b:javascript_lib_use_jquery = 1 | |
"autocmd BufReadPre *.js let b:javascript_lib_use_angularjs = 1 | |
"autocmd BufNewFile,BufRead,BufReadPost *.twig set syntax=html | |
inoremap <S-C-cr> <ESC><S-o> | |
nnoremap <S-C-cr> <S-o> | |
nnoremap <C-cr> o | |
inoremap <C-cr> <ESC>o | |
nnoremap <leader><space> :noh<cr> | |
noremap <leader>m :NERDTreeToggle<cr> | |
inoremap <Leader>u <C-O>:call PhpInsertUse()<CR> | |
noremap <Leader>u :call PhpInsertUse()<CR> | |
inoremap <Leader>e <C-O>:call PhpExpandClass()<CR> | |
noremap <Leader>e :call PhpExpandClass()<CR> | |
nmap s <Plug>(easymotion-s) | |
"nmap t <Plug>(easymotion-t2) | |
map / <Plug>(easymotion-sn) | |
omap / <Plug>(easymotion-tn) | |
map n <Plug>(easymotion-next) | |
map N <Plug>(easymotion-prev) | |
nnoremap <C-Tab> :tabnext<CR> | |
"noremap <C-Tab> :tabnext<CR> | |
inoremap <C-Tab> <ESC>:tabnext<CR> | |
nnoremap <C-S-Tab> :tabprevious<CR> | |
"noremap <C-S-Tab> :tabprevious<CR> | |
inoremap <C-S-Tab> <ESC>:tabprevious<CR> | |
noremap <C-S-Down> ddp | |
noremap <C-S-Up> ddkP | |
inoremap <C-S-Down> <ESC>ddp | |
inoremap <C-S-Up> <ESC>ddkP | |
nmap G Gzz | |
nmap n nzz | |
nmap N Nzz | |
nmap } }zz | |
nmap { {zz | |
nnoremap * *zz | |
nnoremap # #zz | |
nmap j jzz | |
nmap k kzz | |
" ACk | |
"let g:ackprg="ack-grep -H --nocolor --nogroup --column" | |
" open a new tab and search for something | |
nnoremap <leader>a :tab split<CR>:Ack -i ""<Left> | |
" Immediately search for the word under the cursor in a new tab | |
nnoremap <leader>A :tab split<CR>:Ack -i <C-r><C-w><CR> | |
let phpacc_template_dir="/home/hossein/.vim/bundle/php-accessors.vim/templates" | |
nnoremap <buffer> <LocalLeader>i :call phpacc#GenerateAccessors()<CR> | |
vnoremap <buffer> <LocalLeader>i :call phpacc#GenerateAccessors()<CR> | |
let g:tagcommands = { | |
\ "php" : { | |
\ "tagfile" : "tags", | |
\ "args" : "-R --PHP-kinds=+cf", | |
\ "cmd" : "ctags", | |
\ }, | |
\ "javascript" : { | |
\ "tagfile" : "tags", | |
\ "args" : "-R", | |
\ "cmd" : "ctags", | |
\ } | |
\} | |
" vundle | |
call pathogen#helptags() | |
syntax on " syntax highlighing | |
if has("gui_running") | |
let g:airline#extensions#tabline#enabled = 1 | |
let g:airline_powerline_fonts = 1 | |
" See ~/.gvimrc | |
"set guifont=Monospace\ 10 " use this font | |
"set guifont=Anonymice\ Powerline\ 10 " use this font | |
set guifont=DejaVu\ Sans\ Mono\ for\ Powerline\ 10 " use this font | |
set lines=50 " height = 50 lines | |
set columns=100 " width = 100 columns | |
"set background=dark " adapt colors for background | |
colorscheme base16-default | |
"set selectmode=mouse,key,cmd | |
"set keymodel= | |
nmap <C-V> "+gP | |
imap <C-V> <ESC><C-V>i | |
"vmap <C-C> "+y | |
"else | |
" colorscheme elflord " use this color scheme | |
" set background=dark " adapt colors for background | |
endif | |
if has("autocmd") | |
" Restore cursor position | |
au BufReadPost * if line("'\"") > 0|if line("'\"") <= line("$")|exe("norm '\"")|else|exe "norm $"|endif|endif | |
" Filetypes (au = autocmd) | |
au FileType helpfile set nonumber " no line numbers when viewing help | |
au FileType helpfile nnoremap <buffer><cr> <c-]> " Enter selects subject | |
au FileType helpfile nnoremap <buffer><bs> <c-T> " Backspace to go back | |
" When using mutt, text width=72 | |
au FileType mail,tex set textwidth=72 | |
"au FileType cpp,c,java,sh,pl,php,phtml,asp set autoindent | |
au FileType cpp,c,java,sh,pl,php,phtml,asp,xml,javascript set smartindent | |
nnoremap <C-p> :set invpaste paste?<CR> | |
set pastetoggle=<C-p> | |
set showmode | |
"au FileType cpp,c,java,sh,pl,php,phtml,asp set cindent | |
"au BufRead mutt*[0-9] set tw=72 | |
" Automatically chmod +x Shell and Perl scripts | |
"au BufWritePost *.sh !chmod +x % | |
"au BufWritePost *.pl !chmod +x % | |
" File formats | |
au BufNewFile,BufRead *.phtml set syntax=php | |
au BufNewFile,BufRead *.pls set syntax=dosini | |
au BufNewFile,BufRead modprobe.conf set syntax=modconf | |
" Ctrl+X O | |
"autocmd FileType python set omnifunc=pythoncomplete#Complete | |
autocmd FileType javascript set omnifunc=javascriptcomplete#CompleteJS | |
autocmd FileType html set omnifunc=htmlcomplete#CompleteTags | |
autocmd FileType css set omnifunc=csscomplete#CompleteCSS | |
autocmd FileType xml set omnifunc=xmlcomplete#CompleteTags | |
autocmd FileType php set omnifunc=phpcomplete#CompletePHP | |
"autocmd FileType c set omnifunc=ccomplete#Complete | |
autocmd FileType php noremap <C-L> :!php -l %<CR> | |
"autocmd Filetype html,xml,xsl source ~/.vim/closetag.vim | |
endif | |
"noremap <left> <nop> | |
"noremap <right> <nop> | |
"noremap <up> <nop> | |
"noremap <down> <nop> | |
let g:php_refactor_command='php /home/hossein/.vim/bundle/vim-php-refactoring/refactor.phar' | |
let g:phpqa_messdetector_autorun = 0 | |
let g:phpqa_codesniffer_autorun = 0 | |
set tags+=./tags.vendors,tags.vendors | |
"g:DisableAutoPHPFolding = 1 | |
"let g:neocomplcache_enable_at_startup = 1 | |
" Enable omni completion. | |
"autocmd FileType css setlocal omnifunc=csscomplete#CompleteCSS | |
"autocmd FileType html,markdown setlocal omnifunc=htmlcomplete#CompleteTags | |
"autocmd FileType javascript setlocal omnifunc=javascriptcomplete#CompleteJS | |
"autocmd FileType python setlocal omnifunc=pythoncomplete#Complete | |
"autocmd FileType xml setlocal omnifunc=xmlcomplete#CompleteTags | |
" Enable heavy omni completion. | |
"if !exists('g:neocomplcache_omni_patterns') | |
"let g:neocomplcache_omni_patterns = {} | |
"endif | |
"let g:neocomplcache_omni_patterns.php = '[^. \t]->\h\w*\|\h\w*::' | |
"let g:neocomplcache_omni_patterns.c = '[^.[:digit:] *\t]\%(\.\|->\)' | |
"let g:neocomplcache_omni_patterns.cpp = '[^.[:digit:] *\t]\%(\.\|->\)\|\h\w*::' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Here are bundles I'm using:
ack.vim
angular.vim
base16
bufexplorer-7.4.2
Command-T
ConvertBase.vim
emmet-vim
HTML-AutoCloseTag
javascript-libraries-syntax.vim
nerdcommenter
nerdtree
numbers.vim
php-accessors.vim
phpcomplete.vim
PIV
snipmate.vim
supertab
syntastic
tabular tern_for_vim
vCoolor.vim
vdebug
vim-airline
vim-autoclose
vim-autotag
vim-bbye
vim-colors-solarized
vim-css-color
vim-easymotion
vim-fugitive
vim-gitgutter
vim-jasmine
vim-l9
vim-markdown
vim-multiple-cursors
vim-php-namespace
vim-phpqa
vim-php-refactoring
vim-surround
vim-taggatron
vim-twig
vmustache