Vim Tips I Wish I Knew Earlier

Поділитися
Вставка
  • Опубліковано 30 січ 2025

КОМЕНТАРІ • 203

  • @dexedrine404
    @dexedrine404 9 місяців тому +77

    Timestamps:
    0:24 - Relative line numbers
    2:26 - Mapping Esc to Caps Lock
    3:22 - :norm
    4:41 - C-v (similar to :norm A & I)
    6:04 - in(de)crement numbers with C-a / C-x
    8:36 - using o to change visual select direction
    9:24 - % for jump to matching pair: ({[
    11:04 - i / a (inside / outisde)
    13:55 - W vs w
    15:51 - Invoking external scripts/binaries
    19:08 - Creating (dynamic) snippets
    20:25 - Using netrw/fzf/search

    • @pypypy4228
      @pypypy4228 5 місяців тому +3

      do the timestamps in the description to the vid and your video would be nicely divided into navigable chapters

    • @andreasplata
      @andreasplata 3 місяці тому

      @@pypypy4228 The man needs watch-time... ;)

  • @pldvs
    @pldvs 10 місяців тому +124

    Has to be the most underrated piece of software ever. I'll never go back.

    • @flflflflflfl
      @flflflflflfl 10 місяців тому +16

      You think vim is underrated???

    • @excel9566
      @excel9566 10 місяців тому

      i'm sorry

    • @pldvs
      @pldvs 10 місяців тому +2

      @@flflflflflfl By people who prefer nano.

    • @flflflflflfl
      @flflflflflfl 10 місяців тому +8

      @@pldvs ok but that's that's like, 7 people

    • @pldvs
      @pldvs 10 місяців тому +2

      @@flflflflflfl I think you'd be surprised.

  • @GOTHICforLIFE1
    @GOTHICforLIFE1 9 місяців тому +46

    highly recommend placing some segments and timestamps on these videos, as you rarely have everything being new for Vim users. That way we can easily click to those points that might apply.

  • @LeviNotik
    @LeviNotik 10 місяців тому +15

    Great video, nicely done. Didn't know about o for adjusting the visual selection. I've always cancelled and started from scratch when I screwed up. No longer!

  • @andrewiglinski148
    @andrewiglinski148 10 місяців тому +11

    Dude I've been using vim for almost 2 years and you're the first person that's actually taught me something new past the first month of this endeavor.

    • @nahblue
      @nahblue 10 місяців тому +4

      I've been using vim for 15 years and I learned something new from the video

  • @דניאלאביב-ו6ת
    @דניאלאביב-ו6ת 9 місяців тому +26

    One very helpful keybinding in vim, is Ctrl+R in insert mode, when pressing it you are able to paste directly from some register.
    I was finding my self a lot of the times, just pressing escape to go into normal mode, and press p (to paste) and i again to move to insert mode.
    It is very helpful...

    • @yash1152
      @yash1152 9 місяців тому

      thanks if it works. will try it next time i get my hands on nvim.

    • @adammontgomery7980
      @adammontgomery7980 7 місяців тому +5

      Nice, I like ctrl-o to go back to the last place you jumped from. It's a lot easier than moving from buffer to buffer or setting marks.

    • @BarraIhsan
      @BarraIhsan 6 місяців тому

      thank you!

    • @michaelroditis1952
      @michaelroditis1952 5 місяців тому +2

      u is undo ctr+r is redo,
      "+p pastes from the clipboard

    • @polic72andDrD3ath
      @polic72andDrD3ath 5 місяців тому +2

      Something else really cool you can do in this vein is Ctrl + o while in insert mode. It will take you to normal mode for a single command then jump you right back to insert mode. I use "Ctrl + o, p" all the time.

  • @Snollygoster-
    @Snollygoster- 10 місяців тому +9

    Vertical visual mode with the multi cursor was the only thing I saw an emacs user have that I wanted, and vim turns out to have it too. It's such a nice experience using that. Absolute chad developers.

    • @yash1152
      @yash1152 9 місяців тому +1

      how multiple cursor?

    • @levonschaftin3676
      @levonschaftin3676 5 місяців тому

      @@yash1152 how english?

    • @yash1152
      @yash1152 5 місяців тому +2

      @@levonschaftin3676 not matters for me. u do u. ppl dont respect my-lang, i won't respect theirs. simple-that.
      > _"how english?"_

    • @radicalchange9403
      @radicalchange9403 3 місяці тому

      how mad?

    • @zanani57
      @zanani57 Місяць тому

      (use-package multiple-cursors
      :ensure t)
      (global-set-key (kbd "C-c m c") 'mc/edit-lines) ; Add cursor to each line in the region
      (global-set-key (kbd "C-c m n") 'mc/mark-next-like-this) ; Add a cursor to the next occurrence
      (global-set-key (kbd "C-c m p") 'mc/mark-previous-like-this) ; Add a cursor to the previous occurrence
      (global-set-key (kbd "C-c m a") 'mc/mark-all-like-this) ; Add cursors to all occurrences
      To create a vertical selection or multiple cursors on consecutive lines:
      Highlight the region vertically (using C-SPC and moving the cursor down).
      Run mc/edit-lines (bound to C-c m c above), which places a cursor on each selected line.
      After activating multiple cursors, any edits you make will apply to all cursors simultaneously.

  • @EmielvanGoor
    @EmielvanGoor 10 місяців тому +14

    What the...! I absolutely love that :norm command! I didn't knew it was that easy! Thanks a lot Sebastian.

    • @pldcanfly
      @pldcanfly 10 місяців тому +2

      Yep! Gamechanger!... And here I was q-macro record such things and then @q all the lines or do some fancy recursive things. This makes things so much more easy!

    • @EmielvanGoor
      @EmielvanGoor 10 місяців тому

      @@pldcanfly I did exactly the same!

    • @vutranang8053
      @vutranang8053 10 місяців тому

      true, that :norm blow my mind

  • @NguyenHoang-uf1kt
    @NguyenHoang-uf1kt 5 місяців тому +1

    I’ve been using Vim for the past few weeks, and you’ve saved me months or even years of learning. Thank you, Sebastian!

  • @sambrown7691
    @sambrown7691 4 місяці тому +1

    Im watching this by myself in my car and you had me yelling "WHAT?!" and dropping my jaw like half a dozen times. Fantastic stuff absolutely taking some notes on this

  • @gumball135
    @gumball135 2 місяці тому +1

    Ooh! I like the snippets, piping to a command, and :norm. Something cool I learned recently was the jumplist. Ctrl+o goes to the cursor's previous position, ctrl+i goes to the next. Some commands, like moving a certain number of lines ("3k"), don't get added to the jumplist, so this incentivises using other movement & search commands.

  • @Yeet_the_code
    @Yeet_the_code 10 місяців тому +17

    Set environment variable "EDITOR=vim" or whatever you like
    Write some command in your bash terminal and press (CTRL + X & CTRL + E)
    This allows you to modify the command you want to write by opening up the command in your "$EDITOR"
    Especially useful when writing commands that you want to split over multiple lines, but still be executed as if it was all in one command. Or just want to get some syntax highlighting in your favorite text editor.
    Most people might already know this... but if you don't, you're welcome.

    • @SebastianDaschnerIT
      @SebastianDaschnerIT  10 місяців тому +1

      Yes, been using that in my zsh/vi-mode setup, very helpful!

    • @ivanheffner2587
      @ivanheffner2587 10 місяців тому +1

      Got a typo in your previous command (or just want to edit it and run the new command)? Try `fc` to “fix command” using your $FCEDIT editor.

  • @QuinlanShanley
    @QuinlanShanley 4 місяці тому +2

    Long time vim user and I learned a couple new tricks. Great video. Subbed. Look forward to seeing more of your videos.

  • @sharperguy
    @sharperguy 5 місяців тому +1

    I really like having it set so that relative line numbers turns off in insert mode, and back on in edit mode.

  • @catfan5618
    @catfan5618 10 місяців тому +3

    2:59 Mapping escape to caps lock is pretty easy on every major operating system. Under MacOS its under Settings/Keyboard/Modifier Keys and under Windows you can install PowerToys by Microsoft and do it under Keyboard manager/Remap a key. I highly recommend doing this.

    • @ishino_ki
      @ishino_ki Місяць тому

      Also on Linux I recommend evremap, it's a great piece of software and is really easy to configure.

  • @julian-fricker
    @julian-fricker 10 місяців тому +7

    Been using vi/vim/neovim since 1992 and still learn new things from this kind of video, o especially.
    What are you using for the markdown headings to be shown at the top of your screen as you scroll down? This was in the section about relative line numbers.

    • @SebastianDaschnerIT
      @SebastianDaschnerIT  10 місяців тому +5

      That's the 'wellle/context.vim' plugin

    • @jimcarroll9738
      @jimcarroll9738 3 місяці тому

      @@SebastianDaschnerIT for whatever reason I was able to install 'wellle/context.vim' (Lazy) but couldn't get it working with an example Markdown file (such as you demonstrated).
      Stumbled across 'nvim-treesitter/nvim-treesitter-context' and installed that instead. All sorted now.

  • @VinitNeogi
    @VinitNeogi 10 місяців тому +13

    Didn't know about o for switching direction of selection

  • @nahblue
    @nahblue 10 місяців тому +1

    I like automatic session saving, that's the big one I've learned recently. Didn't get into it until it was automatic in some neovim config I was using. It always saves your session on exit, and when starting vim there's an *option* to resume the session by pressing a keybinding - and it knows which session based on which directory you are in.

  • @pv3201
    @pv3201 10 місяців тому +5

    Had no idea about o or using ex mode with . on a visual selection.

  • @CNich90
    @CNich90 4 місяці тому +1

    Really cool tips and some I haven’t seen before but also very practical for common use, thanks!

  • @aksh1618
    @aksh1618 10 місяців тому +1

    Nice tips, subscribed! One suggestion for such videos: you need to code in the memory of these things otherwise anyone will forget them 5 minutes after watching! The way I remember these is how the creators of vim motions intended it: by looking at the meaning of the letters, such [o] for [O]ther end of highlighted text, and [a] for [A]round.

  • @teohz
    @teohz 10 місяців тому +14

    One of my favourites has to be a way to "encase" text in quotes/braces/etc: replace the text either after selecting in visual or with motions, i.e. cw {" " "} --- the " after ctrl+r pastes the text you just cut from the " register.

    • @ElPikacupacabra
      @ElPikacupacabra 10 місяців тому +1

      ...noice 😮

    • @SlothWindGod
      @SlothWindGod 10 місяців тому +1

      Couldn't you just use "p" to paste the text instead as by default it pasted from the " register?

    • @ElPikacupacabra
      @ElPikacupacabra 10 місяців тому +2

      @@SlothWindGod You can, but you have to exit insert mode and navigate back two characters before pressing "p". About the same.

    • @SlothWindGod
      @SlothWindGod 10 місяців тому +5

      @@ElPikacupacabra ctrl + o to perform a command from insert mode means you don't have to navigate out of it

    • @ElPikacupacabra
      @ElPikacupacabra 10 місяців тому +1

      @@SlothWindGod You're not in the correct position I think 🤔. But many ways to skin a cat

  • @SlyPearTree
    @SlyPearTree 5 місяців тому +1

    How do you lock lines at the top and have their line number stay relative to bottom window?. If I use split then both windows' line number stay relative to their windows.

  • @name1355_0ne
    @name1355_0ne 5 місяців тому +1

    Very nice advanced level tips. Thanks a lot for sharing!

  • @DanAlmenar
    @DanAlmenar 10 місяців тому +3

    sessions and copy-paste to/from clipboard (I don't have clipboard support) has been my newest tools for vim

  • @creativenull
    @creativenull 10 місяців тому +6

    I've know almost all of them for a while, but these are some great tips!
    For me, I had to turn off relative numbers because it was not great for pair programming with a colleague when they had to point out at what line should a change go, etc, but overall is a nice feature that I like
    One thing I learned from this was the `o` in visual mode, that's actually pretty neat I think I might start using that instead of thinking about where to start the highlighting from and to, everyday you learn something new in vim 😅

    • @inertia_dagger
      @inertia_dagger 10 місяців тому +3

      you can execute your line number in ex mode, for example
      :141
      would go to line 141

    • @zyriab5797
      @zyriab5797 10 місяців тому

      You can also type `141G` :)

    • @creativenull
      @creativenull 10 місяців тому +1

      @@inertia_dagger That I know but not what I meant. For example, when I'm pair programming with someone and they want to suggest a change at a particular line. With relativenumber enabled, they won't be able to tell me which line in the code to go to and might get confused by the numbering (that I would understand).
      It was just easier to keep relativenumber disabled for the session or entirely so that my colleagues can better direct me 😅

    • @inertia_dagger
      @inertia_dagger 10 місяців тому

      @@creativenull hmm, you could disable relative line numbers in pair programming with :set nornu

    • @creativenull
      @creativenull 10 місяців тому

      @@inertia_dagger yup exactly!

  • @MarioDanielCarugno
    @MarioDanielCarugno 5 місяців тому +1

    What plugin do you use for the 'sticky scroll' feature ?

  • @zyriab5797
    @zyriab5797 10 місяців тому +19

    You can use i/a with a lot of stuff:
    f = function
    p = paragraph
    t = HTML tag
    And probably a ton I don't know about

    • @nahblue
      @nahblue 10 місяців тому +1

      f requires treesitter and neovim- I think?

    • @vikingthedude
      @vikingthedude 7 місяців тому

      @@nahblueyes

    • @sutirk
      @sutirk 3 місяці тому +1

      Function, class, conditional and other programming specific objects require treesitter or something similar.
      But you can get away with { or B, and ( or b in vim. Quite helpful. See :help objects

  • @piotrekgebala2524
    @piotrekgebala2524 5 місяців тому +1

    I didn't know about increments. Great tip, thank you!

  • @lasombra_br
    @lasombra_br 10 місяців тому +1

    Fantastic video, Sebastian! Really interesting with some great tips!

  • @SethMilliken
    @SethMilliken 10 місяців тому +7

    Another nice one with some of the text-objects (i.e. va", vi

  • @r4s3
    @r4s3 9 місяців тому

    I've been using vim for years and knew I knew about invoking with ! from command mode but the fact that you can replace the contents in place with the output blew my mind.

  • @mmlvx
    @mmlvx Місяць тому

    Around 2:06 timestamp -- is that folding, based on markdown H1, H2, H3 elements? That looks much nicer than it is on my system. I'm curious, what's in your .vimrc to get it to look like that.
    Using "o" to change where the cursor is in a visual selection -- that's so cool! I didn't know that.

  • @secondculs
    @secondculs 8 місяців тому +1

    norm is a pretty new to me, this is really great to put in to my arsenal

  • @devfagundes
    @devfagundes 10 місяців тому +1

    Nice video! I recently learned about the ctrl+f trick in command mode, its usefull

  • @roryhendrickson
    @roryhendrickson 8 місяців тому +1

    I needed these tips, thanks for sharing!

  • @kamalchan9756
    @kamalchan9756 5 місяців тому

    also a nice tip about relative number configure you vimrc so when you are in insert mode it switches to relative number and when you are in normal mode switch to numbers this will help

  • @1234minecraft5678
    @1234minecraft5678 7 місяців тому

    You can use W in ciw as well it does the same thing as cW when youre at the beginning of

  • @semanser
    @semanser 10 місяців тому +1

    Is this some sort of plugin? I have relative line numbers enabled but don't can't get these sections/subsections stuff to work (2:04)

  • @justcorsin
    @justcorsin 6 місяців тому +1

    17:16 neovim already comes with a ":sort' command, in case you didn't already know.

  • @heroe1486
    @heroe1486 10 місяців тому +1

    Nice video, for fuzzy finding I personally use fzf-lua and Telescope, I have a script that spawns fzf-lua if I'm in my home directory (since way faster) and Telescope otherwise (with the smart-open extension that gives you a mix of old opened files, ones from the current directory etc, all of that weighted).
    But I recently discovered that you can have a whole "real" (like ranger or vifm) file manager inside of neovim, I'm thus now also using the yazi file manager inside of neovim, you can do everything from within it, cd, use zoxide, fzf, searching, and ofc copy/paste/cut/rename etc, it can even preview images.
    But I'm using neovim as an "IDE", so it's pretty much essential to have convenient navigation.

    • @SebastianDaschnerIT
      @SebastianDaschnerIT  10 місяців тому +3

      Nice setup. Yes, that's also what I found, when you use Vim as an IDE, you're well-advised to use Neovim with such plugins, esp. good navigation. For me, my (simpler) Vim setup works well

    • @TechJolt3d
      @TechJolt3d 10 місяців тому

      Interesting, I'm just using netrw as my file manager in vim.

    • @007arek
      @007arek 10 місяців тому

      There is a plugin `fm-nvim` that allows to spawn any predefined program inside a new buffer - lazygit, broot or ranger

  • @phaberest_
    @phaberest_ 10 місяців тому +1

    Loved this! Thank you Sebastian, awesome content

  • @markleakos3737
    @markleakos3737 4 місяці тому

    How do you lock lines at the top and have the relative line number refer to the bottom window?

    • @SebastianDaschnerIT
      @SebastianDaschnerIT  3 місяці тому

      Have a look here: github.com/sdaschner/dotfiles/blob/master/.vimrc

  • @jacedenny7160
    @jacedenny7160 2 місяці тому

    Ctrl-f in command mode allows re-use and editing of previous commands.

  • @Codigger-br2rt
    @Codigger-br2rt 10 місяців тому

    How do I set up gvim to automatically load files that were opened when the editor was last closed each time I started it?

  • @mainframe9374
    @mainframe9374 9 місяців тому +1

    Interesting. Actually I use "w" and "W" constantly, it's basically one of my most used navigation ways

  • @NormTurtle
    @NormTurtle 10 місяців тому +8

    did i knew it already : YES
    did i watched it again : YES

  • @somnvm37
    @somnvm37 10 місяців тому

    the thing that I use in vim is that, in KDE you can download certain keyboard layouts that have 3rd and 4th layer, and then in keyboard settings select "use caps lock for the third layer"
    now if I press caps l I get ľ, caps j gives ± and so on
    this allows for a lot of new potential keybindings, ď for emmet
    ľ for esc
    ± and ł for scrolling by line [C-Y and C-E] so now i can move cursor with j k and move screen with caps j k (every press moves the screen by 1 line)
    also š for :w
    i only have these right now, but I can add more in the future [oh and also, in kde settings you can make caps mode go on from both shifts being tapped at the same time]

  • @chai01724
    @chai01724 10 місяців тому

    Thank you for this video! Espanso is a great text expander to check out too!

  • @AlekseyKzn
    @AlekseyKzn 3 місяці тому

    all is cool thank you but sometime it is hard to see what you pressed. it would be great if pressed combination scrolled up and stay on screen at least 5 last command.

  • @mvargasmoran
    @mvargasmoran 9 місяців тому

    I have relative and absolute numbers, so when I share my screen my team mates can point to the line they want me to go naturally (or in a way they are familiar with).

  • @MrPolyphonicpoi
    @MrPolyphonicpoi 10 місяців тому +9

    Windows users - reading the friendly manual: "Since CTRL-V is used to paste, you can't use it to start a blockwise Visual selection. You can use CTRL-Q instead."

    • @SebastianDaschnerIT
      @SebastianDaschnerIT  10 місяців тому +4

      Oh man... isn't Windows fun 🤦‍♂️ Thanks for pointing that out!

    • @polic72andDrD3ath
      @polic72andDrD3ath 5 місяців тому +2

      I use WSL2 and disable CTRL-V pasting in the terminal window for that exact reason. If you can get in the habit of setting paste to CTRL-SHIFT-V, then I can highly recommend it.

  • @chizuru1999
    @chizuru1999 4 місяці тому

    i have been using vim for a while but is there any simpler alternative to vscode's "ctrl shift L" command and "ctrl d"?
    Basically multicursor

    • @SebastianDaschnerIT
      @SebastianDaschnerIT  3 місяці тому +1

      There is, there's multiline select (Ctrl+V), but in Vim, I'd rather go for movements plus re-do (dot . ) or macros

  • @kamalchan9756
    @kamalchan9756 5 місяців тому

    how you did 1:47 the line after 103 # hello this is new to me

  • @Vic-ky3cc
    @Vic-ky3cc 8 місяців тому +1

    This was very insightful, thanks

  • @odanabunaga2505
    @odanabunaga2505 10 місяців тому

    Would you consider making an overview of vim plugins that you find most useful in your everyday work? Or have I missed it ?

  • @ishaankapoor933
    @ishaankapoor933 9 місяців тому

    Which screen key software are you using?

  • @soufianemssd
    @soufianemssd 10 місяців тому

    Can you please tell me, what plugin are you using for creating snippets

    • @SebastianDaschnerIT
      @SebastianDaschnerIT  10 місяців тому

      It's called vim-snippets: github.com/honza/vim-snippets (though I think I forked it)

  • @whym1here
    @whym1here 10 місяців тому +1

    What font are you using? it looks nice.

  • @buildervision7082
    @buildervision7082 10 місяців тому +1

    Great content, learnt something new

  • @odanabunaga2505
    @odanabunaga2505 10 місяців тому

    how did you make this split happen at 1:48?

    • @SebastianDaschnerIT
      @SebastianDaschnerIT  10 місяців тому +1

      You mean the lines inbetween the example titles that I created to show the contexts? That was just a high number (I think 100 or so), and o for creating a lot of newlines.
      Or do you mean this context-aware plugin in general? That'd be wellle/vim-context

    • @odanabunaga2505
      @odanabunaga2505 10 місяців тому

      @@SebastianDaschnerIT Yes it's the plugin I was curious about! Cheers! Thanks for the tutorials, they are awesome!

  • @nightfox6738
    @nightfox6738 Місяць тому

    I never liked relative line numbers. I prefer to know what the real line number is and you can do (line number)G anyway, which also works with other phrases like c58G will delete all lines between the current line and line 58 both inclusive and put you in edit mode.

  • @iusearchbtw69
    @iusearchbtw69 6 місяців тому +3

    That *W* is a replacement of my *t*
    Tysm mate, gotta use it more often

  • @CyperN077
    @CyperN077 10 місяців тому

    I map the left arrow key to ESC in insert mode and down to write the file in all modes,

  • @devshmsec
    @devshmsec 8 місяців тому

    Could you please move the keylogger to above you? I think it will be better there.

  • @briansepolen4917
    @briansepolen4917 6 місяців тому

    Control Left Bracket is key 27. I use that instead of Escape.

  • @exegeteio
    @exegeteio 10 місяців тому +6

    w/W is great, but don’t sleep on b/B for going the other way. o will be a game changer for me. Thank you!

  • @cristobaljvp
    @cristobaljvp 10 місяців тому

    I'm definitely gonna use that `o` visual mode trick

  • @EluLawlielt
    @EluLawlielt 10 місяців тому

    Hi Sebastian, thanks for the tips! What is the colorscheme that you are using (is it maybe default vim? I am an nvim user after all...)

    • @SebastianDaschnerIT
      @SebastianDaschnerIT  10 місяців тому

      Not sure about the name; in oh-my-zsh I'm using the ZSH_THEME="afowler" (but I think with some modifications). I think Vim mainly adopts these. You can check out my Dotfiles, it's all there: github.com/sdaschner/dotfiles

  • @josephbolton8092
    @josephbolton8092 5 місяців тому

    I learned a lot, thanks!

  • @fplove
    @fplove 10 місяців тому +4

    After 25 years of use there are still vim tricks and commands I still don't know.

  • @markhunt6499
    @markhunt6499 10 місяців тому

    Hello, Sebastian. Can you tell please which OS do you use?

    • @heroe1486
      @heroe1486 10 місяців тому +2

      Arch + i3wm

  • @rodelias9378
    @rodelias9378 10 місяців тому +4

    Nice vídeo. However, I think the dynamic snippets section should have better explanation.. I mean: how to really do it the way you just show us?

    • @SebastianDaschnerIT
      @SebastianDaschnerIT  10 місяців тому

      Oh ok, what part of it wasn't clear? You use a snippet plugins (I use honza/vim-snippets) and you expand them (per default I think it's )

    • @andrewmagerman2574
      @andrewmagerman2574 5 місяців тому +4

      @@SebastianDaschnerITneeding a plugin was not clear.

  • @titanandrews
    @titanandrews 6 місяців тому +1

    Good stuff!

  • @odb7393
    @odb7393 8 місяців тому +1

    Sweet video dude!

  • @vanvothe4817
    @vanvothe4817 10 місяців тому +2

    Use control-[ instead ecs or remap caplocks

    • @zyriab5797
      @zyriab5797 10 місяців тому +2

      Tap caps lock = esc
      Hold = ctrl
      Really nice ergo imho

  • @Awwe12675
    @Awwe12675 3 місяці тому

    I still I don’t know how to use (hi syntax) and change the (cursor) and color of (cursor) I don’t like plugin

  • @lenickramone
    @lenickramone 5 місяців тому

    a good tip is also have the intent of the comands:
    i - inside
    a - around
    o - other
    and so on...

  • @1234minecraft5678
    @1234minecraft5678 7 місяців тому

    Well you could also use plugins and further enhance everything you do

  • @miguelborges7913
    @miguelborges7913 9 місяців тому

    a in selections stands for "around'.

  • @eavdmeer
    @eavdmeer 4 місяці тому +1

    Any line numbers look absolutely ghastly to me. The relative ones even more so. I just have 'set ruler' on so the line/column number is shown only once at the bottom.
    Having said that, as a user of vi/ex from about 1993,there were surprisingly many good tips in here (albeit more vim features). The increment and selection direction swap especially

  • @jaadus
    @jaadus 10 місяців тому

    was kinda hoping you'd show how to create the snippets

    • @SebastianDaschnerIT
      @SebastianDaschnerIT  10 місяців тому

      Have a look at github.com/honza/vim-snippets , it's quite straightforward

  • @zodoturtle
    @zodoturtle 8 місяців тому

    I strongly recommend against remapping of Caps Lock to Escape. When you do eventually switch computers, maybe trying to repair someone elses. Any keyboard remapping is going to make life difficult.

    • @SebastianDaschnerIT
      @SebastianDaschnerIT  8 місяців тому

      That's right, but thinking in this limitation will sadly prevent you from a lot of optimizations that you can do on your system (starting with the keyboard mapping, over shortcuts, to shell setup). But yes, if portability is important to you, fair enough

    • @zodoturtle
      @zodoturtle 8 місяців тому

      @@SebastianDaschnerIT My reality is that I eventually had to physically remove my Caps Lock key after removing the remap in order to stop trying to use it as an Escape key.

    • @zodoturtle
      @zodoturtle 8 місяців тому

      I just use Ctrl+[ instead.

  • @kaihwangche9975
    @kaihwangche9975 2 місяці тому

    Great! i'm more and more closer to know how to exit vim.

  • @Fullflexno
    @Fullflexno 3 місяці тому

    super cool!

  • @joechea_
    @joechea_ 10 місяців тому +4

    to select inside html tag vat 😁

  • @ptys7777
    @ptys7777 5 місяців тому

    Awesome!

  • @LukasSmith827
    @LukasSmith827 10 місяців тому +5

    Luke Smith would be proud, by far the best vim video I've seen

  • @adjbutler
    @adjbutler 10 місяців тому +2

    that is all well and good... but how do you exit VIM? can someone just tell me!!!

    • @pldcanfly
      @pldcanfly 10 місяців тому +2

      Pull the plug out of the wall. If on a laptop, wait for 2-12 hrs afterwards.
      (Please don't just power off your computer, bad things can happen...)

  • @kendlemintjed7571
    @kendlemintjed7571 10 місяців тому +1

    this is a great video, but you keystrokes are way to fast
    they need to linger a bit bc i can't keep up with them XD

  • @gjermundification
    @gjermundification 10 місяців тому

    17:20 vim has its own sort, no?

    • @SebastianDaschnerIT
      @SebastianDaschnerIT  10 місяців тому

      Oh yes, that's right. I'm just used to the Unix commands, I guess :)

    • @gjermundification
      @gjermundification 10 місяців тому

      @@SebastianDaschnerIT The moment you bring a pipe to the equation shell is the way to go.

  • @gjermundification
    @gjermundification 10 місяців тому +1

    0:28 `set nu rnu`

  • @AryanBuildingSoftware
    @AryanBuildingSoftware 4 місяці тому

    selection with o goated.

  • @anasouardini
    @anasouardini 10 місяців тому +1

    7:23 I feel like I'm flying!! thank you.

  • @rendivs
    @rendivs 8 місяців тому

    super coollllllll

  • @atzuyro
    @atzuyro Місяць тому

    for myself:
    7:21
    8:53
    21:09

  • @yash1152
    @yash1152 9 місяців тому

    == i didnt know yet:
    * o: switch selection direction
    * snippets
    * fzf/explorer inside vim
    == i already know & use daily/prominently
    * relativenumber
    * :exe & :norm
    * C-v box visual mode
    * i/a: in/around
    * w/W
    * scripts, is it talking about :! ?
    == i know but disagree with:
    * Mapping Esc to Caps lock
    * %: jump to matching: finnicky & unpredictable

    • @yash1152
      @yash1152 9 місяців тому

      still missing things:
      * multi-cursor
      * change case of word/letter
      * how to specify case insensitive search (with / or ?)
      * paste as replace mode
      * :z to scroll current line to top is not working at times
      * sending neovim to background to run some command etc (no, i dont want to use ! exclamation)
      * move past the last character i.e. at the line end newline char (this often helps with `db`)

  • @sub-harmonik
    @sub-harmonik 10 місяців тому +2

    I like "jk" =

    • @SebastianDaschnerIT
      @SebastianDaschnerIT  10 місяців тому

      That's what I had in the beginning as well, but I like having a reachable Esc on my system anyway (hence on Caps Lock)

  • @voice5sur5
    @voice5sur5 10 днів тому

    You're pressing way too fast, 99% of the time i have no clue what you pressed.
    the bottom thing doesn't help either as it doesn't show the sequence, just what's currently pressed for 100ms.

  • @mvargasmoran
    @mvargasmoran 9 місяців тому

    How do I exit vim? 🤣