Skip to content

Instantly share code, notes, and snippets.

@carlosvillu carlosvillu/.vimrc
Created Mar 1, 2015

What would you like to do?
set nocompatible " use vim features
" set foldmethod=syntax
set foldmethod=marker
set foldlevelstart=1
set foldnestmax=5
set foldclose=all
set nobackup " no backup
set nowritebackup " no backup during edit session
set backspace=indent,eol,start " backspace over everything
set tabstop=2 " size of a tab
set shiftwidth=2 " size for auto/smartindent
set softtabstop=2 " a tab is this size
set expandtab " spaces not tabs
set smartindent " indents for you
set smarttab " tabs at start of lines
set autoindent " always set autoindenting on
set laststatus=2 " always show status line
set pastetoggle=<D-e>
set number
set noswapfile
au BufRead,BufNewFile jquery.*.js set ft=javascript syntax=jquery
call pathogen#runtime_append_all_bundles()
" Alternative using Tab/Shift-Tab (for gvim).
:vnoremap <Tab> >gv
:vnoremap <S-Tab> <gv
" Replace $RSENSE_HOME with the directory where RSense was installed
let g:rsenseHome = "/Users/cvilluendas/.vim/rsense-0.3"
"let g:rsenseUseOmniFunc = 0
" set list
set encoding=utf-8
set showcmd
set timeoutlen=50
set wildmenu
"Git branch
function! GitBranch()
let branch = system("git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* //'")
if branch != ''
return ' Git Branch: ' . substitute(branch, '\n', '', 'g')
return ''
function! CurDir()
return substitute(getcwd(), '/Users/amir/', "~/", "g")
function! HasPaste()
if &paste
return 'PASTE MODE '
return ''
" Format the statusline
set statusline=\ %{HasPaste()}%F%m%r%h\ %w\ \ CWD:\ %r%{CurDir()}%h\ \ \ Line:\ %l/%L%{GitBranch()}
set so=7 " 7 lines when scrolling vertically
set ffs=unix " eol
set showmatch " show matching bracket
set noerrorbells
set novisualbell
set vb t_vb= " no bells
set modeline " show current mode
set incsearch " do incremental search
set history=50 " keep 50 lines in history
"set textwidth=185 " column width is 185
"set wrap " wrap after 80 chars
set hlsearch " highlight search word
set ruler
syntax on
filetype on
filetype indent on
filetype plugin on
" C-TAB and C-SHIFT-TAB cycle tabs forward and backward
" nmap <c-.> :tabnext<cr>
" imap <c-.> <c-o>:tabnext<cr>
" vmap <c-.> <c-o>:tabnext<cr>
" nmap <c-s-tab> :tabprevious<cr>
" imap <c-s-tab> <c-o>:tabprevious<cr>
" vmap <c-s-tab> <c-o>:tabprevious<cr>
" Simulated TextMate text select
:nnoremap <S-Left> v<Left>
:nnoremap <S-Right> v<Right>
:vnoremap <S-Left> <Left>
:vnoremap <S-Right> <Right>
" C-# switches to tab
nmap <d-1> 1gt
nmap <d-2> 2gt
nmap <d-3> 3gt
nmap <d-4> 4gt
nmap <d-5> 5gt
nmap <d-6> 6gt
nmap <d-7> 7gt
nmap <d-8> 8gt
nmap <d-9> 9gt
if has("gui_running")
"colors molokai
colors desert
set guifont=Monaco:h12
set guioptions-=T
set guioptions-=r
nmap <silent> <D-3> :CommandT<CR>
hi Todo guifg=#FF0000 guibg=#FF7F50
hi TODO guifg=#FF0000 guibg=#FF7F50
autocmd BufWritePre *.rb :%s/\s\+$//e
autocmd BufWritePre *.c :%s/\s\+$//e
au BufRead,BufNewFile *.scss set filetype=scss
au BufNewFile,BufRead *.xml,*.htm,*.html, *.tpl so XMLFolding
autocmd BufRead,BufNewFile *.tpl set filetype=html
" Some Linux distributions set filetype in /etc/vimrc.
" Clear filetype flags before changing runtimepath to force Vim to reload them.
filetype off
filetype plugin indent off
set runtimepath+=~/vim-go/misc/vim
filetype plugin indent on
syntax on
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.