I’ve tried vim on and off during college but never really had the time to fully get working with it. As it turns out the stress of two degrees is not conducive to “fun activities”. Now that I have a real job ™️, I’ve decided to finally try and use it this week full stop and I genuinely feel like a programming chad. There’s still a lot I’ll need to learn and probably overtime I’ll discover some inefficiency in how I’m using it now but it really does just feel good. I understand the hype now.

you are viewing a single comment's thread
view the rest of the comments
[–] 15 points 1 year ago (4 children)

I've always liked vim but one thing that I really loved about it was when I started using vim mode in zsh.

Being able to just navigate through commands in my terminal and easily highlight and edit and all that ... it's so good.

  • source
  • hideshow 4 child comments
  • [–] 12 points 1 year ago*

    when I started using vim mode in zsh.

    I'm an emacs user myself, but if you're not aware, readline


    which handles a considerable portion of the "prompt for text" stuff in many terminal programs, like input for bash and such


    can be put into vi mode.

    https://tiswww.case.edu/php/chet/readline/rluserman.html#Readline-vi-Mode

    In order to switch interactively between emacs and vi editing modes, use the command M-C-j (bound to emacs-editing-mode when in vi mode and to vi-editing-mode in emacs mode). The Readline default is emacs mode.

    When you enter a line in vi mode, you are already placed in ‘insertion’ mode, as if you had typed an ‘i’. Pressing ESC switches you into ‘command’ mode, where you can edit the text of the line with the standard vi movement keys, move to previous history lines with ‘k’ and subsequent lines with ‘j’, and so forth.

    Or, in ~/.inputrc:

    set editing-mode vi
    

    To set the default.

  • source
  • parent
  • [–] 3 points 1 year ago (2 children)

    HOLY CRAP

    Let's say I run a command that spews output. Are you saying that with Zsh I can use only the keyboard to navigate the spew, copy a bit of it, and paste it in a new command?

    If so I should try it out!

  • source
  • parent
  • hideshow 2 child comments
  • [–] 1 point 1 year ago

    Zsh probably can't do that, because zsh is involved with typing commands, not handling their output. You should look into the docs and settings for your terminal emulator — some of them do support selecting output with the keyboard. Alternatively, something like tmux might be able to handle that too.

  • source
  • parent