Skip to content

Instantly share code, notes, and snippets.

@gaurav

gaurav/.vimrc

Created Dec 5, 2018
Embed
What would you like to do?
My .vimrc
" 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