Live data from Hacker News

Efficient Editing With vim

jmcpherson.org

21–30 of 125 posts

Re: Efficient Editing With vim

#21
post #14

Warning: learning Vim makes you look for Vim like commands in any program you interact with using the keyboard. Everything else will be frustrating.

20-year user of vi here... yes, once you get used to vi, going back to an editor for humans is hard.

Re: Efficient Editing With vim

#22
I find it amusing that he asserts "blockwise selection mode. Extremely powerful and available in very few other editors".

Blockwise selection mode is available in almost every Windows editor I use - from the Delphi IDE, Visual Studio, even to Notepad2, Shift+Alt does block selection, or alternatively Alt + mouse selection.

Re: Efficient Editing With vim

#23
post #14

Warning: learning Vim makes you look for Vim like commands in any program you interact with using the keyboard. Everything else will be frustrating.

I would kill for GMail to add vim-like text editing.

Have you heard of the "It's All Text" Firefox extension? It copies the content of any textarea to a tempfile and opens it up in an external editor of your choice. Writes to the tempfile are copied back to the textarea. It's not quite in-browser vim, but it's pretty close. https://addons.mozilla.org/en-US/firefox/addon/4125

Re: Efficient Editing With vim

#24
post #13

Earlier quoted context omitted.

gt and gT in command mode also do next tab and previous tab

also #gt will go that tab number. I've changed my tab text to show the number in parenthesis before the name.

That's a neat idea. How do you change it to show tab number in the tab header?

Re: Efficient Editing With vim

#26
post #8

Nooooo all of the secrets of our vim cult revealed in one easy-to-read document! Vim is hard, people! Trust me. You're not smart enough to use it. :-P

Actually, I find that Emacs has a steeper learning curve than Vi/Vim. I had an easier time learning to switch between command/insert modes than to try and get comfortable with all of the Meta-/Control- sequences in Emacs.

{edit} not to start a flame war.. to each their own {/edit}

Re: Efficient Editing With vim

#27
post #13

Earlier quoted context omitted.

also #gt will go that tab number. I've changed my tab text to show the number in parenthesis before the name.

That's a neat idea. How do you change it to show tab number in the tab header?

This is for GVIM.

  set guitablabel=(%N%M)\ %f

Re: Efficient Editing With vim

#28
post #19
post #14

Warning: learning Vim makes you look for Vim like commands in any program you interact with using the keyboard. Everything else will be frustrating.

By force of habit, when I wanted to close an IM window, I have typed :q Instead of switching to the mouse and hitting the "x". Then I had to explain to the person that I wasn't sticking my tongue out at them.

I once wrote ":tabnew something.js" in my IM window and sent it before I realized that the wrong window had focus. The person replied with, "bash: :tabnew: command not found." I told him, "I was hoping you were vim, actually".

Re: Efficient Editing With vim

#29
post #7

Amazingly, this is the first I've heard of fx/tx/Fx. How ridiculously awesome.

This is especially powerful when trying to move small chunks of code around. Say you have something like document.getElementById('asweetid') and you want to grab just the id for use elsewhere. In command mode pressing f' will move your cursor to the quote, yf' will put 'asweetid' into your yank register and a p anywhere else will paste it. I also make heavy use of ctx where x is a character on a line that I want to r…

Yeah, I use 'dt,' or 'dt)' all the time to move single arguments of functions around, and 'd%' to move the function calls themselves.

Re: Efficient Editing With vim

#30
post #17
post #5

I think it's the first time that I want to install vim to try it. As a Windows user, I always found NotePad++ and other text editor an easier choice but I can now see some powerfull utilities to vim now. Very clear article.

(I'm just throwing tips in comments where I see opportunities to help people who find any of the same niggles I've had over the years.) Users who want to run Windows vim with no titlebar, create a file _vimrc in your base vim directory (on my windows desktop it's C:\Program Files\Vim). In this, put this line: set guioptions-=T

You can control a lot of things with guioptions. I would recommend doing a:

  :help guioptions
Post reply on HN