Understanding Neovim #5 - Textobjects, Incremental Selection

Sdílet
Vložit
  • čas přidán 19. 06. 2024
  • Now that we know what treesitter is we can try to really use some of its interesting capabilities.
    Timestamps:
    00:00 Intro
    00:28 Mistake From Part 4
    01:09 Weird Lua Syntax Explained
    02:24 The Leader Key
    05:53 Incremental Selection
    08:32 Better Keybinds
    13:00 Textobjects
    24:14 Outro
    LINK TO SPONSORS:
    github.com/sponsors/vhyrro
    LINK TO NEORG DISCORD:
    / discord

Komentáře • 61

  • @vhyrro
    @vhyrro  Před 6 měsíci +52

    Apologies for the upload frequency, am trying my best over here :)
    Expect some different topics on the channel like luarocks and Neovim-related side content too!

    • @vaisakhkm783
      @vaisakhkm783 Před 6 měsíci +12

      Why you need to apologize?? You are way too hard on yourself already... 😅 take your time.. we will wait

    • @pixelsbyme
      @pixelsbyme Před 6 měsíci +8

      But can you please please please finish this series completely then proceed with other things?

    • @pixelsbyme
      @pixelsbyme Před 6 měsíci +1

      I mean other videos

    • @0xcoffee427
      @0xcoffee427 Před 5 měsíci +2

      waiting for you to upload the next video on lsp's :)

    • @doomgao3571
      @doomgao3571 Před 4 měsíci +1

      You the best mate, dont push too hard on urself. Love ur video, but take it easy!

  • @djbessel
    @djbessel Před 6 měsíci +28

    Can't wait for the LSP breakdown! It's really starting to click when you slow-walk through these things. When I started I was very confused as to syntax highlighting vs. treesitter vs. LSPs were doing for my setup. Your videos really help clarify.

  • @pst659
    @pst659 Před 3 měsíci +2

    man you have an outstanding teaching ability. keep uploading videos. I would say you are even better than tj

  • @Tarb0
    @Tarb0 Před 6 měsíci +15

    These are hands down the best videos for learning neovim you seem to be a gift teacher seriously

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

    I can say without a doubt, if you want to learn and configure Neovim, this channel is enough!!
    Thanks dude!

  • @joaosequeira1925
    @joaosequeira1925 Před 4 měsíci +5

    This is clearly the best nvim tutorial for beginners.

  • @Emmanuel-xr3pt
    @Emmanuel-xr3pt Před 3 měsíci +3

    this guy is underrated

  • @petsod
    @petsod Před 2 měsíci +4

    Learing so much from this series, you so good at explaining things.

  • @vjameli
    @vjameli Před 5 měsíci +6

    I'm in LOVE with this series! Thank you so much for what you've done so far! Looking forward the next videos : )

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

    I use `node_incremental = "v"` and `node_decremental = "V"`. Works like a champ. Just keep smashing that "v".

  • @user-zu9ns6dq5h
    @user-zu9ns6dq5h Před 3 měsíci +1

    Thank you for such detailed explanation, if only I found something like this when first try to setup treesitter

  • @nekoill
    @nekoill Před 4 měsíci +2

    What a great series!

  • @silviorf1
    @silviorf1 Před 4 měsíci +2

    Fantastic content !! Started with #1 and just can't stop watching. Thank you very much !!!

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

    I use v for init_selection and and for node incremental and decremental.

  • @MultiMediaUploads
    @MultiMediaUploads Před 5 měsíci +3

    Thank you so much for the amazing content! Just subscribed and enabled notifications as I am eager to watch the rest of the series as it comes out!

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

    Whenever you upload the next video, I am looking forward to it because I know it will be thorough and well-explained like these ones.

  • @seppotaalasmaa3404
    @seppotaalasmaa3404 Před 6 měsíci +3

    Very nice series so far! I like the way you thoroughly explain all the details :) Looking forward for new episodes.

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

    Thanks a lot for this series, it helps to understand neovim clearly. Could you make a video on how tree-sitter work behind the scenes.

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

    Excellent series. Trying to enter vimworld with neovim and this is the best structured explainer I’ve seen. I tried kickstart but found it frustrating that I didn’t have a good understanding of the config. Now much happier building my own systematically. Thanks.

  • @-suncheez-
    @-suncheez- Před 6 měsíci +1

    That's definitely the best tutorial on app I've ever seen. Thank you so much.

  • @farzadmf
    @farzadmf Před 6 měsíci +1

    Wish I had these videos when I started my [Lua] Neovim journey

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

    Loving these videos, they were the excuse I needed to start my neovim journey, thank you so much

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

    Love the content} as a noob that's a lot to take in, but it's so interesting hearing your expertise. I also think it makes a lot of sense to release episodes like 4.1 and so on, really future proofs your future uploads in case you wanna go more in depth in any particular subject. Can't wait for next episode :)

  • @ericlindell3777
    @ericlindell3777 Před 6 měsíci +1

    Really looking forward to the lsp dive!

  • @a_maxed_out_handle_of_30_chars
    @a_maxed_out_handle_of_30_chars Před 6 měsíci +2

    thank you, this series is awesome and I'm learning so much from it
    also, stole this from a neovim subreddit as this binding makes sense to me
    incremental_selection = {
    enable = true,
    keymaps = {
    node_incremental = "v",
    node_decremental = "V",
    },
    }

  • @ElliotWeishaar
    @ElliotWeishaar Před 4 měsíci +1

    These tutorials are so informative and in-depth. Thanks for the hard work! As an aspiring nvim master I am curious though. Would it make sense to make "nvim-treesitter/nvim-treesitter-textobjects" a dependency of "nvim-treesitter/nvim-treesitter" since all of the "nvim-treesitter/nvim-treesitter-textobjects" config is within the table for the "nvim-treesitter/nvim-treesitter" plugin? That way everything for treesitter is in the one lua table. At least that's how it makes sense in my head. Thanks again for the great tutorials! Keep up the good work!

  • @pixelsbyme
    @pixelsbyme Před 6 měsíci +1

    Thank you so much!!! You cannot believe jow much eagerly I was waiting for it

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

    Thank you for all your work on this. I've been using a closed source note taking app and I can't wait to migrate to Neorg. I'm gonna dip my toe this holiday, and hopefully I'll have a good understanding and good idea of how I want to structure my notes but the time GTD comes along.

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

    love the content

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

    Great series. Not that I understand everything, but I can say that I have better understanding than before :) It will be great if you show how to set up NeoVim for Python or Golang development with intenseness and other features.

  • @_jm77_josem.69
    @_jm77_josem.69 Před 5 měsíci +1

    So good video.

  • @rahula1550
    @rahula1550 Před 6 měsíci +1

    Thank you so much for your in-depth explanation. Really helpful ✨

  • @saulvaldelvira
    @saulvaldelvira Před 6 měsíci +1

    Great serie!!! Very useful :-D

  • @ericlindell3777
    @ericlindell3777 Před 6 měsíci +1

    Great video, thanks!

  • @bassamsaleh8034
    @bassamsaleh8034 Před 6 měsíci +1

    this is amazing as usual, thank you. I can't wait for the lsp stuff, because It's really a nightmare to me.

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

    @vhyrro maybe I'm too new to Vim in general, but how does the paste work with your brackets at 14:23 ? I can see your keystrokes on screen up until the text comes in as a string and it seems like it's magical, because it also moves the brackets and indents perfectly. Did I miss a plugin or something?
    Fantastic series btw :)

  • @irayzen9847
    @irayzen9847 Před 4 měsíci +1

    i use the the vim motions like viw or viW to select things and i can use vi{ to select everything in the {} and vi( to do the same thing for () instead of incremental_selection

  • @fleal_ucm
    @fleal_ucm Před 3 měsíci +1

    I have a question on 15:12. Once `nvim-treesitter-textobjects` is installed, the way you configure it is through `require("nvim-treesitter").setup`. However, couldn't it happen that lazy installs nvim-treesitter before it installs `nvim-treesitter-textobject` and is therefore unable to find it? Shouldn't this configuration be done within the `nvim-treesitter-textojbects` config? After all, you want to enable the module after it has been installed, no?

  • @TheSast
    @TheSast Před 6 měsíci +3

    This may be a good place to ask since I haven't figured it out yet: how can I set the `localleader` to control + space or alt + space?

    • @vhyrro
      @vhyrro  Před 6 měsíci +3

      Both localleader and regular leader expect a raw string with the key sequences embedded. Usually embedding the keycode directly with in normal mode does the trick but it's a bit more tricky to do with difficult keys like Control + Space or Alt + Space.
      For your example to work set `localleader` to `vim.api.nvim_replace_termcodes("", true, true, true)` (or "" if you want Control + Space). This will convert the human-readable representation into the internal representation. That seems to be the only thing that works for my config :)

  • @AntonioDev24
    @AntonioDev24 Před 4 měsíci +1

    I was trying the node incremental option and for some reason I doesn't match the highlighting that you do...
    What am I doing wrong?

  • @LeonOrmes
    @LeonOrmes Před 4 měsíci +1

    Great series, thanks! I got up to this point with the incremental_selection, but after init_selection when I try to node_increment nvim just selects the whole file! It goes from just highlighting `init_select` to next, the whole file. Do you have any idea where to look to find a solution?

    • @zupreme3520
      @zupreme3520 Před 4 měsíci

      I'm having the exact same issue

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

    the 'c-v' blockwise mode doesn't work for me , any ideas ?

  • @fattoofittoo7907
    @fattoofittoo7907 Před 6 měsíci +1

    should i follow this or i just go with Lazyvim?

    • @seppotaalasmaa3404
      @seppotaalasmaa3404 Před 6 měsíci +1

      One could benefit from watching this series anyway.

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

      what do you mean ? he is teaching lazy vim in this video series

  • @vikingthedude
    @vikingthedude Před 4 měsíci

    9:21 nobody uses the s key anyway so this shouldn't be a problem

  • @sandeshshahi9079
    @sandeshshahi9079 Před 6 měsíci +1

    Font name plzz

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

      Most of us use Firacode nerd font mono or Jetbrains nerd mono

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

    I had to use set lazy to false as in { "nvim-treesitter/nvim-treesitter-textobjects" , lazy = false} or put "nvim-treesitter/nvim-treesitter-textobjects" as a dependency in { "nvim-treesitter/nvim-treesitter"} for this to work.
    I am new to neovim so not sure why it works for you the way it does. I am using Nvchad.

    • @galelodash
      @galelodash Před měsícem

      Because nvchad lazy-loads all plugins by default. This config doesn't, at least by now.

    • @siddharthbisht8522
      @siddharthbisht8522 Před měsícem +1

      @@galelodash Oh yeah I have got a little better now 3 months later. I dont use nvchad now. Made my own config