Live data from Hacker News

Vim Recipes

vim.runpaint.org

1–10 of 28 posts

Re: Vim Recipes

#2
This is pretty nice! My wish for these types of things - can you just put out a big list key combos to browse through? I know the basic concepts of vim but I just want to see how the commands can be strung together. Something like:

- ggVG: highlight the whole file

- jj: escape (this is in my .vimrc, not standard)

- xp: swap letters

- vab: highlight an s-exp (inluding the parens)

- gt: go to the next tab to the right

- gT: go to the next tab to the left

- :tabnew: open a new tab (you can also add a file after that)

- daw: delete a word

- das: deletes the sentence under the cursor

- dap: deletes the paragraph under the cursor

- vas: selects the sentence under the cursor

- ci(: deletes the inner content of a parens, puts you in insert mode

- q[key][whatever]q: records a macro

- @[key]: plays back the macro

- ZZ: save and close the current window

Re: Vim Recipes

#3
post #2

This is pretty nice! My wish for these types of things - can you just put out a big list key combos to browse through? I know the basic concepts of vim but I just want to see how the commands can be strung together. Something like: - ggVG: highlight the whole file - jj: escape (this is in my .vimrc, not standard) - xp: swap letters - vab: highlight an s-exp (inluding the parens) - gt: go to the next tab to the right…

Read this: http://stackoverflow.com/questions/1218390/what-is-your-most...

Then go to your nearest vim and do an

:he navigation

and

:he change.txt

to get a fantastic overview.

Re: Vim Recipes

#4
post #2

This is pretty nice! My wish for these types of things - can you just put out a big list key combos to browse through? I know the basic concepts of vim but I just want to see how the commands can be strung together. Something like: - ggVG: highlight the whole file - jj: escape (this is in my .vimrc, not standard) - xp: swap letters - vab: highlight an s-exp (inluding the parens) - gt: go to the next tab to the right…

This is pretty comprehensive:

http://www.rayninfo.co.uk/vimtips.html

Re: Vim Recipes

#6
post #2

This is pretty nice! My wish for these types of things - can you just put out a big list key combos to browse through? I know the basic concepts of vim but I just want to see how the commands can be strung together. Something like: - ggVG: highlight the whole file - jj: escape (this is in my .vimrc, not standard) - xp: swap letters - vab: highlight an s-exp (inluding the parens) - gt: go to the next tab to the right…

Read this: http://stackoverflow.com/questions/1218390/what-is-your-most... Then go to your nearest vim and do an :he navigation and :he change.txt to get a fantastic overview.

Honestly, just reading through the help system in general is fascinating.

Re: Vim Recipes

#7
post #2

This is pretty nice! My wish for these types of things - can you just put out a big list key combos to browse through? I know the basic concepts of vim but I just want to see how the commands can be strung together. Something like: - ggVG: highlight the whole file - jj: escape (this is in my .vimrc, not standard) - xp: swap letters - vab: highlight an s-exp (inluding the parens) - gt: go to the next tab to the right…

I've collected some of my favorites at http://vimtweets.com, pushed through http://twitter.com/vimtips Monday through Friday. I would judge most of them as "more advanced", for lack of a less judgmental-sounding term, but I hope you'll find them useful, anyway.

Re: Vim Recipes

#8
post #6

Earlier quoted context omitted.

Read this: http://stackoverflow.com/questions/1218390/what-is-your-most... Then go to your nearest vim and do an :he navigation and :he change.txt to get a fantastic overview.

Honestly, just reading through the help system in general is fascinating.

True. People often underestimate the comprehensiveness of vim's :help. Maybe (and this is conjecture) it's because other utilities lack thorough help documentation.

Re: Vim Recipes

#9
post #6

Earlier quoted context omitted.

Read this: http://stackoverflow.com/questions/1218390/what-is-your-most... Then go to your nearest vim and do an :he navigation and :he change.txt to get a fantastic overview.

Honestly, just reading through the help system in general is fascinating.

Yeah I totally agree -- I find no end of amusement how a large portion of answers in #vim are simple :he $ANSWER. For a couple reasons actually:

1. Amazingly the documentation covers that odd topic!

2. Just knowing where to search is a big enough task a whole chatroom has essentially devoted itself to it.

3. No one thinks it odd that vim is a big enough, esoteric enough space that being a fancy search bot doesn't bother people.

:)

Re: Vim Recipes

#10
post #2

This is pretty nice! My wish for these types of things - can you just put out a big list key combos to browse through? I know the basic concepts of vim but I just want to see how the commands can be strung together. Something like: - ggVG: highlight the whole file - jj: escape (this is in my .vimrc, not standard) - xp: swap letters - vab: highlight an s-exp (inluding the parens) - gt: go to the next tab to the right…

Before I made a brief foray in the land emacs, I used tabs in VIM rather than leveraging the buffer system (I came from a Windows world, so I was used to tabs in other editors). Then emacs opened my eyes to magic of buffers, and when I returned to VIM (for various reasons), I found buffers to be better than tabs, especially once I first learned the commands, and then updated my .vimrc with a few useful shortcuts, particularly for split views.
Post reply on HN