Live data from Hacker News

Mastering Vim in Vim

nerds.weddingpartyapp.com

21–30 of 34 posts

Re: Mastering Vim in Vim

#22
Are there any other modal text editors in wide use?

All others I can think of have you strongly in one mode (insertion, typing) and you only drop out of it if you hold down a command key (Control, or pull down a menu, etc.). Before GUIs it was a lot more common to have 'entry mode' and command mode in your text editor/word processor, but vim is the only one I know of now where 'insert' is merely one mode, and by default you're in a movement/command mode.

Not saying it's bad; I spend most of my day in vim and wouldn't have it any other way.

Re: Mastering Vim in Vim

#23
Most of the commands are suited for a en_US keyboard only, do you know a .vimrc that is optimized for a de_DE keyboard?

Re: Mastering Vim in Vim

#24
post #7

For me, a GUI editor is always preferred over Vim. But when I have to use CLI editors, Vim is the best. That's why I will never master in Vim. Because files that I edit most are hosted locally

I suppose it depends what you're coding. For Objective-C I use xCode. For Android I use Android Studio. They provide many key affordances because they are tuned to their particular use cases. However, if I'm writing in shell, Ruby, JavaScript, or any other oddball language without a purpose-built IDE, a well-tuned Vim setup, and extensive familiarity with how to use it, works wonders.

There's a plugin called 'ideavim' for android studio (and all jetbrains editors). I use it in webstorm and intellij and it works great, gives you the best of both worlds.

Re: Mastering Vim in Vim

#26
post #7

For me, a GUI editor is always preferred over Vim. But when I have to use CLI editors, Vim is the best. That's why I will never master in Vim. Because files that I edit most are hosted locally

I suppose it depends what you're coding. For Objective-C I use xCode. For Android I use Android Studio. They provide many key affordances because they are tuned to their particular use cases. However, if I'm writing in shell, Ruby, JavaScript, or any other oddball language without a purpose-built IDE, a well-tuned Vim setup, and extensive familiarity with how to use it, works wonders.

There's a plugin called XVim for Xcode that provides the best of both worlds IMO.

https://github.com/JugglerShu/XVim

Re: Mastering Vim in Vim

#27
post #7

For me, a GUI editor is always preferred over Vim. But when I have to use CLI editors, Vim is the best. That's why I will never master in Vim. Because files that I edit most are hosted locally

vim is a full screen editor, not a command line editor (CLI), are you thinking of sed, instead?

Re: Mastering Vim in Vim

#28
post #23

Most of the commands are suited for a en_US keyboard only, do you know a .vimrc that is optimized for a de_DE keyboard?

I'm serious: Are you really comfortable with that layout? I mean, most programmin related symbols are hard to reach in my world.. I'm on en_US just because of that.

Re: Mastering Vim in Vim

#29

Earlier quoted context omitted.

Used to be the same with me. Then I got a Mac and realized that some keys are missing. My goal was then to learn how to do the stuff that I commonly do in GUI editors: edit multiple files at the same time, copy&paste code around, navigate through the file system conveniently... Googling for these things took some time but now I'm pretty fluent in vim. Also I like the workflow having vim open and then ^Z into the comm…

Even better than ^Z to run tests is temporarily mapping a key combination to run them. For instance, I'll do :map ,t :w\|!rspec which lets me type ,t in command mode to save the file and run the tests. Vim will show you the output of your command and then wait for you to press a key to return to Vim.

Actually, there are a bunch of plugins that will use a subshell to run this, and then bring it up when it's done so you can keep working while the tests run.

Not so important for a quick script but if your tests/compiling takes a few minutes, totally worth it.

Re: Mastering Vim in Vim

#30
post #23

Most of the commands are suited for a en_US keyboard only, do you know a .vimrc that is optimized for a de_DE keyboard?

Which commands are you having trouble with? I'm using the Colemak keyboard layout and have no problems.
Post reply on HN