Live data from Hacker News

Vim for Humans

vimebook.com

91–100 of 251 posts

Re: Vim for Humans

#91

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 will add some of my own opinions:

My feeling is that real value of Vim is its novel approach to modal text manipulation, and you shouldn't let the fact that it has a standalone lightweight reference implementation usefully installed on almost every machine that you use confuse you.

Vim script is not a great plugin language, and the vim runtime itself is not fantastic at doing things beyond the text editing. I think the activity around NeoVim is good evidence for this. The community recognizes the constraints of Vim, and seeks better plugin and runtime tooling to meet their needs.

My issue is: there are loads of great text editors that support the Vim interface. Emacs, Atom, Sublime, whatever, all have very good Vim interfaces and far superior languages and platforms for doing complex plugin work that you need to support IDE-ish environments. NeoVim seems like a bit of a waste to me, because I think it misses the point. Vim is not a platform. It's a unique modal editing paradigm. Why make yet another Vim-binding-having platform?

I guess what I mean is that vim should be left as vim. There are superior platforms that implement the same interface, should you feel the need to expand your tools. Vim does best as a portable minimal editor that you can use everywhere. If you need something with more power, pick a better platform, and run the Vim editing paradigm as an interface.

Re: Vim for Humans

#92

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…

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.

Re: Vim for Humans

#93
post #3

