Skip to content

Instantly share code, notes, and snippets.

@pthrasher
Created October 19, 2012 15:49
Show Gist options
  • Save pthrasher/3918966 to your computer and use it in GitHub Desktop.
Save pthrasher/3918966 to your computer and use it in GitHub Desktop.
Things necessary for my vim workflow
  1. Remap ; to : so I don't have to hit shift for getting into command mode.
  2. Remap jf to so that I can quickly exit insert mode.
  3. Fuzzy finding with ctrlp (install the plugin from kien/ctrlp.vim)
  4. Easy vsplit creation and navigation
    • ,v to create a new vsplit
    • ctrl-h to move into one vsplit to the left
    • ctrl-l to move into one vsplit to the right
    • ctrl-j to move into one hsplit below
    • ctrl-k to move into one hsplit up
  5. Remap ,, to switching between the two most recently used buffers
  6. 4 space soft tabs
  7. Home and end for non-whitespace chars
" For #1 and #2
nnoremap ; :
inoremap jf <esc>

" For #4
nnoremap ,v <c-w>v
nnoremap <C-h> <C-w>h
nnoremap <C-j> <C-w>j
nnoremap <C-k> <C-w>k
nnoremap <C-l> <C-w>l

" for #5
nnoremap ,, <c-^>

" for #6
set tabstop=4
set shiftwidth=4
set softtabstop=4
set expandtab " use spaces instead of tabs.
set smarttab " let's tab key insert 'tab stops', and bksp deletes tabs.
set shiftround " tab / shifting moves to closest tabstop.

" for #7
noremap H ^
noremap L g_
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment