The most useful NeoVim shortcuts I've learned

แชร์
ฝัง
  • เผยแพร่เมื่อ 1 ม.ค. 2025

ความคิดเห็น • 66

  • @joaofaber
    @joaofaber 3 วันที่ผ่านมา +15

    11:00 you can type yG to yank from current line to the bottom, ggyG to go to the first line and then yank the entire buffer

    • @WebDevCody
      @WebDevCody  3 วันที่ผ่านมา +2

      Nice thank you!

  • @mageshyt2550
    @mageshyt2550 2 วันที่ผ่านมา +5

    love to see people using NeoVim now a days

  • @Aditya_Vyas
    @Aditya_Vyas 3 วันที่ผ่านมา +13

    We got a thumbnail today 😅

  • @kirillvoloshin2065
    @kirillvoloshin2065 วันที่ผ่านมา +1

    vim motions are amazing, not only speed up your code navigation, but also add more joy to programming :D

  • @sub-harmonik
    @sub-harmonik 2 วันที่ผ่านมา +3

    tip on the braces: you can also use B for {} and b for () when selecting in/all. I find it more ergonomic

  • @jesse9999999
    @jesse9999999 วันที่ผ่านมา

    a really nice one that not a lot of people mention is jump list navigation with ctrl+o and ctrl+i. something i often do is "gd" to go to a definition, then you can ctrl+o to jump back to where you were before going to the definition. ctrl+i would allow you to jump back to the definition you were at before using ctrl+o.
    those actions really helped me keep a flow state while using nvim

  • @saurabh75prakash
    @saurabh75prakash 9 ชั่วโมงที่ผ่านมา

    Thanks, this is very useful for someone switching to Neovim.

  • @SeibertSwirl
    @SeibertSwirl 3 วันที่ผ่านมา +10

    Love it and love you! But also next time walk me through it… for I am not tech smart hahaha 😅😩

    • @WebDevCody
      @WebDevCody  3 วันที่ผ่านมา +1

      You’re smart! Love you babe!

  • @shaked1233
    @shaked1233 2 วันที่ผ่านมา +2

    You should add some syntax color highlighting, looking at this hurts ouch

  • @westonclark6823
    @westonclark6823 วันที่ผ่านมา

    Leader ca is “code actions” if you are on a line that has an error, you can easily add imports or resolve simple errors.

  • @dross6206
    @dross6206 2 วันที่ผ่านมา +1

    One small change at 11:05 , instead of 1000yy, you can just use yG to yank everything to the bottom of the page. Also, one that I use a lot is “+y which yanks it into the system clipboard to use in other apps like discord.

    • @WebDevCody
      @WebDevCody  วันที่ผ่านมา

      Very nice

  • @cafecafeo
    @cafecafeo 2 วันที่ผ่านมา +1

    Cody, is this a plugin that sends those hints in blue and red like "unreachable content" or "await has no effect"? Thanks

    • @Hedshodd
      @Hedshodd 5 ชั่วโมงที่ผ่านมา +1

      That's how Neovim renders the diagnostics from its LSP client out of the box. The client itself needs to be configured, and you can do that by hand, but the lspconfig plugin can set reasonable defaults for most LSP servers out there.

    • @cafecafeo
      @cafecafeo 5 ชั่วโมงที่ผ่านมา

      @ wow, looks great! Thank you for the explanation!

  • @khoinguyen-ft2ys
    @khoinguyen-ft2ys วันที่ผ่านมา

    Welcome to the Neovim world!
    (I use Neovim btw)

  • @jhivenagnar2953
    @jhivenagnar2953 วันที่ผ่านมา

    11:50, you can use 't' motion here. It's a motion to select html/xml tag, including jsx/tsx file. Place the cursor on the tag, then you can press 'vat' to select outer tag or 'vit' to select inner tag. Of course, you can use similar motion like 'dat' or 'cit'.

    • @WebDevCody
      @WebDevCody  วันที่ผ่านมา

      I’ll have to try that one

  • @greyshopleskin2315
    @greyshopleskin2315 3 วันที่ผ่านมา +3

    I’m tired so I won’t give tips.
    However I can guarantee that you can improve a lot the way you navigate and edit.
    You will discover very nice things in your journey if you keep going. Don’t surrender and it’ll be beautiful at the end

  • @AirKiter
    @AirKiter 3 วันที่ผ่านมา +2

    Also consider using visual mode more instead of directly deleting things. I find it useful to select them before yanking or deleting them. Remember you can use o to change the position of your cursor.

  • @micoberss5579
    @micoberss5579 2 วันที่ผ่านมา +1

    You don't have to select a word first then copy. You can simply do yiw ( yank in word ) . Also yi{ - yank in curly braces, but if yoy want to copy with curly braces you do ya{ - yank around curly . Same for delete and change : diw, daw, da{ , ciw, caw , ci{, ca{

  • @anthonyewell3470
    @anthonyewell3470 2 วันที่ผ่านมา +1

    :% => apply the following to the entire file/buffer
    so you can go :%d, :%y etc. but a big one is s/
    :%s/x/y/g =>Apply a regex search for x and replace it with y, globally (so to the entire line)
    Now knowing that we can choose where we're applying changes we have extra power
    :$ => apply the following to the last line of the file/buffer
    :n => (where n is a line number) apply to line
    Now for extra fun here's something to remember, the capital version of a command does something "like" the original. so gg goes to begining and G goes to ending. So find out what I, A, D, and C do.

  • @mobythereal
    @mobythereal 3 วันที่ผ่านมา +2

    very good video, one question tho, did u setup any treesitter because the syntax highlighting seems to be not readable at all.

    • @WebDevCody
      @WebDevCody  3 วันที่ผ่านมา +1

      I doubt it, only started a few days ago

    • @mobythereal
      @mobythereal 3 วันที่ผ่านมา

      @@WebDevCody then i highly recommend looking more into it, it will make reading code way more easier.

    • @Haphazardhero
      @Haphazardhero 2 วันที่ผ่านมา +1

      Treesitter is setup as part of kickstart.nvim so it is probably just the muted theme that makes it seem like it might not be working.

    • @StanislavMilchev-d7y
      @StanislavMilchev-d7y 2 วันที่ผ่านมา

      @@Haphazardhero tree-sitter is different than the treesitter.nvim thats in the kickstart

  • @putsuthisrisinlpa3658
    @putsuthisrisinlpa3658 วันที่ผ่านมา

    Have you got treesitter installed it’ll make syntax highlight a whole lot better

    • @WebDevCody
      @WebDevCody  วันที่ผ่านมา

      I don’t know

  • @hackerware_sh
    @hackerware_sh 3 วันที่ผ่านมา

    The next thing that I learned besides what you just showed is using folds (zM, zR, za, etc) and has helped me A LOT for inline navigation and just quckly scanning the current buffer and just dive in (unfold) what I am actually interested in inside a bigger file, instead of seeing a big wall of 400 lines of text all the time. It can be confusing at first because there are many fold commands (that start with “z”) but it’s time worth invested.

    • @WebDevCody
      @WebDevCody  3 วันที่ผ่านมา

      good tip! I'll try this one out

  • @QuebnQ
    @QuebnQ 3 วันที่ผ่านมา

    will you try to configure neovim? like the color scheme and stuff?

  • @saurabh75prakash
    @saurabh75prakash 9 ชั่วโมงที่ผ่านมา

    You can use caster to show your keystrokes to the audience.

  • @tzuilee588
    @tzuilee588 2 วันที่ผ่านมา

    omg Cody is turning to nvim 😃

  • @AshesWake-sf7uw
    @AshesWake-sf7uw 2 วันที่ผ่านมา

    I have been using NeoVim now, for an yr now. Love it nd building thibgs i want my way.

  • @amosmachora
    @amosmachora 2 วันที่ผ่านมา

    bro is neovim pilled now

  • @micoberss5579
    @micoberss5579 2 วันที่ผ่านมา +1

    ggVG to select all in file. Breakdown: gg - move cursor to start of file, V - enter visual mode (select mode), G - move cursor to end of file.

    • @khoinguyen-ft2ys
      @khoinguyen-ft2ys วันที่ผ่านมา +1

      A little more info here:
      - v: visual mode (character)
      - V: visual line mode

  • @AntennaTower
    @AntennaTower 3 วันที่ผ่านมา +1

    "If you wanna scroll like an old school coder" lmao, it's very hard sometimes to figure out whether you're being sarcastic or not.

    • @WebDevCody
      @WebDevCody  3 วันที่ผ่านมา +1

      I’m always sarcastic

  • @hamdaniash-siddiq5021
    @hamdaniash-siddiq5021 3 วันที่ผ่านมา

    how is this faster thatn cmd+p in vscode?

    • @WebDevCody
      @WebDevCody  3 วันที่ผ่านมา

      it's the same; I also don't remember comparing anything to vscode in this video

    • @hamdaniash-siddiq5021
      @hamdaniash-siddiq5021 3 วันที่ผ่านมา

      @ 😄 i try to get used to vim thing. I practice a lot and still find IDE like VSCode still help me code faster. Plus, install VIM extension in vscode, and boom, you got tue best in both world. You got VIM with all the key binding and all vscode goodies

    • @WebDevCody
      @WebDevCody  3 วันที่ผ่านมา

      @@hamdaniash-siddiq5021 yeah I still use cursor when I'm serious about wanting to build something. This NeoVim journey is just for fun.

  • @youyoumu
    @youyoumu 2 วันที่ผ่านมา

    I've been spent the last 4 days configuring my neovim

    • @productionoutages
      @productionoutages 2 วันที่ผ่านมา

      it really takes this long; but i dont feel more cracked

  • @gafdev
    @gafdev วันที่ผ่านมา

    All the shorcuts used in this video ♥ :
    j: Move down one line
    k: Move up one line
    h: Move left one character
    l: Move right one character
    gg: Go to the top of the file
    G: Go to the bottom of the file
    ctrl+d: Move down half a page
    ctrl+u: Move up half a page
    {: Move to the beginning of the previous paragraph
    }: Move to the beginning of the next paragraph
    /: Search forward for a string
    n: Go to the next match
    N: Go to the previous match
    ?: Search backward for a string
    :: Enter command mode
    q: Quit the current buffer
    w: Save the current buffer
    x: Save and close the current buffer
    wq: Save and quit the current buffer
    q!: Quit without saving
    ZZ: Save and quit
    X: Cut the current line
    dd: Delete the current line
    yy: Yank (copy) the current line
    p: Paste the last yanked text
    P: Paste the last yanked text before the cursor
    u: Undo the last change
    ctrl+r: Redo the last undone change
    r: Replace the character under the cursor
    R: Enter replace mode
    i: Enter insert mode before the cursor
    a: Enter insert mode after the cursor
    o: Open a new line below the current line and enter insert mode
    O: Open a new line above the current line and enter insert mode
    A: Append text to the end of the current line
    I: Insert text at the beginning of the current line
    v: Enter visual mode
    V: Enter visual line mode
    ctrl+v: Enter visual block mode
    d: Delete the selected text
    y: Yank (copy) the selected text
    c: Change the selected text
    x: Cut the selected text
    >: Indent the selected text

  • @micoberss5579
    @micoberss5579 2 วันที่ผ่านมา

    G (shift g) for moving to last line in file. Not GG

  • @bshelling8922
    @bshelling8922 3 วันที่ผ่านมา +1

    Primeagen's Vim setup playlist is the best place to start.

  • @kirillvoloshin2065
    @kirillvoloshin2065 วันที่ผ่านมา

    gg y G would copy the whole content of the file: go to the top, yank until the end of file

    • @kirillvoloshin2065
      @kirillvoloshin2065 วันที่ผ่านมา

      also _ goes to the start of the line

    • @kirillvoloshin2065
      @kirillvoloshin2065 วันที่ผ่านมา

      and Ctrl O or Ctrl I does not just go between files. You use it to navigate between lines you edited (yes, vim keeps history of these lines and you just jump through them)

    • @kirillvoloshin2065
      @kirillvoloshin2065 วันที่ผ่านมา

      also would like to mention pressing * on a word, which is basically the same as / yourQuery Enter
      super cool feature, use it every day)

  • @sub-harmonik
    @sub-harmonik 2 วันที่ผ่านมา +1

    netrw is terrible and it shouldn't be included in neovim. It has unresolved bugs a decade old that no one wants to fix because it's such a mess.
    No offense to the author, I'm sure it was valuable at one point but it hasn't kept up

  • @sinamobasheri
    @sinamobasheri 3 วันที่ผ่านมา

    No no no man don't do it, don't do the thumbnail face!

    • @WebDevCody
      @WebDevCody  3 วันที่ผ่านมา +1

      need to get some more views

  • @sooraj6338
    @sooraj6338 3 วันที่ผ่านมา

    Waw