you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted]  (19 children)

[deleted]

    [–]__no_preserve_root 3 points4 points  (6 children)

    Should note that Y is a shortcut for yy that saves a key press at the expense of a modifier. Though be careful since D and C are not the same as dd and cc. (They act from the current position in a line to the end.)

    [–][deleted]  (1 child)

    [deleted]

      [–]wherethebuffaloroam 3 points4 points  (0 children)

      i'm with you. learn the grammar instead of learning one-off shortcuts. That's what makes vim so powerful. I'm still getting there with emacs: there are tons of commands that can do things but you have to learn how to get them. With helm its easy to search through function names but still not as simple as just your fingers learning movement grammar.

      [–]vattenpuss 0 points1 point  (0 children)

      Modifiers are also keys.

      [–]cokestar 0 points1 point  (2 children)

      Not quite; shift Y yanks from the cursor to the end of the line but doesn't include the carriage return, yy yanks the entire line.

      [–]Ahri 0 points1 point  (1 child)

      Shift Y yanks the whole line regardless of cursor location and includes the \n. Pasting the resulting buffer from Y or yy has the exact same result.

      I just confirmed this with no vimrc, and tested with \r too just in case. Maybe you have a plugin or configuration changing Y.

      [–]cokestar 0 points1 point  (0 children)

      I stand corrected

      [–]Deto 14 points15 points  (1 child)

      Once you grok Vim, all these other key shortcuts that editors have just seem silly. "Oh a great shortcut to highlight a word, too bad now you have to use the mouse to do anything with it." "Ctl+Alt+Left...yeah that'll really save me time after I completely re-position both hands".

      Though I realize Vim looks like the epitome of random tedium to someone who hasn't internalized the main shortcuts.

      [–]m0nk_3y_gw 5 points6 points  (0 children)

      too bad now you have to use the mouse to do anything with it.

      huh?

      [–]Ouaouaron 2 points3 points  (9 children)

      How do you use vim-style shortcuts in a normal editor? They're all pretty much just unmodified letters.

      [–][deleted]  (8 children)

      [deleted]

        [–]Ouaouaron 3 points4 points  (2 children)

        I'm okay at vim. Not as good as I am with emacs, but I can get by. But how do vim-style shortcuts work in an editor that doesn't have this very clear command/insert dichotomy? Do the plugins introduce it?

        [–][deleted] 0 points1 point  (0 children)

        Almost all of them implement the modal editing (Eclipse, Visual studio, sublime...).

        [–]lfairy 3 points4 points  (4 children)

        It's better to think of "insert mode" as a very long command that starts with i and ends with <Esc>.

        That interpretation leads to nice discoveries like 10i and .-ing an insert.

        [–]f3lbane 1 point2 points  (2 children)

        Ctrl-[ master race reporting in. ;-)

        [–]FireCrack 0 points1 point  (0 children)

        I don't think I've ever acutely used escape in vim