Added splitjoin plugin. Use sj and sk to split and join hashes into multiple lines.

This commit is contained in:
yan 2011-12-18 01:38:03 -08:00 committed by Yan Pritzker
parent 33cdf98c49
commit 8e68cbeac0
4 changed files with 17 additions and 7 deletions

3
.gitmodules vendored
View File

@ -166,3 +166,6 @@
[submodule "vim/bundle/godlygeek-tabular"]
path = vim/bundle/godlygeek-tabular
url = https://github.com/godlygeek/tabular
[submodule "vim/bundle/AndrewRadev-splitjoin"]
path = vim/bundle/AndrewRadev-splitjoin
url = https://github.com/AndrewRadev/splitjoin.vim

View File

@ -217,6 +217,10 @@ files contain key mappings as well (TODO: probably will move them out to skwp-ke
* Cmd-/ - toggle comments (usually gcc from tComment)
* gcp (comment a paragraph) added
* ,t - Command-T fuzzy file selector (alternative to PeepOpen / LustyJuggler)
* sj - split a line such as a hash {:foo => {:bar => :baz}} into a multiline hash (j = down)
* sk - unsplit a link (k = up)
* Ctrl-a - align things (type a character/expression to align by, works in visual mode or by itself)
* sj and sk - split and unsplit things (like ruby hashes) into multiple lines
**Local Anonymous Bookmarking**
@ -262,7 +266,8 @@ Included vim plugins
**Utils**
* tabularize - align code effortlessly by using :Tabularize /[character] to align by a character, or try the mappings ,a= and ,a: to align by equals or colons
* SplitJoin - easily split up things like ruby hashes into multiple lines or join them back together. Try :SplitjoinJoin and :SplitjoinSplit or use the bindings sj(split) and sk(unsplit) - mnemonically j and k are directions down and up
* tabularize - align code effortlessly by using :Tabularize /[character] to align by a character, or try the keymaps
* yankring - effortless sanity for pasting. every time you yank something it goes into a buffer. after hitting p to paste, use ctrl-p or ctrl-n to cycle through the paste options. great for when you accidentally overwrite your yank with a delete
* surround - super easy quote and tag manipulation - ysiw" - sourround inner word with quotes. ci"' - change inner double quotes to single quotes, etc
* greplace - use :Gsearch to find across many files, replace inside the changes, then :Greplace to do a replace across all matches

@ -0,0 +1 @@
Subproject commit 9896c3a62514ca0a2902acf37398ddc36fbcaa8f

View File

@ -158,15 +158,16 @@ nnoremap <D-*> :let @/='\<<C-R>=expand("<cword>")<CR>\>'<CR>:set hls<CR>
nnoremap ' `
nnoremap ` '
" Tabularization. Hit ,a then type a character you want to align by
" The mnemonic is 'a' for align
" Tabularization. Hit Ctrl-a then type a character you want to align by
if exists(":Tabularize")
nmap ,a= :Tabularize /=<CR>
vmap ,a= :Tabularize /=<CR>
nmap ,a: :Tabularize /:\zs<CR>
vmap ,a: :Tabularize /:\zs<CR>
nmap <C-a> :Tabularize /
vmap <C-a> :Tabularize /
endif
" ===
" SplitJoin plugin
nmap sj :SplitjoinSplit<cr>
nmap sk :SplitjoinJoin<cr>
" ============================
" VimBookmarking