Advanced Multiline Editing in Neovim

Sdílet
Vložit
  • čas přidán 2. 08. 2024
  • In this video I walk through how to use many different techniques to edit multiple lines at once in Neovim. Visual Block Mode, Regex search and replace, vim-visual-multi plugin, and many more!
    Multiline Editing Pt 1: • Multiline Editing in N...
    Plugin: github.com/mg979/vim-visual-m...
    github.com/terryma/vim-multip...
    Remaps:
    github.com/exosyphon/nvim/blo...
    github.com/exosyphon/nvim/blo...
    Neovim config: github.com/exosyphon/nvim
    Twitter: / exosyphon
    Website: andrewcourter.com
    Twitch: / exosyphon
    Mechanical keyboard apparel: andrewcourter.creator-spring....
    Enjoy the content? You can buy me a coffee: www.buymeacoffee.com/andrewco...
    TubeBuddy: www.tubebuddy.com/andrewcourter
    Gear:
    Mic: amzn.to/40GUGFg
    Mic Interface: amzn.to/3YGxaGE
    Mic preamp: amzn.to/3XtBXtY
    Webcam: amzn.to/3OEOZRU
    Boom Arm: amzn.to/3qLr0GE
    Vissles (VS II switches): vissles.com/?ref=69zn8aei20 - Coupon Code for $5 off: ANDREWCOURTER
    IQUNIX F97 (TTC ACE switches): iqunix.store/collections/f97-...
    Audo:
    Karl Casey @ White Bat Audio
    • Chill Synth / Synthwav...
    0:00 Intro
    0:56 Personal Thoughts
    1:37 Selecting Text
    4:28 Changing Text
    5:20 Surrounding Text
    9:15 Multiline Swaps
    11:33 Renaming Variables
    13:57 Outro
    #neovim #coding #programming
  • Věda a technologie

Komentáře • 28

  • @mbwilding
    @mbwilding Před 5 měsíci +1

    This was great. Thanks for the regex tips too!

  • @cody_codes_youtube
    @cody_codes_youtube Před rokem +2

    Yo, new camera angle! Love it!

  • @JamieAlban
    @JamieAlban Před 10 měsíci

    seems useful - I use a lot of q macros to do a lot of these multi-location editing things, but sometimes it gets awkward or challenging to record a sufficiently accurate macro the first time. The instant visual feedback seems more forgiving.

  • @neunmalelf
    @neunmalelf Před rokem

    Good Voice 👍 Nicely done content.

  • @jettlaggg
    @jettlaggg Před rokem

    I wanna see more neovim content! new sub!

    • @ascourter
      @ascourter  Před rokem

      Thanks! Just recorded a video on my Telescope config so hopefully can get that one editing soon and launched! Let me know if there are other topics you are interested in.

  • @cody_codes_youtube
    @cody_codes_youtube Před rokem +1

    Nice dude, I enjoyed the video. I didn't know you could do this stuff. What are you using to do the key press recording?

    • @ascourter
      @ascourter  Před rokem +1

      Thanks! There's a surprising number of ways I've found. That screen key capture is called KeyCastr

  • @irfanfauzi8704
    @irfanfauzi8704 Před 9 měsíci

    Love your vids

    • @ascourter
      @ascourter  Před 9 měsíci

      Thank you! Working on a video for LazyVim v10 that released today. Hope to release soon!

    • @irfanfauzi8704
      @irfanfauzi8704 Před 9 měsíci

      Keep it up man. We need more neovim content.

  • @farzadmf
    @farzadmf Před rokem

    VERY nice video, thank you!
    Question: how have you configured your which-key to show Visual-Multi's menu when pressing m?

    • @ascourter
      @ascourter  Před rokem +1

      I believe that is out of the box behavior. Here is a link to my Neovim config to check out: github.com/exosyphon/nvim

    • @farzadmf
      @farzadmf Před rokem

      Hmmm, interesting. I think my visual multi's setup is similar, but for some reason, I don't see the bindings in which-key.
      I thought it might because I'm lazy loading my plugins, but that doesn't seem to be reason.

  • @sumitsinghdeode2138
    @sumitsinghdeode2138 Před 3 měsíci

    This is great vidoe but I am using mac and C+down and C+Up make the iterm window to move hwo to fix it?

    • @ascourter
      @ascourter  Před 3 měsíci

      Thanks! If I understand what you are saying, it sounds like you want to use C+down / C+up but the iterm window is grabbing that keybinding? If so, check in your iterm settings for what your keybindings are. You might also check your System Settings and make sure those keybindings are not mapped there too.

  • @suhendrapembelajar
    @suhendrapembelajar Před 9 měsíci

    how to change C-down to C-j in mac. because C-down is use as global key in mac to minimize/select mac windows.

    • @ascourter
      @ascourter  Před 9 měsíci

      I personally deactivated most of the global Mac keyboard shortcuts but you should be able to customize inside System Settings. As an alternative you could add a keyboard shortcut specifically for your terminal application.
      support.apple.com/guide/mac-help/change-a-conflicting-keyboard-shortcut-on-mac-mchlp2864/mac

  • @darkarie
    @darkarie Před 10 měsíci

    I think a lot of these could be done with substitutions, right?

    • @ascourter
      @ascourter  Před 10 měsíci +1

      Yeah you can accomplish a lot with substitutions but some of these might be less mental overhead or fewer keystrokes.

    • @darkarie
      @darkarie Před 10 měsíci

      yes, in any case the are a lot of over head that can be reduced in substitutions if you use brackets, /1 and regex patterns

    • @darkarie
      @darkarie Před 10 měsíci

      of course you need to get used to it to be fast like everything in vim, but at the end it can be more powerful

  • @diaryofafounder
    @diaryofafounder Před 5 měsíci

    Hey,
    I'm struggling to get vim-visual-multi installed in neovim.
    I've added this to my config:
    {
    'mg979/vim-visual-multi',
    branch = "master",
    lazy = false,
    init = function ()
    vim.g.VM_maps = {
    ["Find Under"] = ""
    }
    end,
    },
    But no luck (unable to run :help visual-multi)
    Do you have a video somewhere on how to setup vim-visual-multi in Nvim?

    • @ascourter
      @ascourter  Před 5 měsíci

      Sorry you're having trouble! I don't have a video explicitly installing and setting it up unfortunately. In my config I only have { "mg979/vim-visual-multi" },
      Maybe try that and see if it will install. github.com/exosyphon/nvim/blob/2c275382a2ead9d4e0e160e7251eb191f92cf28d/lua/exosyphon/lazy.lua#L860

    • @diaryofafounder
      @diaryofafounder Před 5 měsíci

      @@ascourter no worries, thank you for sharing. Interesting that is the only line you have and it works for you! I'll have to see if anything else is conflicting.

  • @JamieAlban
    @JamieAlban Před 10 měsíci

    that's a TINY keyboard

  • @husrevmustafalale2369
    @husrevmustafalale2369 Před 2 měsíci

    Am I the only one who cannot select a word using ctrl + n (I tried ctrl + N also)?

    • @ascourter
      @ascourter  Před 2 měsíci

      Check if you have any conflicts using lua require('telescope.builtin').keymaps