I've only skimmed this but there seems to be a focus on customizing and plugins from the get go. I think it's worth getting to know Vim "as is" before doing such things. Indeed there certainly some things that aren't the most useful or obvious but it's good to understand their original intent. Not to crap on the author of this but I'd recommend Drew Neil's Practical Vim over this (and pretty much every other Vim book…

To perhaps go against the grain a little here, I appreciate a focus on customisation from the start.

I am beginning to use Vim more, mostly because I was introduced to the keybindings with Vim emulation from other apps, and I appreciate how it works. I had previously attempted to learn Vim through the normal ways, but it just was impossible; by default, Vim for me is barely readable and none of the included colour schemes ever made it any better. Plus, of course, some of the other things like size of tabs, line numbers, often even syntax highlighting. But finding out how to deal with plugins, themes, settings, etc. is difficult when you aren't already introduced to Vim, precisely because most people make the assumption that you've learned Vim "as is" already.

I think some concession has to be made to modernity. Vim is very old and "as is" it often just doesn't function very well for everyday use. Grinding through that until you know it well enough to be given the knowledge of how to make it nicer to use isn't worth it to most people. It certainly wasn't to me.

Re: Vim for Humans

#94

The very first thing I do on any default Vim config is :imap kj And then Vim kinda makes sense to me. Pressing each time is such an anti-pattern imho.

C-[ is equivalent to , and is much more natural. I also bind caps lock to ctrl (setxkbmap -option ctrl:nocaps on a GNU/Linux system), which makes this all the more natural.

Why not just change caps-lock to esc.

setxkbmap -option caps:escape

Re: Vim for Humans

#95
post #3

I've only skimmed this but there seems to be a focus on customizing and plugins from the get go. I think it's worth getting to know Vim "as is" before doing such things. Indeed there certainly some things that aren't the most useful or obvious but it's good to understand their original intent. Not to crap on the author of this but I'd recommend Drew Neil's Practical Vim over this (and pretty much every other Vim book…

I disagree. Vim is bare, cold, and strange when coming from a traditional editor, and I probably wouldn't have gotten involved if it were not for a friend who already have a useful .vim and .vimrc for me to use as a starting point. He got me up and running with a Vundle, syntax highlighting for all my languages, autocomplete, and various settings that should have been default with stock vim. Though vimtutor was also very useful for getting used to the standard controls.

Edit: Forgot the most important thing, the setting that lets you use the mouse: set mouse=a. After I discovered this I knew I was never going back to Sublime.

Re: Vim for Humans

#96

I wish I could use vim or emacs. I don't know if I'm stupid or something but all of the key bindings, everything you have to remember, it just doesn't make sense to me. I wish there was something like nano + plugins. If I had that I could implement most of what I need (other then auto-completion for a crap load of languages).

Learning Vim is probably a bit like learning to bicycle/swim. It requires a lot of conscious effort at first but eventually becomes a second nature. Also, I doubt many vim users would use "nano + plugins" if vim suddenly disappeared. The fact that vim has many plugins and runs in the terminal is nice but isn't the main reason people use it IMO. I second the suggestion of using vimtutor to get started (uninstalling ot…

the problem with learning vim is that it's like learning to bike by biking to work. most people use vim when they code, and they code at work, so using vim is directly in the way of getting any productive work done.

i was just one of the ones stupid enough to waste two weeks of productivity to learn a new tool lol

Re: Vim for Humans

#97
post #52

I wish I could use vim or emacs. I don't know if I'm stupid or something but all of the key bindings, everything you have to remember, it just doesn't make sense to me. I wish there was something like nano + plugins. If I had that I could implement most of what I need (other then auto-completion for a crap load of languages).

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 weaned myself off other editors by using vim for thought-intensive programming. When most of your time is spent trying to come up with efficient solutions to your problems, spending a little time learning more about vim isn't so bad... and can be a welcome distraction.

I still use editors like atom for web development where I go through frequent iteration cycles and make heavy use of the clipboard.

Re: Vim for Humans

#98

> 3.5 Our first plugin: the file explorer it would be cool to be able to open files without having to do File -> Open using the menu bar How about using the :edit command? > 3.5.1 Plugin manager: Pathogen > 3.5.2 The NERD Tree: a file explorer The NERD Tree is a plugin that will allow you to display your directory and file tree directly in Vim > 4.1 Learning how to move Most distributions of vim include the netrw plu…

Your opinion is quite common with old vim hands, but I would have to respectfully disagree. Someone learning vim is probably coming from Atom or Sublime. The defaults in vim are so egregiously awful, that I don't think you can expect these folks to stick with learning. Their productivity drops to zero - there isn't even syntax highlighting - so they give up and go back to what they were using. You have to get vim to…

Seconded.

I switched to Vim as my primary editor about two months ago. I remembered how much easier Emacs Live[0] had made my life when I was giving Emacs a serious go a little whole ago, and found a sorta-equivalent for Vim[1] which smoothed over a lot of the rough edges and put in some of the modern convenience an ST die-hard like me would expect (autocompletion, package management and what have you).

That left one remaining barrier, which is the weirdness of modal editing; which is the important barrier, because the only reason you'd use vim is to sign up to the pre-eminent modal editor.

Maybe, two new laptops from now, or one lonely weekend, I'll take a hacksaw to spf13 and strip out the bits I don't need. But for a shallow onramp experience, it's been a godsend.

[0] https://github.com/overtone/emacs-live

[1] https://github.com/spf13/spf13-vim

Re: Vim for Humans

#99

I wish I could use vim or emacs. I don't know if I'm stupid or something but all of the key bindings, everything you have to remember, it just doesn't make sense to me. I wish there was something like nano + plugins. If I had that I could implement most of what I need (other then auto-completion for a crap load of languages).

Learning Vim is probably a bit like learning to bicycle/swim. It requires a lot of conscious effort at first but eventually becomes a second nature. Also, I doubt many vim users would use "nano + plugins" if vim suddenly disappeared. The fact that vim has many plugins and runs in the terminal is nice but isn't the main reason people use it IMO. I second the suggestion of using vimtutor to get started (uninstalling ot…

There's something to that, yes, that a lot of things become second-nature (e.g. once you learn Vim, when you're in Nano on an unfamiliar machine, you start finding yourself accidentally typing Esc-:w to try to save a file).

There's also something about "this is totally unfamiliar and not at all incremental upon what I know." I was vigorously against vim after trying to do it many times, eventually I found out a base set that allowed me to learn incrementally, now it's not so bad. The big thing is to totally forget all of these people who are saying "vim is like an awesome language for text editing." Maybe it is, but that's an awful sales pitch. This person wants to spend a few minutes editing source code, not spend a year learning a new language.

The minimal starter set for Vim is something like:

    # From Command Mode #
    dd     | deletes a line
    .      | repeat whatever you just did, for example pressing I, 
             then the delete key 4 times, then Esc is one command
             which dedents a space-indented line by 4; now you
             can go down a block hitting . at each line to 
             dedent it.
    i      | switch to edit mode at present cursor
    I      | edit at beginning of line.
    A      | edit at end of line.
    u      | undo
    Ctrl-r | redo
    
From there probably the next thing I would teach people is brace jumping with %, regex-jumping with /, visual-lines mode shift-V and either cutting with d or copying with y, then pasting with shift-P. Finally macros with qp ... q ... @p. After that, maybe dealing with multiple buffers. Just let people use the arrow keys to navigate, don't get too religious about the home row or letter repetitions like d5d.

I think that's a basic skillset that will let you say "okay, my thesis advisor is making me put two spaces after each period that's not an abbreviation in this document, what editor should I use for that? Well I want to step through everything just to make sure, but let's just use Vim where I know I can write "fix this one and then jump to the next period" as a macro, and interleave that with some basic navigation when it's not right."

Re: Vim for Humans

#100

I wish I could use vim or emacs. I don't know if I'm stupid or something but all of the key bindings, everything you have to remember, it just doesn't make sense to me. I wish there was something like nano + plugins. If I had that I could implement most of what I need (other then auto-completion for a crap load of languages).

I started out like this. In effect in the beginning you can do everything in edit mode, you don't actually need the key bindings. Pretty much the only thing I learnt was 'dd' to delete a line (which actually just cuts the line).

The other very simple thing is just typing '/' and then searching. It's much simpler and more natural once you're used to it than Ctrl+F. Then further searching is just hitting '/' again instead of F3. Firefox has the same command that you can use, just hit '/' and you can start searching.

Underlying this though, is a very useful and powerful editor that's there and waiting for you to use if you want to invest the time.

I come from a Windows world so wrote up a table of comparable commands [1].

Edit: It is also pretty cool however, that if you install Vim on Windows (it gets installed as part of Git) and with a bit of Solarized colours [2] you can get a IDE level editor in your DOS prompt [3]. It blew my mind anyway.

  [1]: https://ianchanning.wordpress.com/2012/04/07/vi-commands-for-the-windows-user/
  [2]: https://github.com/neilpa/cmd-colors-solarized/
  [3]: https://dl.dropboxusercontent.com/u/7765571/images/screenshots/2016-10-17%2020_32_05-Make%20me%20a%20sandwich%20-%20vim%20%20DNA.hs.png
Post reply on HN