Live data from Hacker News

Vim for Humans

vimebook.com

151–160 of 251 posts

Re: Vim for Humans

#151

Earlier quoted context omitted.

Vim is very easy, I think it's just simple to get overwhelmed with it. There are a couple of tools which gamify Vim. I personally haven't used them. But some say they're pretty good. For me, what worked was just jumping in and going whole hog. I tried disabling the arrow keys in Normal Mode, so I would have to use hjkl for navigation. But my keyboard puts the arrow keys in easy reach (Kinesis Advantage), so it turned…

Why do people not like :x ?

There's also ZZ which I find easiest of all.

Re: Vim for Humans

#152

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 emacs and its modes remain bound to traditional emacs chorded keystrokes, not to vim-style moded keystrokes (the latter of which feel much easier on the hands for me).

I've used vim (vi and some other vi colones before that) for over 25 years, and switched mostly to emacs (with evil) about 6 years ago or so (while continuing to use vim on servers that didn't have emacs installed).

I spent several months, spending 10 hours a day to customize emacs the way I liked it, and to bring it mostly up to parity with my vim config (which was thousands and thousands of lines long), along with customizing some emacs extensions that had no vim equivalent (like emacs-w3m, which is an embedded web browser, which is still super handy despite not working with javascript). It took that long despite me knowing Common Lisp and scheme before switching to emacs, which made learning Elisp a breeze compared to the extra effort it would take someone coming from vim who didn't know any Lisp.

And still, even after all that work, I haven't gotten around to learning and customizing many of the things I really want to use emacs for, like email, IRC, RSS, Slime, and the various other extensions made for editing Lisp and Scheme.

So I found the switch to be a ton of work, which was worth it for me, since I'm still using emacs instead of vim, and don't intend to switch back. But others who are considering a switch from vim to emacs should also be prepared to do a lot of work customizing emacs to your liking. It's a never-ending process, really, just as it is with vim.

Now some words on some of what I see as strengths and weaknesses between the two editors:

Vim has much better tab support out of the box. Emacs has any tab support without extensions, to my knowledge.

Though vim's methods for writing syntax-highlighting for new, not already recognized filetypes is a bit of a nightmare, I found it to be a lot easier to understand than how to write new modes in emacs -- which I still really haven't bitten the bullet and fully learned. So for some filetypes that emacs doesn't have modes for, I still use vim to this day. This is particularly the case for strace output, which I view pretty regularly in vim, which handles them just fine, but emacs still has no modes for.

One of the main reasons I switched to emacs was for its allegedly superior shell/terminal integration. But I found it really lacking for anything that involves curses terminal graphics, and also not really practical for me since I don't use GUI emacs, but rather use emacs inside tmux and inside a terminal. This makes for way too many levels of indirection for commands, and a lot of keystrokes are taken up by the various levels. Some say I should just use GUI emacs and not use tmux, but I don't want to do that, and am not going to go in to all the reasons why, in the interest of not making this post much longer than it already is.

Emacs has a huge win over vim (for a Lisp/Scheme lover like me) in being natively scriptable in Elisp (and perhaps soon in Guile Scheme). vim could be scripted in scheme, but 99.9% (or more) of vim scripts aren't done in scheme -- the ecosystem is really mostly vimscript, which I don't hate like some people do, but which still pales in comparison to "real" programming languages like Python or Ruby, and even more so compared to a Lisp or Scheme (IMO). While virtually the whole emacs ecosystem is written in Elisp. That's super important to me, and makes writing and reading my emacs configs and emacs scripts a lot more of a pleasure for me than scripting vim will ever be. When mainline emacs switches to Guile Scheme, scripting it will be even more fun for me, and this Lisp ecosystem is one of the primary reasons I will continue to use emacs instead of vim in the long run.

vim has neovim, which is super exciting, and has even made me (on occasion) wonder if maybe I should switch back. The ability to completely and cleanly split vim between the controlling and presentation levels and to properly and fully embed it in other programs is going to be huge. Emacs still has a lot of catching up to do in this area, despite it having a server mode, which does help.

emacs can be really super slow on some large files that demand a lot of syntax highlighting. vim has the same problem, but to a much lesser extent. There are times that I'll switch back to vim just to edit some huge files every now and then. In such times, I must say that it's nice to be comfortable in both editors, so I have a choice as to which to use as the situation warrants.. the right tool for the job, and all that.

As I mentioned before emacs-w3m (a web browser embedded in to emacs) is really great, and I use it all the time, despite it not being able to handle javascript. It's awesome to be able to split a web page in to panes in the same and independently scroll each pane, and to copy and paste things in to the panes without leaving the editor. It's super handy for browsing several sections of online documentation at the same time, without having to split out the page in to seperate windows in a traditional browser. I also use pentadactyl in firefox, and while that's pretty cool as far as it goes, it still does not come close to the power of having the browser embedded in an editor as powerful as emacs, and vim doesn't have anything close to that, to my knowledge.

