Skip to content

Instantly share code, notes, and snippets.

@ncimino
Created April 23, 2013 22:38
Show Gist options
  • Save ncimino/5448014 to your computer and use it in GitHub Desktop.
Save ncimino/5448014 to your computer and use it in GitHub Desktop.
vimrc, my vim and gvim configuration
" This must be first, because it changes other options as side effect
set nocompatible
" Use pathogen to easily modify the runtime path to include all
" plugins under the ~/.vim/bundle directory
call pathogen#helptags()
call pathogen#runtime_append_all_bundles()
"Quickly edit/reload the vimrc file
nmap <silent> <leader>ev :e $MYVIMRC<CR>
nmap <silent> <leader>sv :so $MYVIMRC<CR>
" Lets current buffer to be backgrounded w/o writing
set hidden
set nowrap " don't wrap lines
set tabstop=2 " a tab is two spaces
set backspace=indent,eol,start
" allow backspacing over everything in insert mode
set autoindent " always set autoindenting on
set copyindent " copy the previous indentation on autoindenting
set number " always show line numbers
set shiftwidth=2 " number of spaces to use for autoindenting
set shiftround " use multiple of shiftwidth when indenting with '<' and '>'
set showmatch " set show matching parenthesis
set ignorecase " ignore case when searching
set smartcase " ignore case if search pattern is all lowercase,
" case-sensitive otherwise
set smarttab " insert tabs on the start of a line according to
" shiftwidth, not tabstop
set expandtab " change tab to spaces
set history=1000 " remember more commands and search history
set undolevels=1000 " use many muchos levels of undo
set wildignore=*.swp,*.bak,*.pyc,*.class
set title " change the terminal's title
set visualbell " don't beep
set noerrorbells " don't beep
" 'a goes to line with ma, this makes `a do the same
nnoremap ' `
nnoremap ` '
" use ; instead of :
" Leaders are personal modifier keys, may want to try spacebar
let mapleader=","
" Enables % to work with if/elsif/else/end
runtime macros/matchit.vim
" Show options with make file and command completion
"set wildmenu
set wildmenu=list:longer "shell completion style
" Keep 3 lines between cursor and edge
set scrolloff=3
" Store vim swaps to a specific tmp
set backupdir=~/.vim-tmp,~/.tmp,~/tmp,/var/tmp,/tmp
set directory=~/.vim-tmp,~/.tmp,~/tmp,/var/tmp,/tmp
" Scroll by 3 lines C+e,C+y,mouse
nnoremap <C-e> 3<C-e>
nnoremap <C-y> 3<C-y>
" Curser status
set ruler
" File-type highlighting and configuration.
" Run :filetype (without args) to see what you may have
" to turn on yourself, or just set them all to be sure.
syntax on
filetype on
filetype plugin on
filetype indent on
" Highlight search terms...
set hlsearch
set incsearch " ...dynamically as they are typed.
nmap <silent> <leader>n :silent :nohlsearch<CR>
" hide with n
" Make whitespace visible on request, s
set listchars=tab:>-,trail:·,eol:$
nmap <silent> <leader>s :set nolist!<CR>
" Stifle interruptive prompts
"set shortmess=atI
if &t_Co >= 256 || has("gui_running")
colorscheme asmanian2
endif
if &t_Co > 2 || has("gui_running")
" switch syntax highlighting on, when the terminal has colors
syntax on
endif
" toggle auto indent for pasting mode
set pastetoggle=<F2>
" mouse cheat
" set mouse=a
" auto-formatting
" Use Q for formatting the current paragraph (or selection)
vmap Q gq
nmap Q gqap
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment