Skip to content

Instantly share code, notes, and snippets.

@vinioliveira
Created April 23, 2011 20:46
Show Gist options
  • Save vinioliveira/938965 to your computer and use it in GitHub Desktop.
Save vinioliveira/938965 to your computer and use it in GitHub Desktop.
.vimrc
#VIMRC To get background on gnome terminal black set this on .vimrc
"Change this to get work Arrow issues from gnome-terminal.
set term=xterm-256color
"Disable backup of files that are been edited.
set nobackup
set nowritebackup
set noswapfile
"set nocompatible
"Color default
colorscheme grb3
highlight Normal ctermbg=Black ctermfg=blue
"This hack change the color of cursor to gnome terminal,
"since gnome-terminal doesn't change the cursor style when it shift to
" insert mode.
if &term =~ "xterm\\|rxvt"
:silent !echo -ne "\033]12;red\007"
let &t_SI = "\033]12;orange\007"
let &t_EI = "\033]12;red\007"
autocmd VimLeave * :!echo -ne "\033]12;red\007"
endif
" This surround the current line with a different color. Just to let you know
" Which line you are
set cursorline
" Allow backgrounding buffers without writing them, and remember marks/undo
" for backgrounded buffers
set hidden
" Remember more commands and search history
set history=1000
" Make tab completion for files/buffers act like bash
set wildmenu
" Make searches case-sensitive only if they contain upper-case characters
set ignorecase
set smartcase
" Keep more context when scrolling off the end of a buffer
set scrolloff=3
" allow backspacing over everything in insert mode
set backspace=indent,eol,start
" GRB: Put useful info in status line
:set statusline=%<%f%=\ [%1*%M%*%n%R%H]\ %-19(%3l,%02c%03V%)%O'%02b'
:hi User1 term=inverse,bold cterm=inverse,bold ctermfg=red
" GRB: clear the search buffer when hitting return
:nnoremap <CR> :nohlsearch<CR>/<BS>
" Always show tab bar
set showtabline=2
" Custom shortcut
" Find comment
map <leader>/# /^ *#<cr>
" Find function
map <leader>/f /^ *def\><cr>
" Find class
map <leader>/c /^ *class\><cr>
" Find if
map <leader>/i /^ *if\><cr>
" Delete function
" \%$ means 'end of file' in vim-regex-speak
map <leader>df d/\(^ *def\>\)\\|\%$<cr>
com! FindLastImport :execute'normal G<CR>' | :execute':normal ?^\(from\|import\)\><CR>'
map <leader>/m :FindLastImport<cr>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment