Skip to content

Instantly share code, notes, and snippets.

@tskrynnyk
Created January 29, 2015 18:51
Show Gist options
  • Select an option

  • Save tskrynnyk/795cb7de06abd5e48ad0 to your computer and use it in GitHub Desktop.

Select an option

Save tskrynnyk/795cb7de06abd5e48ad0 to your computer and use it in GitHub Desktop.
ViM Tips
  • http://vim-tips-blog.blogspot.com/2010/02/vim-folding-away-unwanted-textcode.html

    " folding : hide sections to allow easier comparisons
    zf} : fold paragraph using motion
    v}zf : fold paragraph using visual
    zf'a : fold to mark
    zo : open fold
    zc : re-close fold
    :help folding
    

    the folds I used a) move to beginning of code I wish to work on and everything before

    zf1G : fold all lines from current line to beginning of the file
    

    a) move to end of code I wish to work on and everything after

    zfG
    
  • http://www.reddit.com/r/vim/comments/ni0c2/vim_for_prose_what_are_your_tips/c39d88v

    I like adding the following mappings

    inoremap . .<C-g>u
    inoremap ! !<C-g>u
    inoremap ? ?<C-g>u
    inoremap : :<C-g>u
    

    The C-g u sets an undo point, so this has the effect of letting me type for a while and have undo just revert one sentence at a time, instead of everything I've typed since entering insert mode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment