Skip to content

Instantly share code, notes, and snippets.

@tanema
Created August 21, 2012 14:11
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 tanema/3415847 to your computer and use it in GitHub Desktop.
Save tanema/3415847 to your computer and use it in GitHub Desktop.
my vimrc file
set nocompatible " use vim defaults
set mouse=a " use mouse because I am a noob
set ls=2 " allways show status line
set tabstop=2 " numbers of spaces of tab character
set shiftwidth=2 " numbers of spaces to (auto)indent
set scrolloff=3 " keep 3 lines when scrolling
set showcmd " display incomplete commands
set hlsearch " highlight searches
set incsearch " do incremental searching
set ruler " show the cursor position all the time
set visualbell t_vb= " turn off error beep/flash
set novisualbell " turn off visual bell
set nobackup " do not keep a backup file
set number " show line numbers
set ignorecase " ignore case when searching
set title " show title in console title bar
set ttyfast " smoother changes
set modeline " last lines in document sets vim mode
set modelines=3 " number lines checked for modelines
set shortmess=atI " Abbreviate messages
set nostartofline " don't jump to first character when paging
set whichwrap=b,s,h,l,<,>,[,] " move freely between files
set noautoindent
set nosmartindent
set nocindent
syntax on " syntax highlighing
if has("gui_running")
" See ~/.gvimrc
set guifont=Monospace\ 10 " use this font
set lines=50 " height = 50 lines
set columns=100 " width = 100 columns
set background=light " adapt colors for background
set selectmode=mouse,key,cmd
set keymodel=
else
colorscheme elflord " use this color scheme
set background=dark " adapt colors for background
endif
if has("autocmd")
" Restore cursor position
au BufReadPost * if line("'\"") > 0|if line("'\"") <= line("$")|exe("norm '\"")|else|exe "norm $"|endif|endif
" Filetypes (au = autocmd)
au FileType helpfile set nonumber " no line numbers when viewing help
au FileType helpfile nnoremap <buffer><cr> <c-]> " Enter selects subject
au FileType helpfile nnoremap <buffer><bs> <c-T> " Backspace to go back
" Ctrl+X O
autocmd FileType ruby,eruby set omnifunc=rubycomplete#Complete
autocmd FileType javascript set omnifunc=javascriptcomplete#CompleteJS
autocmd FileType html set omnifunc=htmlcomplete#CompleteTags
autocmd FileType css set omnifunc=csscomplete#CompleteCSS
autocmd FileType php noremap <C-L> :!php -l %<CR>
autocmd Filetype html,xml,xsl source ~/.vim/closetag.vim
endif
" Keyboard mappings
map <F1> :previous<CR> " map F1 to open previous buffer
map <F2> :next<CR> " map F2 to open next buffer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment