💾 Archived View for bbs.geminispace.org › s › vim › 2639 captured on 2023-11-14 at 09:05:56. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2023-11-04)

➡️ Next capture (2023-12-28)

🚧 View Differences

-=-=-=-=-=-=-

TIPS

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

https://vim.fandom.com/wiki/Vim_Tips_Wiki

https://itsfoss.com/pro-vim-tips/

Posted in: s/vim

🚀 stack

Jul 01 · 4 months ago

6 Comments ↓

☕️ johan · Jul 01 at 14:44:

Two basic features I love in vim are Ctrl-V/Shift-V for block/linewise visual mode, and also running shell commands on that selection with :! vim plays so well with the unix philosophy.

🚀 stack · Jul 01 at 18:21:

Revert/reload file

```

":edit!" or just ":e!"


🚀 totroptof · Jul 01 at 19:01:

I was thinking about saying this as a joke, but in thinking about it I realised it was a tip that I received that was actually genuinely useful to me. My best Vim tip is: use Emacs with EVIL instead. As a long-time Vim user EVIL is a good enough emulation for me to feel comfortable whilst getting the benefits of Emacs’ better programming models/APIs and all the excellent features people have written for it.

🧶 mouseless · Jul 06 at 09:34:

Something I use a lot and find useful, as someone who knows the basics of vim and not much more:

gg=G

What it does is go to the beginning of the file (gg), and redo your indentation (=) to the end of the file (G). Super handy, but is probably old news to most people here.

🚀 stack · Jul 16 at 21:42:

Insert Date

r!date

🚀 stack · Jul 25 at 22:41:

From: 👻 simul8

My favorites are:

gq - autoformat/wrap lines

di( or di{ or di< or di[ - deletes everything between braces

. - performs last editing action (macro)

q - sets macro

visual-mode - great for commenting out a block of code

And the best key sequence that I wish vim tutorials would cover is....

ctrl-c - It's the touch-typist friendly equivalent to esc.