Vim: Vim as an IDE (VimConf 2020 Talk)
ฝัง
- เผยแพร่เมื่อ 15 มิ.ย. 2024
- Learn how to transform bare-metal Vim to a 🔥 fully integrated IDE 🔥 for any language of your choice by following this 7-step hands-on process 🤙
📔 View the Vim presentation slides: bit.ly/3333acP
This talk was presented as port of Vim's first virtual Vim conference (vimconf.live), and goes over howe can natively 🛠️ configure 🛠️ Vim to do everything we'd expect from a typical IDE, including seamless file navigation, instantaneous symbol lookups, and smooth build-and-edit workflows. The goal of this is to show you how you can tailor Vim to work for any language without requiring external plugin support, so that you can become a better Vim editor and make smarter decisions about what optimizations you really need as a plugin versus those already on the table.
We'll be exploring the following, each with practical demos to follow along:
0:00 Intro
1:55 Initializing a vimrc
10:21 The runtimepath and formatting
17:49 Using Vim's :path to instantly find files
24:57 Include-search, Vim's most powerful feature
54:24 Tags
55:49 Compiler Support
1:03:10 Portability
Which step did you enjoy watching the most? What topics do you want me to cover? I'd love to hear your thoughts and feedback in the comments section!
🎉 Contact Me:
/ leerenchang
/ leerenchang
/ leeren
Subscribe: / leerentalks
#vim #vimconf
My favorite part of the talk is the thumbnail image. That's because I'm here as an aunt, not a Vim user :)
❤️although I know it'd be really easy for you to learn this
VIM is easy and it changes your life, much like when you first meet Jesus
When you go on TH-cam to learn something about programming and the lesson you get is about Love. The world is so awesome in so many way...
And I like your thumbnail too. Regards.
nice thumbnail :)
Loses all his money in crypto; doesn't put ads in the vid. Gentlemen we have a true hero in our midst
:')
sorry market too unforgiving, no longer robinhood
@@leeren_ I would be dissapointed if you didn't put ads tbh 🙂
True heroes don't invest in cryptos.
@@superscatboy Based.
You've found your calling, mate. Great pace, style, insight, delivery.. everything. Very, very watchable and retainable info.
Thank you! Super motivating! I wanna do this full-time
I like how you come straight to the point. Being a professional since many years, I avoid using vi/vim until there are no options left but silently admire people
mastering vim. I know that vim is a great tool for being more productive and I promise to take the time and learn how to get a foot in this. Most IDEs are just a pain and
are doing a great job in distracting you from the work you are supposed to do.
Thank you! Yeah getting your hands dirty with learning Vim is quite the challenge, especially starting off! But it's lots of fun
There is only 1 case when it is required more or less - is when you are working from a pure console. Even vscode now can give not less functionality. I even can edit code through ssh using vscode. So i use vi (not vim) only to edit some config files on remote host.
Programmers from 70's did not need color screens, LSD was plentifully and not frowned upon back then .. ;)
Word! Although I have doubts whether you could program effectively tripping LOL
Absolute master class, very informative. High quality videos on this topic are rare. Looking forward to more videos from you.
Thanks! It means a lot to me!
LOVE THIS. Learned a ton and I’ve got 20 “fuc*ki’n” years of vi on this guy. I toyed around with this c. 2003. Lost a lot. Forgot a lot. Suffered a lot. I have a renewed mission. Your presentation style is perfect! I’d attend this in person. And the highlights on config lifecycle. OMG. Three words: lifecycle, lifecycle, lifecycle. It applies everywhere. I preach it and live it. And when someone asks me “but how did you know X?” My response has often been, “the lifecycle defines it.”
Thank you! I live by that lifecycle rule. And it's great to hear you enjoy this presentation style.
My favourite part was the after/ftplugin bit. I can move the 50+ 'autocmd FileType....' statements from my init.vim to separate files now!
I think you could have blown people's minds even more with the built-in completion, which I don't think you mentioned...
(For the benefit of those who don't know:)
In insert mode:
C-p / C-n : Complete identifiers in the current file (and some others?).
C-x C-i : Complete identifiers in the current file _and_ included files.
C-x C-d : Complete identifiers matched by the 'define' RegEx, in the current and included files.
C-x C-] : Complete identifiers from ctags. This is especially useful because C-x C-i can be really slow if you have a big tree of included files.
Also,
set completeopt=menu,preview,longest
for a pop-up list of completions.
I feel like I found my long lost brother... Great job man. I think you've inspired a lot of people to learn the core of an application and RTFM before seeking plugins.
Subscribed to the channel within 3 minutes of starting this video. I'm a Math & CSC undergrad and this kind of information is never covered or done poorly. Thanks so much and I hope you keep making videos!
Salutations from France and many thanks to the frankly speaking and efforts to make it easy to understand. Merci beaucoup.
Hey Leeren. I just want to say a big thank you.
Your talk at one of the conferences, a few years back, helped me to understand how vim keys are mnemonic, I also understand that some bindings are visually shaped across the keyboard.
For example, in tmux, ctrl+b for command then shift double quote, this visually splits the keyboard in half, for a horizontal spllit, and ctrl+b shift %, for visually splitting keyboard for visually splitting window. I know, it's not vim, but vim has a couple keybindings that work visually, but it escapes my mind right now until I go to use it, so I used the tmux example.
There are three videos on youtube that have made me a power user in vim, where I feel like I can manage every aspect of any projects from within vim. From local files to remote files. No matter which computer I jump on, I can load my vimrc from my server and have full functionality (vim has scp, which is like ssh's scp, vimscp, simple right). Your prior conference video was a major breakthrough for me and is the top video I reference. This video now being the second top video.
Also. I know you don't like highlighted search, I personally like it. What I did to remove the annoyance of the highlight after I finished my search and changes, was added a keybinding to clear my search. I use comma as my leader, so I type ",cls" for clear search, and it sets the search register to empty.
cls :let @/ = ""
Anyways. Your videos are astronomically important. I have vimified my computing because of them, even in my browser with surfingkeys. This concept has cascaded into other factors of my life outside of computing. A clear example, people think the future is like Minority Report, where you wave your arms everywhere to complete a task, but vim has taught me that the future is lazy, why wave your arms, or swing a mouse, if you could do the task near the speed of thought with simple key press. Now, I only need my mouse when I'm working in something like blender, or a weird site where surfingkeys doesn't work that well.
I highly appreciate your contribution. Thank you very much.
For anyone else reading this that is curious on my main reference videos.
This video. Then.
Lereen's talk -> th-cam.com/video/E-ZbrtoSuzw/w-d-xo.html
Thougtbot talk -> th-cam.com/video/XA2WjJbmmoM/w-d-xo.html
Also, consider skeletons, then add a keybinding, this becomes the emmet equivalent to vscode. For example, I use html that then pastes a skeleton file. Super easy. It then pastes my base html code and jumps to where I want to begin editing.
Example:
nnoremap html :-1read $HOME/.vim/skeletons/html_skeleton.html/titlef>a
Once again. Thanks.
I am learning a lot from this tutorial. This guy dragged me back to use vim again.
Though there are points need to digest (understand) and by ways he delivers his teaching is no BS.
Thanks for this video and it is worth watching it. Looking forward for more technical videos.
Instant subscribe. Really thorough. Love the “from scratch” approach.
Thanks! Glad you loved it!
@@leeren_ Same here. When you deleted your vimrc and all previous configurations I knew that this was gonna be an awesome video, because I knew that I would be able to do it all myself
... or at least hopefully. Still haven't gotten to the doing it myself part, as an nvim user I hope nothing is different
EDIT: also I hope you didn't sell your bitcoin (assuming this really was taken in 2020) because you would have gone from broke to woke real quick
Your no nonsense explanations about vim and all the side stuff like path etc are the best I've seen, and I have seen a lot.. :)
I'm not a professional programmer. I always find several settings I want to incorporate into my vimrc. Unintended audience? Probably many people like me benefiting from your videos. Very generous of you to share. Thanks!
That's so great to hear! Thank you for watching! I definitely agree Vim isn't just constrained to programmers. It's a great tool for anyone who wants to learn how to edit files effectively
Great to see more videos from you man, I watched the talk video a long time ago when i was first learning vim and it helped a lot. Keep them coming, subbed!
That's awesome. More will come!
Dude, this was very entertaining with great organization and flow. Subscribed AF!
Really impressed with the high quality content. Really looking forward to hearing more of your talks
Thanks, more will come soon, and a lot more will come next year. What do you think of my latest one on kiwifruit?
I always come back to this. great teacher !
Your includeexpr explanation and the 5 minute vimscript live programming pointed me in the right direction. The rest of the night I spent writing some vimscript to echo the definition of the function under the cursor by recursively checking inside includes, mapped it to a key and now vim is my main IDE.
Instant sub, you are a legend, no matter the endfunction bug :D
I’ve been using vim for 12 years now, and I never actually found a good, deep explanation like this one about include search.
Also, I love the “start from scratch” approach and the minimal setup (I HAVE to clean my vimrc now!), the live coding/debugging is fantastic, I learned so much from it!
Thank you, thank you, thank you for sharing!
Wow, that's a long time. Thanks so much! Glad the approach worked well for you. Stay tuned for more!
@@leeren_ Yeah, I know right? I'm OLD! 😱
Can't wait to see more stuff from you 👍🏻👍🏻👍🏻
I'm always learning about vi since 2000. Thanks for all man you're awesome. Your tips & tricks wawww.....
I like this presentation a lot, it feels well-structured, well-paced, with clear explanations and examples, good job!
plus, your sense of humor and way of speaking is great, it really contributes to the viewing experience haha
Thank you! That's great to hear! Will keep up with it
So much insights in the video. I discovered a whole new world of vim. Love the vim more! Keep it up.
Thanks for the great video. I have been using Vim for years, but only basic commands. I have learned so much from this video, and I'm still only halfway through. Please make more videos in general!
You are just amazing. I thought I know lot of vim, but what you have showed is just fabulous. I was amazed at the compiler settings.
Thank you! I hope it helped!
Great job! This guy is the best I have been watching so far.
Keep going man with your excellent approaching
Thanks, stay tuned!
i agree. although, check out Greg Hurrell's vim screencast. The dude is also a vim wizard.
I am an intermediate Vim user but while watching your talk, I felt like I don't know crap about Vim and it felt amazing! lol.
Looking forward to future contents. XD
Haha I feel the same way learning from even more advanced users too! More content coming
Live example of using stow is super cool. Thanks Leeren!
I loved the live presentation, happy to watch one in which you have more time. I don't know why but I find you Leeren so funny. Keep up the great work!
Thank you, I will!
Great talk, thanks for doing this. Love your passion for vim. Good luck on the youtube career!
Thanks so much!
I've been using vim in a very sub-par way compared to you. My vimrc is full of plugins and copy-pasted code from articles online, but I haven't spent the time to really understand all my configuration. You made me want to really understand how vim works and go with a much more minimalistic approach. Thanks for the great video!
That's great to hear! I am 100% sure that's how most people start. You're on your way to greatness
Highly appreciate that you are no bullshit guy. This type of content will rise heights!
Thank you! No BS is my style for sure
Very good information even for beginners. Thank you for your videos.
افضل فديو شاهدته عن فيم ، شكرا لك
Amazing and really helpful practical talk.Really impressive skills. Keep up the good work.
Thank you! I will!
Really loved your talk man.. its one of the best I have seen on vim/neovim.
Best part was the organization, how you broke your session into 7 parts. I learnt a lot. Thanks for sharing
Parts with include-search, setting compilers and managing dotfiles were totally new for me.
Cheers and wish you grow fortune in Bitcoin
Thank you for the incredible acclamation! I hope you learned a lot and can incorporate these tips into your workflow!
10:43 was brilliant for me, so so true about GO, the rest of the talk was awesome - thanks for sharing :)
Right? Go is definitely my favorite language to use. For backend servers I'm convinced it's the superior option
The best Tutorial Channel ever. Three videos, down to earth
Thank you! Appreciate it!
@@leeren_ Do you have any Idea when you will give your next talk/presentation?
@@martinmusli3044 Within a week but it won't be on Vim!
This video is gold! I learned a lot. Thanks so much, man !!
Glad you learned a lot from it!
Love this video, and I love you’re teaching style bro you’re hilarious 😂
probably my favorite tutorial that I've ever seen.
also made me realize I think I know vim but I really don't
Excellent delivery dude! Subscribed!
Thank you!
Great stuff! Smooth teaching. You are born to be a teacher.
Thank you, that means a lot!
Hi everyone - remember to visit my community channel to give me suggestions on new videos to do and to stay up to date with everything that i'm working on: th-cam.com/users/LeerenTalkscommunity
New to the channel. You knocked it out of the park. Thanks for sharing this stuff.
Thanks so much!
Thanks a bunch for the video. This clears a lot of things for me!!
Glad to hear it!
Love the 'from scratch' approach
Thanks, glad it helped!
So today I learned tree, :ij where to stick my vimrc, and a whole ton of stuff. This was a very densely packed video. Suggest you do a video on standard vim commands. I've used vim for years, and haven't seen half the tricks you used. Thanks for a great video. One thing that I was hoping for was how to do debugging through vim. I don't even know if that's possible, but to me an ide includes debugging.
Thank you for the suggestion! Glad you learned a lot! I haven't played around much yet myself with debugging using Vim natively. What I do is just open a separate Vim terminal window and debug there.
Thank you so much for sharing this.
Thank you for watching!
Great talk!
Loved this talk. Thank you for sharing it. :D
Thank you for watching!
I am super lucky found these videos on my youtube home.
Instant subs too, thank you for the great explanation for newbs like me :D
thanks for subbing and watching!
NIce work with the include/define section, and with the easy to understand way of explaining the error format. I would personally prefer a much wider window showing your current keystrokes as sometimes (more like very often) you type faster than I can follow in the tiny window at the top right. I would suggest screenkey for this purpose as it has a screenwide bar
Yeah, that's a great suggestion, and a problem I haven't figured out myself yet. I use KeyCastr on MacOS right now, and unfortunately the default (wider) mode works terribly when running apps in full-screen mode. Does anyone know of good key casting alternatives?
That was the most liveliest vim setup i've seen on youtube. Like the color and syntax on part and all awesome bro!!
Btw i was wondering where should i go to read all this like a documentation or a book or something which will help me get a quick glance and
also tell me in "from the scratch" approach
P.S i am giving a like and a comment 6 mins in the video
Thanks for the kind words! Yeah I think the best resource for self-learning is to experiment on your own. When there's something specific you'd like to do, use a google search to point you in the right direction, and from there you should be able to know where to consult the vim manual for specific guidance via :h
Instant subscribe. Amazing tutorial
Thank you!
Nice mate. Thanks for this.
Thank you for watching!
Thank you for the time stamps!
Of course!
You just made my day, excellent job !
Very happy to hear! Thank you!
Is More Useful Than VS Code?
@@ItsYourBoyMRAR I would say that it's different approach. Can be much more effecient, but learning curve is much harder.
@@matka5130oh ok
Hi. Thank you for this video. It is great.
I love using VScode. But after watching this video I've started using vim extension in VScode.😁 Still using vscode
Sweet. How's that going?
I started using that, but I quickly found that Vim was stepping on some of the VS Code shortcuts, like CTRL + B to hide the file explorer. I guess I could remap that key binding, but I think I might go the route described in this video.
I guess that's one of the cool things about Vim -- lots of ways to tailor it.
as a new vim user it's very helpful, thank you
I'm glad it helped you!
Wow! Your vim talks are awesome. I learn so much from them. Thankyou. Just keep it clean and have a search for bare git repositories to store your dotfiles
Thank you for watching! Will do
So helpful. Thank you
Glad it helped!
Kalle sent me here and I am not disappointed. Nice stuff
Thank you! I am very grateful Kalle shared this!
That was a great talk. Really learned a lot about i-search, define, and make. Will be an improvement over my current workflow of ctags, grep, and ctrl-z (with redir to a file if I need to see the error within vim).
So it looks like :dj only searches files populated by include, and not path. So in java where imports are implicit for files that are in the same package, this will not work. Am I understanding that correctly? Looks like I will continue to use ctags for java.
@@kevko5212 Yeah unfortunately this is where include-search can be fairly limited. You're spot on about that.
Thank you very much indeed! Great talk and guide for fresh Vim user like me (especially interested in Python) ;) Thanks!
Thank you! I'm glad it helped!
this was simply amazing,
Thank you very much!
Great talk! Especially loved the include-search part, because a lot of vim users will be unfamiliar with it, I guess.
Thank you! Yes, it's the most under-appreciated feature in all of Vim in my opinion.
keep it up man!
This guy inspired me to use Vim (his first talk on going mouseless with Vim and Tmux)
Wow, it's my pleasure!
you know, I have used vim for several years now and had a somewhat complicated structure of config files to load per filetype basis. Thank you very much for showing me the /after/ftplugin directory
Hope it helps! Great that you learned something new!
wow, 1h 6m... deep dive into Vim! Awesome!
Hope you enjoyed!
What a beast. Thanks.
Of course I had to subscribe
Thank you!
Awesome video! Very well organized and explained, and extremely helpful. I was wondering why you suggest that ctags should be a backup plan if include-search doesn't work. Doesn't ctags do everything include-search can? What makes include search better?
Thanks again for making this video, and your past ones. Some of the best vim tutorials I have found. Subbed.
Yes, I would suggest exactly as you said. Include-search is preferable because it has more features built to work specifically for vim (just look at :help include-search), whereas ctags was built as a generic tool usable for many different editors (and Vim of course has a bunch of features to support it, but include-search is more flexible overall)!
I'm honored, thank you for watching!
Thank you for the lesson! I will have to replay this a couple of times, there's too much information for one viewing.
PS: Yes you're a legend 🙂
Thanks! Hope you learn a lot!
Hi Leeren! Looking forward to see more of those great tutorials! Thanks a lot!!
One small change I had to make to PyInclude function is this:
let l = substitute(parts[0], '\.', '', '')
Since cases like .conv (relative python imports where not working for me).
Thanks for sharing this. Maybe it's a versioning issue.
Really good 👍, I like the way you are not using any plugins. I'm also using similar style whether it's work project or personal, just start with any plugin to get the job done and then understand the plugin and if it can be achieved without plugin then create your own script / function so that we can avoid third party dependencies and also learn about how it works. Also you can personalized it the way you want as third party libraries are designed to cater all types of user and your need might be different.
Thanks a lot! Yeah, that's the same way I use to personalize my Vim!
Alright, I finished the video. Do you have your dotfiles anywhere? The include/define section was an eye-opener, but I prefer not to write out that regex.
Oh yeah, I'll add that to the slides! And I'll try to update my git later this week.
Pls do more TH-cam video, I think this channel can rival even the best Vim channels
#1 baby
VIM has impacted my life more than religion, All hail the cult of vim
Go Vim!
This was awesome
Thanks!
I created a csound file with vim yesterday and it automatically opened with a template with all the boiler plate code inserted. VIM is full of surprise features that you can often accidentally discover by mistyping in edit mode.
Another reason why it's so great! So much to explore.
man your voice is incredibly soothing lmao
Thank you!
Hi Leeren, Thanks to you I started working with VIM two years ago and I really enjoy your super informative videos. But one thing you never mention/use is LSP. Is there any reason for that?
No reason! Just trying to cover all of Vim's native features before moving towards that topic! LSPs are great
Im using vim for php
Xdebug works as expected,
Everything about vim is awesome.
Agreed!
Subbed and notified and thanks for a great 1 hour oversight on vim as an ide. Specifically, the Path explanation, that was super useful. I'll watch it again when I'm sober. As for BTC, we've just had a halving, hold tight, give it 18 months and you'll be fine... Bitcoin is a longterm investment..
Thank you! Yes, Path is super useful, even if you're not sober. With you on it being a long-term investment! I'm not worried at all :)
3 minutes in - "This guy is good! I'm going to enjoy this."
Did you enjoy it? Thanks!
What's the name of the software that you use to show at the top right of your screen to show the characters that have been typed? By the way I love the "from scratch" approach. Hugs from Brazil
KeyCastr! Thank you so much for the support! Viva la Brazil!
/usr/include in the default path had nothing to do with finding vim configs, but is where library headers (.h files) are stored. It's useful for C/C++.
Ah, I made a mistake then, thank you for pointing that out
I'm a Java developer and I write enterprise applications. Thank you for acknowledging that vim can't replace an IDE.
emacs actually can, watch this th-cam.com/video/Bbjxn9yVNJ8/w-d-xo.html
VIM can replace an IDE. He just didn't go over plugins, in this video he just configured bare vim to a usable state but with plugins you can get auto-completion, syntax checking, snippets and any fancy feature that you would get in any normal IDE.
@@VictorRodriguez-zp2do Does Vim also provides a debugger just like modern IDEs especially for Java? Because if that's the case then I'm happy to make the switch. Currently I'm using intellij with a vim emulator.
@@KiraTheUnleashed Yeah you'd have to use a debugger for that. This is where a Vim plugin might come in handy. I typically like to debug in a separate Vim terminal window e.g. using pdb / gdb
@@leeren_ There's also termdebug, but that simply opens gdb in a vim terminal so it's more like a shortcut than anything.
Great video, very well explained and a true from-scratch approach. Looking forward to seeing more of your videos!
Regarding escaping in the include/define options, you can get around double-backslashing by using a let statement instead, like:
let &l:include = '^\s*\(from\|import\)\s*\zs\(\S\+\s\{-}\)*\ze\($\| as\)'
It's explained also in :h 'define', I find this a lot more convenient than having to manually escape everything. You can also reduce the amount of backslashes needed by enabling verymagic mode, with the \v flag:
let &l:include = '\v^\s*(from|import)\s*\zs(\S+\s{-})*\ze($| as)'
Excellent tip. Thanks for writing out the alternative so we can all learn from you!
The swap files are the bane of evil 😂 Great pres, btw 👍
Hate em - thank you!
Best bit was the "Well F*** you man!" (25:20) made me laugh out loud! Quality!
On another note this video is incredible and is really helpful and insightful thank you!
LOL - love that you found that funny too! Thank you for the wonderful words
I actually dislike such swearing in videos
Love that part too. it's an amazing video. 1.5x speed is the best. Leeren shaking like a BOSS!
Hi! Thanks for the amazing video! However I have problems with include search. If a function or word is called more than once in a file and I do an `ij` on it shows me results from the same file. And not the actual file the function was defined in. How do I fix this?
Take a look at using vim methodology (ie. modal editing, command language, etc.) in something like VSCode which has a ton of IDE functionality you can wire up to.
Have you thought of incorporating treesitter into the include search workflow? Also, how do you handle the multiple returns needed for something like:
From package import Part1, Part2, Part3
Awesome video!
Yeah I haven't updated my include-search Python file to support that yet. It definitely gets complicated. That's when I start to fall-back to Tags.
Haven't used treesitter before. How do you like it?
Thanks! But what is difference between buffers, windows & tabs in vim?
I have come across include path while reading the help pages, but I couldn't get it working or figure out how it was supposed to be used. This talk demonstrated just how powerful it can be! Not what I expected from the title, but thanks! Looking forward to more
Thank you! What DID you expect?
Leeren I have been seeing a lot of TH-cam suggestions recently for multiple videos that cover how to make Vim work like VSCode by adding usually LSP, fzf and nerdtree plugins. I guess I saw the words "vim, ide, 2020" in the title and assumed it would be the same
@@Spikey8d Cool! How do those compare? I actually don't watch other Vim YT vids
My guess is that for the average non-super-vim-enthusiast how to get Vim to be like VSCode with minimal effort is what they want to see, but how to grok Vim and what it comes with built-in is what will bring the most value to their editing experience. I'll take any Vim content I can get, whether that's showing off their workflow and plugins or giving a ground-up walkthrough of the nitty-gritty --I appreciate it all