Similarly, there are emacs extensions for full email, IRC, and RSS clients, which sound awesome and don't have vim equivalents, to my knowledge. But I haven't tried those, so can't comment.

There are many more things that one editor or the other is better at. But I'll just end this here, so I don't make this post much more ginormous than it already is. This subject really deserves a blog post or even a series of them, and maybe I'll write one.

Re: Vim for Humans

#153

Earlier quoted context omitted.

Completely agree. Personally, I'm trying to spread the One True Way of ijkl navigation, but it's slow going...

I'm curious: what do you use to enter insert mode then?

Just recently I've been starting to rely on 'a' and 'A'. Maybe I could switch to ijkl

Re: Vim for Humans

#154
post #22

A little background. I am familiar with vi and use it only when I ssh into a server. But I never really felt it was more convenient or an improvement over a GUI based text editor or IDE on my development machine. Eg- gedit for simple text editing, Android Studio for android development, Atom for python coding. Everything works out of the box with minimal tweaking required. Genuine questions: -At what point on the lea…

I often code with my laptop while I ride an exercise bike. Can't use a mouse there. Trackpad is terrible when hands are sweaty. Move too much for home row, so I two-finger type. Vim is great for this.

Re: Vim for Humans

#155

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…

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 to hit esc to exit escape mode. This may seem counter-intuitive and could well be thanks to the dimensions of my hand, but I am able to reach esc with middle finger without moving the wrist. That means I can hit esc and find the home row while still touch typing. Similarly, displacing my entire hand for hjkl isn't that uncomfortable and is certainly more comfortable than trying to use both h and j for h and j.

Re: Vim for Humans

#156

What Vim, and a lot of other programs, really need is a single plastic-covered card which tells you how to use the program. You can squeeze a summary of calculus on one such card. Is it too much to ask for software? (I really, really want that for Blender. The Blender hotkey document is 9 pages and years out of date.)

You could try this:

https://duckduckgo.com/?q=vim+cheatsheet&t=ffab&ia=cheatshee...

There are similar pages for various programs, including blender it seems: https://duckduckgo.com/?q=blender+cheatsheet&t=ffab&ia=cheat...

Re: Vim for Humans

#157

Earlier quoted context omitted.

Completely agree. Personally, I'm trying to spread the One True Way of ijkl navigation, but it's slow going...

I'm curious: what do you use to enter insert mode then?

In default vim, i inserts to the left of the cursor. In ijkl, you simply map h to insert left of the cursor. It's even on the left of your new arrow keys so the mental map works better too!

I'm a huge ijkl fan, because I learned wasd long before I learned vim.

Re: Vim for Humans

#158
post #129

Earlier quoted context omitted.

Yeah, fair enough. That's a very good way of putting it, and I know exactly what you mean. I think the hardest part about implementing the Vim keybindings is that they're intrinsically linked to the way that Vim models text and operations. Commands are really statements about this internal model. Without the model, it gets difficult to reproduce the full palette of vim commands with very high fidelity. You kind of in…

I encourage you to try NeoVim. I did. And I never looked back. After 6 months of Emacs, looks like I'll be back to NeoVim, and I am happy about it.

you might want to give spacemacs a go... it's quite good after you translate whatever vim config to emacs config. out of the box it's actually quite great and this is coming from a hardcore vim user that can't stand using a text editor without vi bindings and proper macro support etc. Everything is done pretty well and there isn't anything that I have found dealbreakingly lacking so far.

https://www.youtube.com/watch?v=HKF41ivkBb0

it's also under active development so if that's your thing check it out.

https://github.com/syl20bnr/spacemacs/

Re: Vim for Humans

#159
post #92

Earlier quoted context omitted.

> 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…

Sublime, at least, has a duplicate line command. I believe you can also use the copy command with no text selected to copy the current line. None of your examples seem nearly as effective as pressing yy to copy the line and p to paste below.

Atom is the same.

Re: Vim for Humans

#160
post #52

Earlier quoted context omitted.

Just curious, what editor(s) do you use? I was using Sublime Text, and for the hardest part of switching to Vim was feeling the huge productivity drop in the beginning as I relearned how to do everything.

I used sublime for a bit, but I didn't like getting nagged. Right now I'm using some JetBrains products and Nano. I sketch everything out into nano, then I pull it into CLion when it's ready to be cleaned, updated, iterated, and in general changed to become a "final" version.

The trick is to pay for it.
Post reply on HN