Last active
August 29, 2015 14:25
-
-
Save prabeengiri/c59e75ef09a8d3ff11c0 to your computer and use it in GitHub Desktop.
Vim Configuration for Drupal Development
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
// First Install Vim Drupal Module | |
drush @none dl vimrc | |
// Checkout vim installation options | |
drush help vimrc-install | |
// Install vim plugins | |
drush -v vimrc-install [options] | |
// For installing the color scheme | |
// Above command will install Vbundle so, clone the git colorscheme repo | |
// in the ~/.vim/bundle folder and add that colorscheme in the .vimrc file | |
# colorscheme vividchalk //https://github.com/modess/vim-phpcolors.git | |
#VimRc Configuration snippet, ~/.vimrc | |
" Following lines added by drush vimrc-install on Wed, 16 Jul 2014 12:52:24 +0000. | |
set nocompatible | |
call pathogen#infect('~/.drush/vimrc/bundle/{}') | |
call pathogen#infect('~/.vim/bundle/{}') | |
if has("autocmd") | |
"Drupal *.module and *.install files. | |
augroup filetypedetect | |
au! BufRead,BufNewFile *.module setfiletype php | |
au! BufRead,BufNewFile *.install setfiletype php | |
au! BufRead,BufNewFile *.test setfiletype php | |
au! BufRead,BufNewFile *.inc setfiletype php | |
au! BufRead,BufNewFile *.profile setfiletype php | |
au! BufRead,BufNewFile *.view setfiletype php | |
augroup END | |
endif | |
" cursor styling | |
"highlight Cursor guifg=white guibg=black | |
"highlight iCursor guifg=white guibg=steelblue | |
"set guicursor=n-v-c:block-Cursor | |
"set guicursor+=i:ver100-iCursor | |
"set guicursor+=n-v-c:blinkon0 | |
"set guicursor+=i:blinkwait10 | |
" tab navigation like firefox | |
nnoremap <C-S-tab> :tabprevious<CR> | |
nnoremap <C-tab> :tabnext<CR> | |
nnoremap <C-n> :tabnew<CR> | |
nnoremap <A-9> :tablast<CR> | |
inoremap <C-S-tab> <Esc>:tabprevious<CR> | |
inoremap <C-tab> <Esc>:tabnext<CR> | |
inoremap <C-n> <Esc>:tabnew<CR> | |
inoremap <A-9> <Esc>:tablast<CR> | |
" easy indentation | |
nmap <tab> a<C-t><Esc> | |
nmap <S-tab> a<C-d><Esc> | |
vmap <tab> :><CR>gv | |
vmap <S-tab> :<<CR>gv | |
" highlight current line | |
set cursorline | |
" color column | |
if exists('+colorcolumn') | |
set colorcolumn=80 | |
else | |
au BufWinEnter * let w:m2=matchadd('ErrorMsg', '\%>80v.\+', -1) | |
endif | |
" Custom key mappings | |
nmap <F8> :TagbarToggle<CR> | |
nmap <F7> :NERDTreeToggle<CR> | |
" Default colorscheme | |
" Make sure you have molokai colorscheme present | |
" colorscheme molokai | |
" XDebug Debugger port | |
let g:debuggerPort = 9000 | |
" Move tabs with alt + left|right | |
nnoremap <silent> <A-Left> :execute 'silent! tabmove ' . (tabpagenr()-2)<CR> | |
nnoremap <silent> <A-Right> :execute 'silent! tabmove ' . tabpagenr()<CR> | |
" ctrlp custom settings | |
let g:ctrlp_by_filename = 1 | |
let g:ctrlp_match_window = 'bottom,order:ttb,min:1,max:20,results:20' | |
let g:ctrlp_open_new_file = 't' | |
let g:ctrlp_mruf_case_sensitive = 0 | |
" Store backups in separate directory | |
" Make sure you do `mkdir ~/vimtmp` before using this setting | |
set backupdir=~/vimtmp | |
" Use neocomplete. | |
let g:neocomplete#enable_at_startup = 1 | |
" AutoComplPop like behavior. | |
let g:neocomplete#enable_auto_select = 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 php setlocal omnifunc=phpcomplete#Complete | |
" Enable heavy omni completion. | |
if !exists('g:neocomplete#sources#omni#input_patterns') | |
let g:neocomplete#sources#omni#input_patterns = {} | |
endif | |
let g:neocomplete#sources#omni#input_patterns.php = '[^. \t]->\h\w*\|\h\w*::' | |
" Default vim settings | |
set mouse=a " Enable mouse | |
set number " Show line numbers | |
set showmatch " Show matching brackets | |
set smartcase " Do smart case matching | |
set smarttab " Enable smarttab | |
set incsearch " Incremental search | |
set noswapfile " Do not create swp file | |
" End of vimrc-install additions. | |
source $VIMRUNTIME/vimrc_example.vim | |
" add to .vimrc, need to have vbundle installed | |
"Plugin 'flazz/vim-colorschemes' | |
":PluginInstall |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment