Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Jose Mota .vimrc
set nocompatible
call pathogen#infect()
call pathogen#helptags()
let mapleader = ","
syntax enable
" Mappings {{{
" Insert mode mappings {{{
inoremap <C-l> <space>=><space>
inoremap <C-s> <Esc>:w<CR>a
" }}}
" Normal mode mappings {{{
nnoremap <C-s> :w<CR>
nnoremap <leader>ev :vs $MYVIMRC<CR>
nnoremap <leader>gs :Gstatus<CR><C-W>15+
nnoremap <leader>m :NERDTreeToggle<CR>
nnoremap <leader>rs :!clear;rspec --color spec<CR>
nnoremap <leader>a :Ack
nnoremap <leader>d :bd<CR>
nnoremap <leader>w :w<CR>
nnoremap <leader><cr> :noh<CR>
nnoremap <leader>l :ls<CR>:b
nnoremap <leader>t :CtrlP<CR>
nnoremap n nzz
nnoremap N Nzz
" }}}
" Visual mode mappings {{{
vnoremap < <gv
vnoremap > >gv
" Execute dot in the selection
vnoremap . :norm.<CR>
" }}}
" }}}
" General settings {{{
set autoindent
set backspace=indent,eol,start
set colorcolumn=80
set cursorline
set encoding=utf-8
set fileencoding=utf-8
set gdefault
set guifont=PragmataPro
set guioptions-=Be
set guioptions=aAc
set hlsearch
set ignorecase
set incsearch
set list
set listchars=tab:▸\ ,eol:¬,nbsp:⋅
set noswapfile
set number
set shell=/bin/sh
set showmatch
set smartcase
set smartindent
set term=screen-256color
set ts=2 sts=2 sw=2 expandtab
set visualbell
set winheight=5
set winheight=999
set winminheight=5
set winwidth=84
" }}}
" Show syntax highlighting groups for word under cursor
nmap <C-S-P> :call <SID>SynStack()<CR>
function! <SID>SynStack()
if !exists("*synstack")
echo map(synstack(line('.'), col('.')), 'synIDattr(v:val, "name")')
set background=dark
colorscheme solarized
" Autocommands {{{
".ru files are Ruby.
au BufRead,BufNewFile *.ru setfiletype ruby
" Markdown gets auto textwidth
au Bufread,BufNewFile *.md set textwidth=79
" .feature files are Cucumber.
au Bufread,BufNewFile *.feature set filetype=cucumber
" }}}
" Statusline {{{
hi User1 ctermbg=white ctermfg=black guibg=#89A1A1 guifg=#002B36
hi User2 ctermbg=red ctermfg=white guibg=#aa0000 guifg=#89a1a1
function! GetCWD()
return expand(":pwd")
function! IsHelp()
return &buftype=='help'?' (help) ':''
function! GetName()
return expand("%:t")==''?'<none>':expand("%:t")
set statusline=%1*[%{GetName()}]\
set statusline+=%<pwd:%{getcwd()}\
set statusline+=%2*%{&modified?'\[+]':''}%*
set statusline+=%{IsHelp()}
set statusline+=%{&readonly?'\ (ro)\ ':''}
set statusline+=[
set statusline+=%{strlen(&fenc)?&fenc:'none'}\|
set statusline+=%{&ff}\|
set statusline+=%{strlen(&ft)?&ft:'<none>'}
set statusline+=]\
set statusline+=%=
set statusline+=c%c
set statusline+=,l%l
set statusline+=/%L\
set laststatus=2
" }}}
" vim: foldmethod=marker foldmarker={{{,}}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment