Live data from Hacker News

Interactive Vim tutorial

openvim.com

51–60 of 230 posts

Re: Interactive Vim tutorial

#51

Not to be that that guy but I’m gonna go ahead and plug spacemacs here. Using it in Vim (EVIL) mode I found it to be basically like vim navigationally speaking, plus they have a built completer for commands and you can even get help with commands in real time using ? And just start typing. Not a knock against Vim just something I found to be very beginner friendly

  nnoremap h j
Is this possible yet in their elisp config?

Re: Interactive Vim tutorial

#52
post #42

All these tutorials are like taking beginner French. If you want to learn French live in France. If you want to learn Vim you have to live in it. Use it for your development full time. Then over time you start to see it's power. For me on Windows, GVim was the only sane option. Mostly because the Windows console can't fully handle syntax highlighting / italics. However it's also a good transition world. You've got al…

GVim works quite well with Powershell. I used it heavily a year ago when I was on a console crusade.

Put this in your $profile and you can open it just by calling "vim":

Set-Alias vim "C:\Utilities\vim74\vim.exe"

Re: Interactive Vim tutorial

#53
Alternatively, don't try to hurry enlightenment.

First, learn

    :q!
Next

    h,j,k,l
Then

    i and ESC
Finally

    :w
Now you know vim. Don't let people tell you you're using too many keystrokes. Are you still reaching for the mouse? If not, you're using vim just fine.

Most of the good stuff in vim, you'll learn accidentally, because you're in normal mode when you think you're in insert mode, or because you have caps lock on in normal mode and you don't realize it. Pay attention to the bizarre behavior that results and you'll learn useful tricks. Mode confusion is a feature, not a bug.

For the rest, there are certain topics that reward study and are unlikely to present themselves to you accidentally, but there's no hurry unless you're feeling the pain of not knowing them. I recommend:

1. Visual selection mode

2. Prefixing counts to commands

3. Search and replace with regular expressions

4. Advanced cursor movements

Lastly, if you're using gvim, do

    :set guioptions=
at the beginning of every session. Those GUI elements will tempt you to use the mouse, when that's almost never an appropriate thing to do.

Edit: learning to use x and d early on is probably also a good idea, if like me you're the kind of person who makes mistakes.

Re: Interactive Vim tutorial

#54

Is there something similar to this for emacs?

To expand on the answers, C-h t opens the built in tutorial, which is good. It only covers the basics of navigation, but that's what you need to know to start. The tutorial is interactive. Since emacs changes its behavior depending on the mode, it would be impractical to do a more in depth tutorial, in my opinion, but I liked the Mastering Emacs ebook.

One of the very best features of Emacs is it's built in help system, faster, more convenient and more accurate than most program wikis or on-line documentation.

Emacs is too big to learn every one of the 7000 or so functions, one learns just what's useful in a particular realm. Anytime it's necessary to wander into new territory, there is really good built-in help system available. Help commands start with Ctrl-h. The next keystroke determines the kind of help that comes next.

A handy prompt after Ctrl-h suggests typing '?' for additional options. The basics options are:

a PATTERN -- show commands whose name matches PATTERN

d PATTERN -- show commands whose documentation has a match to PATTERN

f -- documentation of a particular function

c -- what command runs for a particular Emacs key sequence

t -- learn by doing tutorial.

There is a full page of other help options including access to the full emacs manual.

Re: Interactive Vim tutorial

#55
post #3

I started going through it, and unfortunately it takes control away from you way too often. I want to be able to toy around with the concepts after I learn them. I'd still recommend `vimtutor`.

'vim adventures' also seems fun, but it's not quite the same (for me) without the context of actually navigating a text document.

> 'vim adventures' also seems fun, but it's not quite the same (for me) without the context of actually navigating a text document.

On https://news.ycombinator.com/item?id=14658197 and its children I wrote something about the business model of VIM Adventures that you should consider before buying.

Re: Interactive Vim tutorial

#56
I was just watching my daughter writing a program in Java using eclipse. It's frustrating to watch a relative beginner editing using a combination of the mouse and the keyboard--it's so slow.

Re: Interactive Vim tutorial

#57

Obligatory link to VimGolf, a great way to learn by doing. https://vimgolf.com/

This website sucks, it takes forever to load challenge pages because they're flooded with irrelevant entries which you can't even see if you don't submit your own. You can't even visualize the solutions directly in the browser.

Re: Interactive Vim tutorial

#58
post #40

I apologize that this question is slightly tangential to the submitted post, but this seems like an ideal venue to ask: Is there a GUI interface to vim that has smooth-scrolling? I've tried Gvim, but this just seems like vim with buttons (no smooth-scroll). I've tried Sublime text with the ActualVim plugin (powered by NeoVim), but this had errors which somehow swapped document buffers on write, essentially deleting a…

Do you mean scrolling with a mouse? It might sound a bit arrogant, but there's rarely any good reason to scroll with a mouse in vim.

Perhaps with a mouse, but not necessarily. I don't think your statement re: mouse scrolling applies universally. For programming script documents, sure -- each line is likely limited to the 80 column mark, and so the lines are quite short.

However, with Latex documents, for example, very long lines (i.e., paragraphs) are a big pain for me (even with vimrc options `set display=lastline` and `set linebreak`). In typical GUI text editors, the wrapped lines of long lines are treated as sort of "pseudo lines" themselves. This means when I cursor down (via mouse or keys), the cursor doesn't jump to the next newline after the paragraph (as it does with vim).

Apparently, this last described problem can be addressed [1]. So maybe the solution is that I need to spend more quality time with my vimrc? :)

[1]: http://vim.wikia.com/wiki/Move_cursor_by_display_lines_when_...

Re: Interactive Vim tutorial

#59
post #40

I apologize that this question is slightly tangential to the submitted post, but this seems like an ideal venue to ask: Is there a GUI interface to vim that has smooth-scrolling? I've tried Gvim, but this just seems like vim with buttons (no smooth-scroll). I've tried Sublime text with the ActualVim plugin (powered by NeoVim), but this had errors which somehow swapped document buffers on write, essentially deleting a…

Do you mean scrolling with a mouse? It might sound a bit arrogant, but there's rarely any good reason to scroll with a mouse in vim.

I think they're talking about animating scroll changes. Web browsers do this, if you press page down, it animates the change(it's subtle, the animation only lasts a fraction of a second).

In Vim, it'll just do an instant repaint, so you kind of lose context.

Post reply on HN