-
-
Save pcambra/3885044 to your computer and use it in GitHub Desktop.
A .vimrc file for Drupal. Sets correct tabs configuration and a few other gems. Also includes function from Aron Novak (http://drupal.org/user/61864) sourced at http://vim.wikia.com/wiki/Remove_unwanted_spaces which will remove trailing white space upon
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 | |
syntax on | |
filetype on | |
filetype plugin on | |
filetype indent on | |
set sidescroll=1 | |
set sidescrolloff=3 | |
set wrap! "turn off wrapping | |
set showtabline=2 | |
set title | |
set hlsearch | |
set incsearch | |
set ignorecase | |
set smartcase | |
set wildmenu | |
set wildmode=list:longest | |
set wildignore=*.svn | |
set scrolloff=3 | |
set backspace=indent,eol,start | |
set backupdir=~/.vim-tmp,~/.tmp,/tmp | |
set directory=~/.vim-tmp,~/.tmp,/tmp | |
set hidden | |
set tags=tags;~/ | |
let mapeader = "," | |
set timeoutlen=300 | |
imap lkj <ESC> | |
set history=1000 | |
set showmatch | |
set matchtime=0 | |
set shortmess=atI | |
set ruler | |
set showcmd | |
"smart indent | |
set smartindent | |
set number | |
set numberwidth=5 | |
set cpoptions+=n | |
set tabstop=2 | |
set shiftwidth=2 | |
set expandtab | |
%retab 2 | |
"autocmd VimEnter * NERDTree | |
autocmd VimEnter * wincmd p | |
nnoremap <F2> :set invpaste paste?<CR> | |
nnoremap <F3> :NERDTreeToggle<CR> | |
nmap <S-h> gt | |
set pastetoggle=<F2> | |
set showmode | |
"color | |
set t_Co=256 | |
au BufRead,BufNewFile *.json set filetype=json | |
au BufRead,BufNewFile *.html set filetype=htmldjango | |
au BufRead,BufNewFile *.install set filetype=php | |
au BufRead,BufNewFile *.profile set filetype=php | |
au BufRead,BufNewFile *.inc set filetype=php | |
autocmd FileType javascript set omnifunc=javascriptcomplete#CompleteJS | |
autocmd FileType html set omnifunc=htmlcomplete#CompleteTags | |
autocmd FileType css set omnifunc=csscomplete#CompleteCSS | |
"set tags+=$HOME/.vim/tags/python.ctags | |
set tags=./tags | |
" automatically remove trailing whitespace before write | |
function! StripTrailingWhitespace() | |
normal mZ | |
%s/\s\+$//e | |
if line("'Z") != line(".") | |
echo "Stripped whitespace\n" | |
endif | |
normal `Z | |
endfunction | |
autocmd BufWritePre *.module,*.install,*.inc :call StripTrailingWhitespace() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment