Skip to content

Instantly share code, notes, and snippets.

Forked from just-digital/gist:1868435
Created October 13, 2012 15:38
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
A .vimrc file for Drupal. Sets correct tabs configuration and a few other gems. Also includes function from Aron Novak ( sourced at which will remove trailing white space upon
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
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
if line("'Z") != line(".")
echo "Stripped whitespace\n"
normal `Z
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