Skip to content

Instantly share code, notes, and snippets.

@gaurav
Last active April 29, 2017 04:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gaurav/671221 to your computer and use it in GitHub Desktop.
Save gaurav/671221 to your computer and use it in GitHub Desktop.
My .vimrc file
" Activate pathogen.
call pathogen#infect()
call pathogen#helptags()
" These are a few of my favourite settings.
syntax on
set background=dark
set hlsearch
set incsearch
set smartindent
set fileencoding=utf8
set mouse=n
colorscheme murphy
" Colour column 80 so I know where it is.
set colorcolumn=80
" And wrap at words.
set wrap linebreak nolist
" VimR and MacVim have their own settings.
if has("gui_macvim") || has("gui_vimr")
set guifont=Menlo:h20
endif
" virtual tabstops using spaces
set shiftwidth=4
set softtabstop=4
set expandtab
" allow toggling between local and default mode
function TabToggle()
if &expandtab
set shiftwidth=8
set softtabstop=0
set noexpandtab
else
set shiftwidth=4
set softtabstop=4
set expandtab
endif
endfunction
nmap <tab><tab><tab> mz:execute TabToggle()<CR>'z
augroup filetypedetect
au! BufRead,BufNewFile *.t setfiletype perl
au! BufRead,BufNewFile *.ru setfiletype ruby
au! BufRead,BufNewFile *.rad setfiletype html
au! BufRead,BufNewFile *.owl setfiletype xml
augroup END
" Vim 8 seems fussy about backspace, so:
set backspace=indent,eol,start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment