Skip to content

Instantly share code, notes, and snippets.

@hanshasselberg
Last active September 30, 2015 22:07
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hanshasselberg/1869118 to your computer and use it in GitHub Desktop.
Save hanshasselberg/1869118 to your computer and use it in GitHub Desktop.
Vim configuration
set nocompatible
filetype off
call pathogen#helptags()
call pathogen#runtime_append_all_bundles()
set nobackup
set nowritebackup
set noswapfile
set history=1000
set ruler
set showcmd
set incsearch
set nohlsearch
set tabstop=2
set shiftwidth=2
set expandtab
set laststatus=2
set colorcolumn=80
set wildmode=longest,full
set mouse=a
set shell=bash
set backspace=indent,eol,start
set synmaxcol=800
"""""""""""""""""""""""""""""""""""""""""""""
" Look
"""""""""""""""""""""""""""""""""""""""""""""
filetype plugin indent on
syntax on
colorscheme solarized
set background=dark
let g:Powerline_symbols = 'fancy'
let g:Powerline_theme='skwp'
let g:Powerline_colorscheme='skwp'
"""""""""""""""""""""""""""""""""""""""""""""
" MAPPINGS
"""""""""""""""""""""""""""""""""""""""""""""
let mapleader = " "
map <Leader>ew :e <C-R>=expand("%:p:h") . "/" <CR>
map <Leader>et :tabe <C-R>=expand("%:p:h") . "/" <CR>
map <Leader>ev :vs <C-R>=expand("%:p:h") . "/" <CR>
imap <c-c> <esc>
noremap j gj
noremap k gk
noremap gj j
noremap gk k
" Keep the cursor in place while joining lines
nnoremap J mzJ`z
nnoremap <leader>gd :Gdiff<cr>
nnoremap <leader>gs :Gstatus<cr>
nnoremap <leader>gb :Gblame<cr>
"""""""""""""""""""""""""""""""""""""""""""""
" Autocommands
"""""""""""""""""""""""""""""""""""""""""""""
" Strip off whitespaces for *.rb and *.md
autocmd BufWritePre *.rb :%s/\s\+$//e
autocmd BufWritePre *.md :%s/\s\+$//e
" Resize splits when the window is resized
au VimResized * :wincmd =
" Resume where left
autocmd BufReadPost *
\ if line("'\"") > 0 && line ("'\"") <= line("$") |
\ exe "normal g'\"" |
\ endif
~ ls .vim/bundle
Command-T vim-bundler vim-rails vim-unimpaired
ack.vim vim-colors-solarized vim-rake vim-vroom
matchit vim-commentary vim-repeat
update.sh vim-fugitive vim-ruby
vim-abolish vim-powerline vim-surround
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment