Live data from Hacker News

Vim Creep

rudism.com

61–70 of 237 posts

Re: Vim Creep

#61

I've said it before, and I'll say it again... Editing text is a solved problem: vim or emacs. Pick one and get back to work.

Although I agree with you, IDE fans feel the same way: "Writing code is a solved problem: eclipse or xcode or visual studio. Pick one based on your environment and get back to work"

An argument I hear a lot is: 'vim is fine for editing files on a remote server, but not suitable for everyday work'. I believe it is a common belief outside of the HN crowd.

Re: Vim Creep

#62
post #51

I've said it before, and I'll say it again... Editing text is a solved problem: vim or emacs. Pick one and get back to work.

While vim is very cool, there is certainly a lot of room for improvement. vim's codebase doesn't look like something that I would like to hack, and don't try to tell me that things like vim plugins or vimscript are supposed to be the best that we can ever hope to do.

I'm not trying to tell you anything about the codebase, vim plugins, or vimscript.

I'm trying to tell you that it's probably a waste of your time to agonize over text editors, when there are two very powerful editors available to you, with decades of development and refinement, millions of active users, hundreds or thousands of contributions of plugins and scripts and support tools, copious documentation and examples, and the tools you need to embark on any text editor task you may have without ever feeling limited by the editor (assuming you have learned your editor).

Do you want to work on your software, or do you want to work on text editor scripts? Sure, sometimes you need to write a macro or script or something...but, I can count the lines of vim code I've written in my entire 20+ years of programming on my fingers and toes (if I count vimrc stuff, it'll require a few other people's fingers and toes, but it's still statistically zero compared the amount of code and docs I've written in that time).

I'll leave it to Bram Moollenaar figure out how to improve vim. He's added Python support to vim years ago. Is Python really insufficient for you? I've never needed it, but if I were making something big for vim, I'd probably look into it. But, again, I'd rather be working on the stuff I'm passionate about. Editing text is not a problem I'm excited about; if it's your bag, that's great. But, for the rest of us, it's just a form of procrastination to fiddle and futz around with new tools when the old ones are more than sufficient (and probably superior, on the whole, to new ones...sure, TextMate is super-badass and awesome; but it's missing tons of capabilities that vim and emacs have, and you'd probably be better off learning how to maximize your efficiency in those more powerful editors, than learning new tools which will come and go).

Re: Vim Creep

#63
post #42
post #34

Earlier quoted context omitted.

You really have to sit down and see a vim user work to start to understand. In vim you don't just move around with arrows, then delete and then replace the text you want. What happens is you can use noun-verb associations to do things. For example on a line like this: var foo = "bar"; I could be at the beginning of the line and type the following keys to change the inside of the quotation marks: ci"baz In sublime I w…

Actually you can do it with: - , , , baz And considering you didn't have to press : beforehand, it can be just as fast. I'm a vim user, but using it for something like Objective-C in place of the wonderful autocomplete in Xcode would be a totally dumb thing to do. It's simply not smart enough to improve my productivity, even with the slight speed increases with text-manipulation.

That's why I switched to AppCode for Objective-C code editing. It has pretty good Vim bindings plugin, and you still have an autocomplete.

Re: Vim Creep

#64

This feels like an article about a religion or cult, not a software program. I just don't get it. Ever since newer editors got block editing or multiple insertion cursors, and RegEx find & replace across multiple files, and searching filenames to open... I feel like I've already got everything I need! What am I missing out on? I don't feel like my text editor holds back my productivity. Using something like Sublime,…

Not only that, it's also a point of view on computers/computing. Automate everything. Kinda like lisp macros. When you refine these manners you gain reduce workload, boilerplate, and focus on fundamental issues.

Re: Vim Creep

#65
post #34

Earlier quoted context omitted.

You really have to sit down and see a vim user work to start to understand. In vim you don't just move around with arrows, then delete and then replace the text you want. What happens is you can use noun-verb associations to do things. For example on a line like this: var foo = "bar"; I could be at the beginning of the line and type the following keys to change the inside of the quotation marks: ci"baz In sublime I w…

If you're into that sort of thing, you can do Ctrl + F, bar in Sublime too. Most of the comparisons in this discussion between vim and non vim demonstrate high proficiency in vim, but not as much elsewhere. Of course you are more proficient in the tool you know best.

Does your example include the action of deleting bar with baz?

Also, not having to move away from the home row makes me feel much faster. Having to use Alt/Control/Arrows makes me cry. (I know you can't avoid Control in Vim, but in this example it is not required.)

ci"baz is 7 keystrokes, only one of which is a jump.

barbaz is 8 strokes and two jumps. It also requires typing the entire string in quotes. If the example were

var foo = "The quick brown fox jumps over the lazy dog";

The vim example would not change but yours would.

I'm not trying to be an a-hole, use what you like, I'm just saying, that for me the attraction to vim is the strive toward the minimization of keystrokes, especially ones that require me to move my hands.

Re: Vim Creep

#66
post #20

Can we all stop patting ourselves on the back for being vim badasses now? Yes, its a fantastic editor. Yes, its probably going to make you more productive. Yes, its every bit as capable as any other IDE or editor out there. No, it will not make you a better person. No, mastery of vim does not make you fart sunshine. No, it won't make you an enlightened buddha.

I think it's more about mastering tools with a high learning curve. It's our trade; it's fun to feel good about it.

I like to remind people that the flipside of a steep learning curve is a high payoff function. If you can exhaust a tool's potential in a day, or a week, or a month, it really doesn't have much to offer you.

Re: Vim Creep

#67
post #38

Earlier quoted context omitted.

Can you explain to me what apropos does?

$ man apropos apropos searches a set of database files containing short descriptions of system commands for keywords and displays the result on the standard output. It answers the question "I wonder how to do [this English word]." For example: "I wonder how I copy a file." $ apropos copy Dumps out all of the matching entries from the man pages for the word "copy". If you just wanted general commands, as opposed to li…

Instead of using `grep "(1)"`, use the `-s` switch:

    $ apropos -s1 copy
    bsdcpio (1)          - copy files to and from archives
    cp (1)               - copy files and directories
    dd (1)               - convert and copy a file
    ....

Re: Vim Creep

#68

Earlier quoted context omitted.

I don't understand vimmers, but I use Emacs and I can say that having your work environment be 100% programmable is pretty damned nice.

So what kind of stuff do you program inside of it? What kinds of problems do you solve? I mean, I've never really felt the need to program an add-on to text editor. I download syntax highlighting packages, and there are common macros like "remove trailing whitespace" already installed. Keyboard shortcuts can be changed in lots of editors and OS's. In the past, I've definitely been upset that a particular editor didn'…

I can't answer your whole question or we'll be here all day. Here's one important example, which has the advantage of applying in vim as well as emacs:

"Common" macros are the least interesting. The most interesting macros are the ones with no name, the one-time ones that you build on the fly. You have a file with ten thousand lines of:

  foo.rb
  bar.rb
  baz.rb
  …
  … [9997 more lines like these]
and you need to turn the file into something like this:

  // Run the foo command
  def foo()
  end

  // Run the bar command
  def bar()
  end

  // Run the baz command
  def baz()
  end

  … [9997 more blocks like these ]
That's 56 keystrokes in emacs: You record a macro that transforms one line appropriately, then execute it 9999 more times, all on the fly in about twenty seconds.

Re: Vim Creep

#69

Earlier quoted context omitted.

I don't understand vimmers, but I use Emacs and I can say that having your work environment be 100% programmable is pretty damned nice.

So what kind of stuff do you program inside of it? What kinds of problems do you solve? I mean, I've never really felt the need to program an add-on to text editor. I download syntax highlighting packages, and there are common macros like "remove trailing whitespace" already installed. Keyboard shortcuts can be changed in lots of editors and OS's. In the past, I've definitely been upset that a particular editor didn'…

I can't answer your whole question or we'll be here all day. Here's one important example, which has the advantage of applying in vim as well as emacs:

"Common" macros are the least interesting. The most interesting macros are the ones with no name, the one-time ones that you build on the fly. You have a file with ten thousand lines of:

  foo.rb
  bar.rb
  baz.rb
  …
  … [9997 more lines like these]
and you need to turn the file into something like this:

  // Run the foo command
  def foo()
  end

  // Run the bar command
  def bar()
  end

  // Run the baz command
  def baz()
  end

  … [9997 more blocks like these ]
That's 56 keystrokes in emacs: You record a macro that transforms one line appropriately, then execute it 9999 more times, all on the fly in about twenty seconds. I did this, then put the results into a buffer ('kmacro-edit-macro') so that I could paste the macro here:

    C-x (       ;; kmacro-start-macro
    C-a	        ;; move-beginning-of-line
    C-s	        ;; isearch-forward
    .rb	
    RET	        ;; newline
    C-k	        ;; kill-line
    C-SPC	;; set-mark-command
    C-a	        ;; move-beginning-of-line
    C-x C-k	;; kill-region
    // Run the  
    C-y	        ;; yank
     command
    RET	        ;; newline
    def 
    C-y	        ;; yank
    ()
    RET	        ;; newline
    end
    RET	        ;; newline
    C-n	        ;; next-line
    C-x )       ;; kmacro-end-macro (49 keystrokes so far)

    C-u 9999 C-x e    ;; run the above macro 9999 times
This isn't all that special. If your editor can't do this, I suggest finding one that can. Emacs or vi are good choices. I haven't had to change editors since adopting emacs twelve years ago.

Re: Vim Creep

#70
post #65

Earlier quoted context omitted.

If you're into that sort of thing, you can do Ctrl + F, bar in Sublime too. Most of the comparisons in this discussion between vim and non vim demonstrate high proficiency in vim, but not as much elsewhere. Of course you are more proficient in the tool you know best.

Does your example include the action of deleting bar with baz? Also, not having to move away from the home row makes me feel much faster. Having to use Alt/Control/Arrows makes me cry. (I know you can't avoid Control in Vim, but in this example it is not required.) ci"baz is 7 keystrokes, only one of which is a jump. bar baz is 8 strokes and two jumps. It also requires typing the entire string in quotes. If the examp…

No, good point. You'd then have to type "baz".

However, if I was actually faced with this problem, I'd use End, Ctrl + Left, Ctrl + D, baz, which is a total of 7 keystrokes. (if you don't release Ctrl)

The vim example was 8 keystrokes. (" is shift + ') I have no doubt that you could manufacture an example that shows a benefit for vim, but I think that the advantages are overestimated by heavy vim users.

Edit: Your longer string example is a good example of a task that's more efficient in vim.

Post reply on HN