Live data from Hacker News

Vim for Humans

vimebook.com

191–200 of 251 posts

Re: Vim for Humans

#191

Earlier quoted context omitted.

I just recently switched to vim full time, maybe 4 months ago, after my existing IDE switched to a subscription model following two updates that made the software more and more buggy. I don't have definitive answers, just experiences: 1. The first two weeks were hell. It felt like learning to use a keyboard all over again. I've tried to get started with vim multiple times, leaving because I needed something faster. T…

SublimeText allows you to edit text using vim modes as well.

Eh, Sublime's vim emulation is fairly terrible. There are a bunch of common commands missing, and it doesn't integrate well with some of Sublime's features.

For example, if you use tab-completion in insert mode, it records the action as what you actually typed rather than the completed text. So if you press . to repeat it somewhere else, it inserts the gibberish you actually typed. (And Sublime's fuzzy matching is really good, so that gibberish can be pretty bad...)

Re: Vim for Humans

#192
learn incredibly unintuitive fucked up shortcuts to perform basic tasks that a basic bullshit gui text editor can perform

cool

Re: Vim for Humans

#193
post #45

Earlier quoted context omitted.

Copy over one file (.vimrc) and you're done. If you use plugins, then copy them over with git or whatever. And my setup is very conservative so it's mild annoyance at worst. The defaults are just bad, I recommend using vim-sensible or doing your own lean and mean vim config.

As someone who only uses Vim casually, what's an example of a bad default? For someone who is new to Vim, they wouldn't know if the controls are bad, or tough to learn e.g. using jkl; instead of arrow keys.

It doesn't automatically `:set et sw=4 ts=4` in Python. When editing on a server, this can be downright annoying at best and deadly at worse, if you accidentally get a tab in the resulting out.

(We've started deploying something like vim-sensible, though I didn't know about vim-sensible, so I might start deploying that.)

Re: Vim for Humans

#194

It took me a while to realize what really vim is for. What led me to realization was switching to Emacs. I read this post, and second checkbox says "modern customizable IDE". And I stopped there. Why you may ask? Well, I used Vim for 3 years before trying Emacs this spring. And I loaded it with all the heavy plugins(YCM), but Emacs led me to realization that Vim is more of an editor than IDE. Even with plugins I thin…

I don't think it's true that vim "just doesn't even come close to Emacs" . They each have their strengths and weaknesses. As bad as the defaults for vim are, they're even worse in emacs (IMO) -- especially for former vim users (though I haven't tried spacemacs, which is supposed to make things automagically a lot more comfortable for people coming from vim). Evil mode helps a lot, but even with evil, most commands in…

> (while continuing to use vim on servers that didn't have emacs installed).

Curious, why wouldn't you use Tramp mode for that? I've found that to be a much more satisfying experience than the whole fire up terminal -> ssh somewhere -> poke around with cd -> fire up a vanilla vim song-and-dance. Instead, simply open the remote file with your entire editing environment still available, plus potentially even the superior Helm or Projectile or whatever you use available instead of manual file-finding.

Re: Vim for Humans

#195

Earlier quoted context omitted.

As someone who only uses Vim casually, what's an example of a bad default? For someone who is new to Vim, they wouldn't know if the controls are bad, or tough to learn e.g. using jkl; instead of arrow keys.

hjkl (not jkl;) are a) ergonomically bad because they are one key off of home row position and b) completely useless for anyone who types with a different keyboard such as Dvorak, and presumably some foreign language ones. also, HJKL actually IS the arrow keys... but it's the arrow keys from an ancient computer that no longer exists. People get all uppity about it being the "right" way but there's no logical argument…

Actually there was a time when everbody knew the ASCII table and hjkl were the control codes for backspace, linefeed, vertical tab and formfeed which map pretty closely to the 4 arrow directions. The first two are keyboard oriented codes, the next two are more line-printer codes but the early teletype terminals were just a printer with a keyboard so it made perfct sense.

In the vi world, these keys didn't really mean anything. They were just easy mnemonic associations to memorize because there was a system of relatedness to all of it.

Re: Vim for Humans

#196
post #192

learn incredibly unintuitive fucked up shortcuts to perform basic tasks that a basic bullshit gui text editor can perform cool

Your comment comes across as one who has their head stuck in the sand, frankly. Yes — the basics are a bit odd and initially off putting to novice users. I don't think many vim users are promoting vim for its learning curve, we're promoting it for its productivity in the more intricate editing. I still feel a little joy inside any time I use da' or ci( (delete around single quotes — i.e., remove this string, and cut inside parens, i.e., remove the arg list an start ending a replacement). Those commands in particular I find incredibly common, and the arcane shortcuts — while arcane — save me a lot of tedious Shift+Ctrl+arrow,arrow,arrow,arrow… in your more run of the mill editor.

And for the truly complex edits, :normal makes a boring, monotonous task faster … and more fun.

(MSVS has it's own issues: the last time I used Visual Studio, granted, it was ~7 years ago, it lacked ? in its regex syntax, and grouping was with {}, I think. Tell me that editing with a different regex syntax than what your .Net code uses is intuitive? The auto-complete was really good, though. (Though vim comes with out of the box heuristical completion that gets most of the way there.)

Re: Vim for Humans

#197

Earlier quoted context omitted.

Well, it depends on what you're doing. For example, if I want to duplicate a line in vi, I can type 'yyp' and _bam_: duplicate line. With a keyboard and a mouse, I have to reach over, select the whole line (being careful not to over or under select), hit Ctrl+C, move the cursor down to the beginning of the next line, and hit Ctrl+V. If I want to change the contents of a quoted string, I can type 'f"lct"' and start ty…

> With a keyboard and a mouse, I have to reach over, select the whole line (being careful not to over or under select), hit Ctrl+C, move the cursor down to the beginning of the next line, and hit Ctrl+V. Sure, but who does that? In any text editor on the Mac its: - Command-Left to move to the beginning of the line - Shift-Command-Right to select to the end of the line - Command-C to copy - Command-V to paste One anno…

How composable are those commands? The best thing about vim is that it works with text objects, so yy will select a line but yw will select a word, yip select a paragraph, yi( will select in the function call, etc.

Similarly, if I want to change them or delete them the y becomes a c or d.

Re: Vim for Humans

#198

Earlier quoted context omitted.

I don't think it's true that vim "just doesn't even come close to Emacs" . They each have their strengths and weaknesses. As bad as the defaults for vim are, they're even worse in emacs (IMO) -- especially for former vim users (though I haven't tried spacemacs, which is supposed to make things automagically a lot more comfortable for people coming from vim). Evil mode helps a lot, but even with evil, most commands in…

> (while continuing to use vim on servers that didn't have emacs installed). Curious, why wouldn't you use Tramp mode for that? I've found that to be a much more satisfying experience than the whole fire up terminal -> ssh somewhere -> poke around with cd -> fire up a vanilla vim song-and-dance. Instead, simply open the remote file with your entire editing environment still available, plus potentially even the superi…

I never really got comfortable with TRAMP mode. Maybe I'm just too set in my ways, but I like to navigate directories from the shell, for the most part, and issue commands (including invoking editors) from the shell as well.

There some exceptions, such as when I use Midnight Commander to navigate and perform some common operations, but for the most part I like the shell. (By the way, I know emacs has dired mode, but that's something else I haven't invested the time to customize to my liking, and until I do, it will be very underpowered and unintuitive compared to Midnight Commander, for me).

I do use Helm in my local emacs sessions (though mostly just in the current directory, or for functions other than file-finding), and like it, for the most part -- except for the tons of bizarre and inconsistent keyboard commands, and don't like that it's super slow for me for some reason. I really can't wait for Emacs to move to Scheme, so hopefully its performance can greatly improve as a result.

Re: Vim for Humans

#199
post #42

Earlier quoted context omitted.

My simple whys. No mouse needed is the biggest. It is like when you watch someone not use short cuts in your OS or they use mouse to select the word and then right click for copy. diw to delete whole word. yy then 5p to repeat the line 5 times instead of copy paste. / for search is really nice. gg to go to the top or G to go to the bottom. These things make it worth using vim for me. I use vim mode on all the editing…

But most modern editors have similarly efficient shortcuts for all those things that fit alongside modern UI shortcuts. e.g. in Sublime: to delete a word. to duplicate a line. [0] for search. to go to the top or bottom. I'm increasingly unconvinced that vim has much to offer in terms of shortcuts when compared to actual modern editors, rather than some kind of strawman notepad. [0] No numeric repetition, but I was ne…

The biggest thing with vim is it provides a language for actions rather than individual actions itself. This allows for far greater action control than a standard editor via shortcuts.

For example, maybe you need to delete the next two words (d2w - delete 2 words). Or maybe you want to delete the next four words, then replace them with something else (c4w - change 4 words). Or maybe you need to change the every letter of the next ten lines to uppercase, until you hit the letter 'a' on each line (qq0gUtaj10@q).

VIMs shortcuts aren't better because they're more powerful, they're better because there's an infinite combination of them.

Re: Vim for Humans

#200
post #155

Earlier quoted context omitted.

out of interest - as hjkl are one offset from the default jkl; home row position, do you opt to use the index for both h and j or shift your hand one key over to the left? I notice from observing other people type that there is an aversion to moving hand position, whereas the idea of moving hand position is not unfathomable to me, perhaps as I have played piano and violin. For example, I generally use middle finger t…

I use Ctrl+[ instead of Esc, since I find that far faster and requiring less hand movement. I notice from observing other people type that there is an aversion to moving hand position, whereas the idea of moving hand position is not unfathomable to me, perhaps as I have played piano and violin. I'm not averse to moving hand position, and I don't use the strict one-finger-per-key rules either, but I do try to minimise…

Nice trick: remap Capslock to Esc.
Post reply on HN