Skip to content

Instantly share code, notes, and snippets.

@kaplan
Last active August 29, 2015 14:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kaplan/d563fcbbb1b4370d2659 to your computer and use it in GitHub Desktop.
Save kaplan/d563fcbbb1b4370d2659 to your computer and use it in GitHub Desktop.
Handy Vim Reference

vim handy commands and references

commands

:e.       # list current directory  
:bd       # leave a directory listing
:put +    # paste from clipoard, this works 
"+p       # paste while in normal mode from clipboard
u         # undo in normal mode
ctrl+r    # redo in normal mode

commands with leader

the leader has been mapped to ,
for example, typing ,r and ruby will execute on the current file

" double percentage sign in command mode is expanded
" to directory of current file - http://vimcasts.org/e/14
cnoremap %% <C-R>=expand('%:h').'/'<cr>
map <leader>ew :e %%
map <leader>es :sp %%
map <leader>ev :vsp %%
map <leader>et :tabe %%

####references 100 vim commands
Stackoverflow: Leaders
Vimscript Hardway: Leaders

Vimcast: Leader
Vimcast: Update vimrc on the fly
Vimcast: Plugin Management
Vimcast: system clipboard

Vim 101: Registers
Colorschemes
Plugin Management
Pathogen Post

Clipboard Access
stackoverflow cutting and pasting from tmux and vim
stackoverflow fix yank + paste tmux and vim

best solution for clipbard access while in tmux
chris johnson's patch for tmux macosx pasteboard

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