Created
November 4, 2011 19:29
-
-
Save chyld/1340259 to your computer and use it in GitHub Desktop.
vimrc file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" http://vimdoc.sourceforge.net/htmldoc/options.html | |
set nocompatible | |
syntax on | |
filetype plugin indent on | |
filetype indent on | |
set number " turn on line numbering | |
set wrap! " turn off word wrapping | |
set smartindent " enable smart indent | |
set tabstop=2 " set tab character | |
set expandtab " turn tabs into whitespace | |
set shiftwidth=2 " indent width for autoindent | |
set ruler " show the cursor position | |
" turn on incremental search with ignore case | |
set incsearch | |
set ignorecase | |
set smartcase | |
" turn on utf-8 file encoding | |
set encoding=utf-8 | |
set fileencoding=utf-8 | |
" showing match pairs and display time | |
set showmatch | |
set mat=5 | |
" show trailing spaces | |
set list listchars=tab:»·,trail:• | |
" highlights current line | |
set cursorline | |
" increase spacing between lines | |
set linespace=3 | |
" colors | |
syntax enable | |
set background=dark | |
colorscheme solarized | |
" strip all trailing whitespace | |
nmap <leader>s :let _s=@/<Bar>:%s/\s\+$//e<Bar>:let @/=_s<Bar>:nohl<CR> | |
" show/hide nerdtree | |
nmap <leader>n :NERDTreeToggle<CR> | |
" show/hide bufexplorer | |
nmap <leader>b :BufExplorer<CR> | |
" :retab = convert tabs to spaces, \s = strip trailing whitespace, :w = save | |
nmap <leader>w :retab<CR>\s:w<CR> | |
" search files using ack, do not open first result | |
nmap <leader>a <Esc>:Ack! | |
" cycle through window | |
nmap <Tab> <C-w>w | |
" create windows | |
nmap <C-h> :split<CR> | |
nmap <C-v> :vsplit<CR> | |
" buffer movements | |
nmap <C-Left> :bprev<CR> | |
nmap <C-Right> :bnext<CR> | |
" shortcuts | |
" \w - strip all whitespace, tabs and save | |
" \n - nerdtree | |
" \b - bufexplorer | |
" \t - filename search | |
" \a - ack search | |
" plugins | |
" nerdtree . https://github.com/scrooloose/nerdtree | |
" rails . https://github.com/tpope/vim-rails | |
" bufexplorer . http://www.vim.org/scripts/script.php?script_id=42 | |
" command-t . https://wincent.com/products/command-t | |
" ack . https://github.com/mileszs/ack.vim |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment