Let Vim Do the Typing

Ғылым және технология

George Brocklehurst shows Vim's various built-in completion mechanisms. This will let us let Vim do the typing, writing fewer typos and faster!
Learn more from the developers at thoughtbot ⌨️
Head over to tbot.io/dev-blog to read more great articles on our blog.

Пікірлер: 114

  • @IanEdington
    @IanEdington7 жыл бұрын

    Overview: In insert mode you can... ^r = insert text from a register ^a = insert text from register '.' ^p = completion menu ^x = special "completion mode" submode of insert - - ^] = tag - - ^p = pull from previous context - - ^n = pull from next context - - ^f = file completion - - ^l = line - - ^o = omnicompletion How to change where to complete from: set complete

  • @fx5298

    @fx5298

    4 жыл бұрын

    I've gotta say, ^x^f is pretty awesome.

  • @sudeepdalal3540

    @sudeepdalal3540

    3 жыл бұрын

    Nice to know ^x put vim completions in context aware mode

  • @soreneddie9301

    @soreneddie9301

    2 жыл бұрын

    i dont mean to be so off topic but does anyone know of a method to log back into an Instagram account?? I somehow lost the account password. I would love any tips you can give me!

  • @sorendakari3519

    @sorendakari3519

    2 жыл бұрын

    @Soren Eddie Instablaster =)

  • @soreneddie9301

    @soreneddie9301

    2 жыл бұрын

    @Soren Dakari thanks so much for your reply. I got to the site through google and I'm in the hacking process now. Looks like it's gonna take a while so I will get back to you later when my account password hopefully is recovered.

  • @3ombieautopilot
    @3ombieautopilot5 жыл бұрын

    The speaker deserves some kind of an award for showing CTRL + r and CTRL + a

  • @theena
    @theena3 жыл бұрын

    Not a coder, but a novelist looking to rework my workflow away from documents and into text files. Been learning vim recently and, honesty, it has been a revelation. And this talk just upped my vim game a few levels. Thank you.

  • @TheToric

    @TheToric

    3 жыл бұрын

    It might be usefull to put some tome into learning LaTeX as well for the document formatting. Its helped me out a ton of times.

  • @theena

    @theena

    3 жыл бұрын

    @@TheToric Thank you. I will.

  • @VernonSwanepoel
    @VernonSwanepoel8 жыл бұрын

    How nice to watch a video where 8 minute in I'm already thinking "This was time well spent". Awesome!

  • @christopherfujino

    @christopherfujino

    8 жыл бұрын

    I'm at the exact same point right now, thinking the same thing!

  • @mitchkins5560

    @mitchkins5560

    7 жыл бұрын

    I felt like clapping around the 8 minute mark!

  • @diegorodriguezv
    @diegorodriguezv2 жыл бұрын

    I watched this about a year ago and nothing made sense. This time everything seemed so clear. Vim is a never ending learning journey. If you don't understand what's happening here don't worry. Add it to your "watch later" playlist and come back in a while.

  • @batlin
    @batlin8 жыл бұрын

    Vimgolf is a great way to pick up many of these shortcuts, but it was really nice to have a clear explanation here giving context to the optimisations.

  • @sethcenterbar
    @sethcenterbar6 жыл бұрын

    This dude is a wonderful presenter. The first time I watched this video a few months ago, I didn't really get it because I was just starting out, but this really is a great session to watch all the way through. Thanks!

  • @gregoireparis5494
    @gregoireparis54948 жыл бұрын

    Didn't know about the at end of line trick. This is awesome!

  • @cristophoenix
    @cristophoenix9 жыл бұрын

    A lot of good Vim tips in this video.

  • @ruhnet
    @ruhnet6 жыл бұрын

    Super video! When I first started watching I almost stopped, because it seemed kindof silly and I'm not a big fan of CTRL key combinations, but as the video went along and more examples were shown, it became more and more useful and interesting. Well well worth the time to watch. Thanks!!

  • @martincox558
    @martincox5587 жыл бұрын

    This is a cool video with lots of great tips. Slightly confused that the guy used CTRL-] to jump to definitions, but wasn't aware of CTRL-T to go back. Great talk :)

  • @LeonidBraynerMyshkin
    @LeonidBraynerMyshkin6 жыл бұрын

    Guys, if you're trying to stay a bit more in insert mode, there's a way to manually create and undo point (while still in insert mode): C-g u.

  • @scriptingtips596

    @scriptingtips596

    5 жыл бұрын

    Great tip Leonardo! Thanks

  • @liridonsejdiu6110
    @liridonsejdiu61102 жыл бұрын

    Promoting open source software on close source OS that's something, good job men

  • @Atreyuguy590
    @Atreyuguy5906 жыл бұрын

    Hey! Vsauce. Micheal here.

  • @Ihavetoreturnsomevideotapes

    @Ihavetoreturnsomevideotapes

    5 жыл бұрын

    Hey vsauce Michael here

  • @vivekpanchagnula815

    @vivekpanchagnula815

    4 жыл бұрын

    hey vimsauce

  • @333peacher4

    @333peacher4

    4 жыл бұрын

    I was just scrolling down to say that and saw yours.

  • @Abstrafe1

    @Abstrafe1

    3 жыл бұрын

    except he is British

  • @rakesh4a1
    @rakesh4a17 жыл бұрын

    Some new VIM hacks added to my list. There is lot to learn in vim for easy coding.. thanks a lot. This tutorial is presented more than an year before, can we get some more hacks here Mr. George Brock. +1

  • @magno5157
    @magno51575 жыл бұрын

    Great talk! Very clear and succinct.

  • @frzen
    @frzen2 жыл бұрын

    Brilliant. Can't believe I didn't know the line competion

  • @srinirg1
    @srinirg17 жыл бұрын

    That is a very good tutorial. Thanks!.

  • @toxicsneeze
    @toxicsneeze7 жыл бұрын

    This is awesome sir, thanks for your video.

  • @harshraj22_
    @harshraj22_4 жыл бұрын

    Thanks a lot for this wonderful video.

  • @ahallock
    @ahallock4 жыл бұрын

    TabNine takes completion to an entirely new level

  • @sixro
    @sixro3 жыл бұрын

    Very informative. Thanks.

  • @GSourceCode
    @GSourceCode5 жыл бұрын

    Best talk on power of insert mode 1. Ctrl x + f #filename complete ] #tag complete l #line complete o #language complete p #word complete n # word complete 2. Ctrl + r + a # a register Register " & 0 is current resister are woderful Amazing talk. Thanks a lot GitHub repo : georgebrock/talks

  • @siegfriedgessulat4934
    @siegfriedgessulat49347 жыл бұрын

    Thank you for the great talk!

  • @BluePaperUmbrella
    @BluePaperUmbrella4 жыл бұрын

    Great video, thanks.

  • @MikeCarden
    @MikeCarden6 жыл бұрын

    Great talk - thank you for sharing. I *am* twitching though. All these comments and nobody mentions what the fox did? If the fox 'jumped' rather than 'jumps', you have no letter 's'. The sentence is intended to exercise every alpha key on a typewriter. I'm curious. Has anyone mentioned this in live talks?

  • @hangugeohaksaeng
    @hangugeohaksaeng8 жыл бұрын

    Great talk. Thanks!

  • @folksurvival
    @folksurvival2 жыл бұрын

    Balding? Check. Glasses (with thick rimmed frames)? Check. Beard? Check. T-shirt? Check.

  • @jozsefgubicza8808
    @jozsefgubicza88088 жыл бұрын

    Really great talk! I've never used VIM in this way but it's super cool that it can do that. How do u show what your typed in chars at the bottom of the window? Is it a plugin or can be set up this way? It would be useful for me to know what I've just typed in to make sure.

  • @PumarkoHD

    @PumarkoHD

    7 жыл бұрын

    set showcmd

  • @sh1pme2themune9
    @sh1pme2themune94 жыл бұрын

    Should've called this video, "Chad Insertion (Mode)"

  • @Jack-qd4xe
    @Jack-qd4xe8 жыл бұрын

    Great video. Very informative. Is there anything like this available for Emacs?

  • @ehrenmurdick
    @ehrenmurdick2 жыл бұрын

    +1 for not remapping leader key. ',' is useful for going back after f and t.

  • @josephknightcom
    @josephknightcom5 жыл бұрын

    Side note to all, to turn off spell check: :set spell! Not intuitive and is not in the ":help spell" vim documentation.

  • @geoptus

    @geoptus

    5 жыл бұрын

    true, the use of ! is not obvious to find, i ran ":h toggle" and got the general "set-options E764", "set-! :set-inv" typically, any boolean type attribute will 'toggle/invert value' with "!" a good use case - :set relativenumber!

  • @recklessroges

    @recklessroges

    4 жыл бұрын

    :set nospell

  • @wulymammoth

    @wulymammoth

    4 жыл бұрын

    Also better to have it only set for particular file types like markdown

  • @PestOnYT
    @PestOnYT5 жыл бұрын

    Great vid. Learned some new tricks. I was hoping to "map" ^x^p to a function key (F7), however in insert mode it just inserts . Would have been great. I may have to use macro keys of my keyboard... Anyways, thank you very much sir!

  • @user-hj1dc2wp7v

    @user-hj1dc2wp7v

    4 жыл бұрын

    You have to use :inoremap, as in "(i)nsert mode (no)n (re)cursive (map)ping". If you don't put the "i" you're only mapping for normal, visual and select modes by default.

  • @KbIPbIL0
    @KbIPbIL08 жыл бұрын

    "Control X Control Oops"

  • @pspicer777
    @pspicer7775 жыл бұрын

    First there was Vi vs. Emacs ... then the Big Bang and the Expansion of the Universe....

  • @VanStabHolme

    @VanStabHolme

    4 жыл бұрын

    Vim tries to be a good editor that can also be an IDE. Emacs tries to be a good editor but ends up being OS.

  • @mingwen196
    @mingwen1966 жыл бұрын

    11:23, how can he show the next key options following c-x? oh , i see set showcmd

  • @ifohancroft
    @ifohancroft3 ай бұрын

    Can someone link to rcm, please? It's not linked in either the description or the video's associated blog post.

  • @MarkSkipperBiterjug
    @MarkSkipperBiterjug8 жыл бұрын

    What's that awesome jazz at the beginning?

  • @Vinomix

    @Vinomix

    7 жыл бұрын

    james bond

  • @chris-ew9wl
    @chris-ew9wl4 жыл бұрын

    So I tried this out, is there a way to make Ctrl-X Ctrl-P work across buffers? Or it only works on the same buffer?

  • @chris-ew9wl

    @chris-ew9wl

    4 жыл бұрын

    Okay, I figured this out, I hope someone finds this useful. You need to do a Ctrl-N *first* if you're doing it across buffers. After that context-aware kicks in and Ctrl-X Ctrl-P works now.

  • @quebono100
    @quebono1003 жыл бұрын

    Haha, vim as a language model, awesome

  • @Tala2n
    @Tala2n4 жыл бұрын

    The fact you have to type "Ctrl-P" to get the completion suggestions kills the benefit of the feature for most words.

  • @ddddddddd345
    @ddddddddd3458 жыл бұрын

    I have a `+insert_expand` enabled, but Ctrl-X in insert mode does not seem to be doing anything for me. What am I missing?

  • @cthzierp5830

    @cthzierp5830

    4 жыл бұрын

    It might have been remapped to Cut (as in cut/copy/paste) by the installer?

  • @opal6605
    @opal66055 жыл бұрын

    g; return to last edit

  • @lylez00

    @lylez00

    3 жыл бұрын

    '. does the same thing.

  • @Phantom-pj1ls
    @Phantom-pj1ls3 жыл бұрын

    For some reason example at 4:02 doesn't work for me :( When I press . it only repeats "world"

  • @goldahong4392
    @goldahong43922 жыл бұрын

    Hello thoughtbot, thanks for this video! How do we know the word Hello is in Register 'a' and the word World is in Register 'b' ? Your reply could really help me a lot! Hope to hear from you soon.

  • @michalski9141

    @michalski9141

    2 жыл бұрын

    you can yank text objects into registers by pressing “y. There are also the special registers * and + that allow you to copy and paste from your clipboard with “*y and “*p. You’ve probably figured it out by now but hopefully anyone else can learn something new

  • @theAIex2
    @theAIex25 жыл бұрын

    Does anyone knows how to add the option kspell for the autocompletion?

  • @geoptus

    @geoptus

    5 жыл бұрын

    if you mean ":set complete=.,w,b,u,t,i,kspell", add this line to your vimrc file

  • @rmmichael95
    @rmmichael956 жыл бұрын

    That moment when he presses a Enter esc instead of o...

  • @VulcanOnWheels

    @VulcanOnWheels

    4 жыл бұрын

    If you're referring to a moment in the video, it's a good thing to include the time index. I usually do it at the beginning of the line.

  • @gurdeepgss

    @gurdeepgss

    4 жыл бұрын

    @@VulcanOnWheels 2:52 , there you go buddy.

  • @JustinCDas
    @JustinCDas8 жыл бұрын

    Thanx for this video........

  • @Ihavetoreturnsomevideotapes

    @Ihavetoreturnsomevideotapes

    5 жыл бұрын

    Yealas be gei

  • @kurt44mg42
    @kurt44mg426 жыл бұрын

    @6:56 The quick brown fox jumps - not jumped - over the lazy dog. Just saying...

  • @okuno54
    @okuno548 жыл бұрын

    "Tests have a repetitive structure" which is why I use a strong type system :P Not really related to the talk, but it's odd to see how much my methods have changed in the last few years.

  • @gladwinmohlamonyane4033
    @gladwinmohlamonyane40336 жыл бұрын

    this information can be found in the help files right?

  • @nafaa-news

    @nafaa-news

    6 жыл бұрын

    Yea, :help i_CTRL_X will get you to that CTRL_X tip help. The help files are huge and you'll get lost there very quickely if you don't know what you're looking for.

  • @Ihavetoreturnsomevideotapes

    @Ihavetoreturnsomevideotapes

    5 жыл бұрын

    Haha I know

  • @parrotraiser6541
    @parrotraiser6541 Жыл бұрын

    The audio level on this fluctuates from low to inaudible, unfortunately.

  • @joshpetit8298
    @joshpetit82983 жыл бұрын

    I'm disapointed. I thought vim had implemented neurolink so that we can type with our minds. This suffices enough though :)

  • @LukeAvedon
    @LukeAvedon5 жыл бұрын

    Stupid question: How do I add kspell to set complete?

  • @recklessroges

    @recklessroges

    4 жыл бұрын

    :set complete=.,w,b,u,t,i,kspell or echo "set complete=.,w,b,u,t,i,kspell" >>~/.vimrc

  • @stv3qbhxjnmmqbw835
    @stv3qbhxjnmmqbw8352 жыл бұрын

    He's a Ctrl freak Just kidding, loved the content.

  • @nihilistic7840
    @nihilistic78404 жыл бұрын

    I didn't know about text completion! ^p and ^n!

  • @mikej7476
    @mikej74765 жыл бұрын

    This is WAYYYY more typing than it needs to be. At least from what he is saying and showing, it comes across as twice the work for two words.Why does it come across like twice the amount of work for such a small amount of text?

  • @ex0stasis72

    @ex0stasis72

    5 жыл бұрын

    That's like saying that people learning programming shouldn't write hello world programs. They should just open up a Word document and type "Hello World!" because it's easier. The point is to show a concept in a simple context so that you can use it for longer strings of text with symbols and other obscure characters to type.

  • @GuilherHast
    @GuilherHast3 жыл бұрын

    I tried to enter in insert mode here in youtube but it minimized the video.

  • @richardbekking
    @richardbekking4 жыл бұрын

    Shorter commands: set rnu set nu

  • @freeuyghur2063
    @freeuyghur20636 жыл бұрын

    ctrl + x is so powerfull.

  • @Ihavetoreturnsomevideotapes

    @Ihavetoreturnsomevideotapes

    5 жыл бұрын

    Sxexll

  • @chewie481
    @chewie4819 жыл бұрын

    ctrl-x is such a horrible bind. on my layout, x is directly under the left pinky so pressing left ctrl is out, and the right one is too far away... I’ll probably bind it to x

  • @rooneye

    @rooneye

    9 жыл бұрын

    M1zzu q Change Caps Lock to CTRL :D

  • @thomasloven

    @thomasloven

    9 жыл бұрын

    +M1zzu q So? This is vim. Remap it to something that works for you.

  • @DurgaswaroopPerla

    @DurgaswaroopPerla

    8 жыл бұрын

    +Thomas Lovén Yep. Do what ever works for you!

  • @user-lh8df2pt5k
    @user-lh8df2pt5k5 жыл бұрын

    oh, what am I doing here, I remembered I'm an emacs user..

  • @neonblood4658

    @neonblood4658

    4 жыл бұрын

    Fate brought you here, switch to the good side

  • @AndyThomasStaff
    @AndyThomasStaff2 жыл бұрын

    I love hitting ctrl-x, ctrl-] to autocomplete a tag name in my project. Just kidding, it's terrible, Vim is inefficient by design and forces you to learn how to glue lots of nasty little commands together like these to try to be efficient. Sure you could use a modern IDE that does all of this for you with intellisense, but that wouldn't give you carpal tunnel from vim commands, so maybe it's not worth it.

  • @xged.
    @xged.5 жыл бұрын

    Spacemacs out-of-the-box (auto)completion is significantly better then this one. (Although this vid is 4yo)

  • @wulymammoth

    @wulymammoth

    4 жыл бұрын

    I wouldn’t switch back to Spacemacs for subjectively “better” completion. I’ve used Spacemacs and configuring it was such a pain in the ass for the 9 months that I tried it. Vim/Neovim with LSP (language server protocol) is probably better than what you’re suggesting

  • @encycl07pedia-
    @encycl07pedia- Жыл бұрын

    I stopped watching as soon as I saw the unmistakable Mac/Apple UI. Not only is Mac OS terribly inefficient and garbage at multitasking (even 8 years later in 2023), it's also one of the pioneers in anti-consumerism in the 21st century.

Келесі