Vim Can Save You Hours Of Work

  Рет қаралды 169,180

DistroTube

DistroTube

Күн бұрын

I sometimes get people asking "Is learning Vim worth it?" The answer to that question is a resounding "YES!" Vim can save you so much time editing text once you learn some of the advanced features available within it.
REFERENCED:
► www.vim.org/
WANT TO SUPPORT THE CHANNEL?
💰 Patreon: / distrotube
💳 Paypal: www.paypal.com/cgi-bin/webscr...
🛍️ Amazon: amzn.to/2RotFFi
👕 Teespring: teespring.com/stores/distrotube
SOCIAL PLATFORMS:
🗨️ Mastodon: mastodon.technology/@distrotube
💬 IRC: irc://freenode #distrotube
👫 Reddit: / distrotube
📽️ LBRY: lbry.tv/$/invite/@DistroTube:2
DT ON THE WEB:
🕸️ Website: distrotube.com/
🐿️ Gopherhole: gopher://distro.tube
📁 GitLab: gitlab.com/dwt1
🔊 Audio Podcasts: www.buzzsprout.com/1263722
FREE AND OPEN SOURCE SOFTWARE THAT I USE:
🌐 Brave Browser - brave.com/dis872
📽️ Open Broadcaster Software: obsproject.com/
🎬 Kdenlive: kdenlive.org
🎨 GIMP: www.gimp.org/
🎵 Audacity: www.audacityteam.org/
💻 VirtualBox: www.virtualbox.org/
🗒️ Doom Emacs: github.com/hlissner/doom-emacs
Your support is very much appreciated. Thanks, guys!

Пікірлер: 816
@klimenkodr123
@klimenkodr123 3 жыл бұрын
> Has relative line numbers enabled > Still does the math to calculate lines
@QW3RTYUU
@QW3RTYUU 3 жыл бұрын
is this 4chan
@completelyandutterly001
@completelyandutterly001 3 жыл бұрын
@@QW3RTYUU Yes 🙂
@alejomakevids
@alejomakevids 3 жыл бұрын
@@QW3RTYUU No this is Patrick.
@mariocamspam72
@mariocamspam72 3 жыл бұрын
@@alejomakevids HAHAHA XDD SO FUNNY meme from 2016
@dewut420
@dewut420 3 жыл бұрын
@@mariocamspam72 imagine typing how you laugh
@almosthelpless9374
@almosthelpless9374 3 жыл бұрын
Not having to touch your mouse to use a text editor is underrated. Vim is great for laptops!
@AlessandroBottoni
@AlessandroBottoni 3 жыл бұрын
You can also use most, if not all, of the existing GUI-based editors and IDEs without touching the mouse: most of them support a large, powerful and configurable set of keyboard shortcuts (that I do not use...).
@ashwin372
@ashwin372 3 жыл бұрын
Its good for desktops too.
@woouinluigh
@woouinluigh 3 жыл бұрын
It was a nightmare on smartphones though... still, not much worse than anything else on a smartphone
@matthewstott3493
@matthewstott3493 3 жыл бұрын
@@woouinluigh Well unless you have a bluetooth keyboard paired with a tablet or smartphone. Which I've used with tmux / vim a great deal. Actually Mosh + iOS Blink works very well with an unstable cellular connection while on a train. Mosh replaces SSH and provides a much more responsive feel on poor connections. mosh.org simple roaming with session state sync with extremely low latency and local echo so you are not waiting on SSH to catch up.
@phillipmartin3910
@phillipmartin3910 3 жыл бұрын
@@peterjansen4826 Graphical text editors and ide's have been feature equal with Vim and Emacs for decades. There's no feature reason to use Vim over Sublime, Atom, Geany or Kwrite.
@caleb7884
@caleb7884 3 жыл бұрын
I like how genuine dt is, when he makes a mistake he doesn´t edit it out, he shows himself learning it along with us
@windows99
@windows99 Жыл бұрын
What mistake?
@samuelitooooo
@samuelitooooo 11 ай бұрын
I appreciate the genuineness, but it does create friction as I absorb and learn
@myview9923
@myview9923 3 жыл бұрын
I think learning a new programming language is easier than using the editor
@scoutbro9034
@scoutbro9034 3 жыл бұрын
False I need to go bathroom, lol
@myview9923
@myview9923 3 жыл бұрын
@@scoutbro9034 of course you can execute a macro and go to bathroom..
@myview9923
@myview9923 3 жыл бұрын
@Myungsoo Ya.. they must make a vim OS. Being an editor is a shame..
@radioactivebob1
@radioactivebob1 3 жыл бұрын
the fact you have to learn and reseach how to use this editor is a big killer for me, just not worth it.
@heroe1486
@heroe1486 3 жыл бұрын
@@radioactivebob1 You're not required to use 100/100 of vim key bindings and commands. You're still be more productive with the basics than nothing. + Taking some time to learn something that will save you time/gives you advantages afterward is an investment, that's what you've probably done when switching from windows/macOs to GNU/Linux or from a DE to a minimal tiling windows manager
@balmar3
@balmar3 3 жыл бұрын
11:22 At that point you can just hit I" and that will do the job. Similarly, to add to the end of each line select in block visual mode, then hit $ and A". No need for all that command mode then normal mode trickery.
@MrLaysoun
@MrLaysoun 3 жыл бұрын
you can also use block visual mode with ctrl+v and then hit shift+i and it will insert everywhere
@satibel
@satibel 3 жыл бұрын
you can also use a regex.
@conceptrat
@conceptrat 3 жыл бұрын
That same method could've been used to delete (x) the ” at the end of the line with a comma.
@zomakaja
@zomakaja 3 жыл бұрын
Most vim videos have the same info. But I actually learned something new in the video
@jacksonsingleton
@jacksonsingleton 3 жыл бұрын
There's so much to it. There's always more to learn!
@dipi71
@dipi71 3 жыл бұрын
Clouldn't agree more. Just discovered diff-mode editing, visual-block editing, macros, built-in functions like strchars() and getline() in custom mappings and the power of "very" magic regular expressions during the recent decade. For example, removing/adding those quote marks would be one thing I'd use regexp's for, rather than macros.
@GooogleGoglee
@GooogleGoglee 3 жыл бұрын
After all it is all you need...
@xSferQx
@xSferQx 3 жыл бұрын
When you have to go through many videos to learn how to edit text
@jacksonsingleton
@jacksonsingleton 3 жыл бұрын
@@xSferQx optimization baaabyyyy
@andrewfeldman6764
@andrewfeldman6764 3 жыл бұрын
Of all the examples that were given, I’d either never use it, or I can do it faster in sublime. I used Vim for 6 months and I still went back to Sublime. I think it just comes down to personal workflow preference
@paolo.iulita
@paolo.iulita 3 жыл бұрын
Copy / Pasting a piece of my comment: "IMHO with the introduction of multi-cursor editors it's time to move on."
@johannesberger8641
@johannesberger8641 3 жыл бұрын
​@@paolo.iulita Uh, vim can do that. So.
@shreym03
@shreym03 3 жыл бұрын
I think a mix of vim and Sublime could actually be a very good workflow. I do that with VSCode and I know there's a vim extension for Sublime. Why don't you give it a try
@tzimmermann
@tzimmermann 3 жыл бұрын
That's what I was going to say. Each time someone gives me an example supposed to show me Vim's superiority, I can come up with a simpler way to do the same thing in Sublime without having to memorize tons of keybindings and switch mode a bunch of times, and often it happens to be faster.
@ricardo_valerio
@ricardo_valerio 3 жыл бұрын
same
@kaosfang6907
@kaosfang6907 3 жыл бұрын
How have I been using Vim keybindings for almost 2 years and i didn't know about :ab that would have been beyond useful many times. Amazing video DT keep up the amazing content.
@Simi3x
@Simi3x 3 жыл бұрын
Feels like learning Regex with extra steps.
@OggerFN
@OggerFN 3 жыл бұрын
yes
@aphleesegurtra2820
@aphleesegurtra2820 3 жыл бұрын
You must mean when NOT using VIM, I hope...
@rogerpenrose1368
@rogerpenrose1368 3 жыл бұрын
I use just vim, but everytime I see someone speaking of advantages of vim, clearly they haven't spend a second loooking up the documentation of other editors. Every code editor has a lot of features like those of vim.
@tanmaydeshpande
@tanmaydeshpande 3 жыл бұрын
I mean not really. I use neovim on a daily basis as part of my school classes. I've run macros more times than I can count and features like that are simply unavailable in other editors. Sure there are extensions to do stuff like that but then the other editors are already so painfully slow in starting up
@rogerpenrose1368
@rogerpenrose1368 3 жыл бұрын
@@tanmaydeshpande Yeah, I mean, "a lot" of features, not all. Like, all (or most of) the stuff showed in this video can easily be done in vscode or sublime. But, for example, the integration between vim and the shell is something unique. Vim is awesome for a lot of reasons, but not because you can jump to a line or delete 3 words with a few keystrokes.
@tanmaydeshpande
@tanmaydeshpande 3 жыл бұрын
@@rogerpenrose1368 eh I think vim is powerful for that as well. Like in normal editors, you can scroll using the mouse or the pgup or pgdn buttons. In vim you don't need to touch anything apart from your home row for navigation. Simply press number+j or k and you jump so many lines at once. And with relative numbering it's even more easy to do stuff like that
@rogerpenrose1368
@rogerpenrose1368 3 жыл бұрын
​ @Tanmay Deshpande Yeah... this is an advantage...
@vaibhavppandey
@vaibhavppandey 3 жыл бұрын
@@tanmaydeshpande bruh you are the same guy on some other channel saying "I don't know What is this fuss about Vim" lol
@Simi3x
@Simi3x 3 жыл бұрын
Honestly the IDE's I'm using are all capable of selecting multiple rows, replacing words and swapping lines. If you're comparing Windows Editor to vim, it's obviously more capable of doing stuff. Haven't yet found a feature convincing me to learn vim.
@wuppi
@wuppi 3 жыл бұрын
I mainly just like vim's keybinds, they're quick and easy to access. Often you have the same editing power in your IDE of choice with vim bindings as in vim itself (some extensions even use vim as a backend).
@nomathic7672
@nomathic7672 3 жыл бұрын
You can define more robust keybind and commands with vim than any other editor. IDEs are only more useful when you're using their features like debugging with realtime memory information graphs. If you're just editing code then there's literally no reason to use an IDE.
@iskamag
@iskamag 2 жыл бұрын
Can your IDE edit multiple configurations from one?
@christophernuzzi2780
@christophernuzzi2780 2 жыл бұрын
@@iskamag Who cares?
@iskamag
@iskamag 2 жыл бұрын
@@christophernuzzi2780 I do, it makes my life so much easier.
@CryptoDefender
@CryptoDefender 3 жыл бұрын
Must be one of the most practical and easy to watch overviews of Vim out there on KZbin! Great content as usual DT. Many thanks.
@neoplumes
@neoplumes 3 жыл бұрын
Vs code can do cutting/pasting lines, moving lines up/down, navigating to the end/beginning of the document, selecting multiple lines at once, and regex search/replace. All without the mouse... I knew VIM had a hardcore following. It's good to know I'm not missing out with these specific examples of why it's so powerful.
@kevinfromthebase1335
@kevinfromthebase1335 3 жыл бұрын
He didn't seem to touch on text objects, which is a very powerful vim feature. The power of vim is also in its ubiquity; its gonna be there on any machine you ssh into and any container you enter into. VScode is excellent but I think the main advantages it has over pure vim is the built in debugger and some of the refactoring tools. You can pimp out vim to do pretty much everything vscode does, but the lack of the debugger is an issue
@heroe1486
@heroe1486 3 жыл бұрын
Sorry man but that's not the case . He's just showing a few percentage of vim capabilities on this video, he would need 10 hours to show what you can do with vim. It's not still one of the most popular text editor along devs ( 25/100 according to SO ) for nothing even in the GUI age. With coc.nvim we don't even need vscode anymore.
@GooogleGoglee
@GooogleGoglee 3 жыл бұрын
The right title should be "Vim can save you seconds of works in a day"
@neeko319
@neeko319 3 жыл бұрын
@Henrique Borges aka other text editors save you much more than a couple hours.
@johannesberger8641
@johannesberger8641 3 жыл бұрын
@@alexisk1615 Only in the first months. Then it pays off immeasurably
@CristiNeagu
@CristiNeagu 3 жыл бұрын
... if you're coming from Notepad.
@CristiNeagu
@CristiNeagu 3 жыл бұрын
@Henrique Borges True. Vim wasn't made for me. It was made for incredibly old and outdated operating systems, with weird and convoluted control schemes, and primitive input methods. As for me, i prefer efficiency and ease of use over stubborn nostalgia against all reason.
@CristiNeagu
@CristiNeagu 3 жыл бұрын
@Henrique Borges As expected, you're still living in 2010. We have VS Codium here in 2021.
@cerocero2817
@cerocero2817 3 жыл бұрын
I will probably end up learning vim anyway, but I find it a bit discoursging how almost everytime someone comes telling how vim is so superior to other programs and it will save you thousands of hours they end up giving some examples that could essily be done in typical programs just as fast, like the example about deleting the double quotes, I could do that in a couple seconds in any editor with multicursor, faster than using a macro. They are just as ignorant about standard editors as we are about Vim.
@bobwright8000
@bobwright8000 3 жыл бұрын
Thanks DT. Vim is a powerful editor; I have used it for years. The better you know it, the more time you can save. Great job on the video.
@AlessandroBottoni
@AlessandroBottoni 3 жыл бұрын
After having developed software for more than twenty years, and after having used all of the existing editor and IDEs (including Eclipse, NetBeans, SublimeText, Visual Studio Code, Code::Blocks, Qt Creator, Visual Studio, Atom, etc.), I still CANNOT understand what people see in VI and VIM (That I know and used). History declared a winner a long time ago and it was GUI-based software: it does not make any sense using your memory to store the keyboard shortcuts of CLI-oriented programs when you can have a menu and a sophisticated GUI at your fingertip. I do not even use line editors for configuring servers from remote, anymore. I just use the various "control panels" supplied by the host.
@notmything6629
@notmything6629 3 жыл бұрын
I agree 100%
@Biggybi
@Biggybi 3 жыл бұрын
A few notes: - `g;` goes back to the last modification, while `` would be the last cursor position - to indent a paragraph, you can use `>ap` (`ap` is the paragraph text object) - to remove the `"` in this context : `vap :s/"//g` (select around paragraph then replace '"' with nothing, `g` to get every match in the line) Good work though, looking forward for more Vim vids !
@jenowin7269
@jenowin7269 3 жыл бұрын
nnoremap :move +1 nnoremap :move -2 alt+up/down to move the current line vertically in a classic way vnoremap :move '>+1gv=gv vnoremap :move '
@atps
@atps 3 жыл бұрын
I'm a relatively new vim user. I've passed the initial shock (that's my first modal editor) and the more I use it, the more I like it. On the positive side I love the combination between the vim + vimv in the case of bulk renaming. On the negative side I have a lot more to learn in order to properly use it with another keyboard layouts, which is not very easy if not configured correctly.
@Lennyp4
@Lennyp4 Жыл бұрын
i’ve been using vim for years on a dvorak layout pretty much stock. by sheer nature of using vim as long as i have my vimrc has ballooned to be probably a couple hundred lines long but i try not to mess with the default bindings too much!
@ManthaarJanyaro
@ManthaarJanyaro 3 жыл бұрын
I see no reason why I should change my text editor...
@mattrobinson513
@mattrobinson513 3 жыл бұрын
Why use vim when you can use feature rich nano.
@alephanull1953
@alephanull1953 3 жыл бұрын
Why use nano when you can use minimal Ed
@tanmaydeshpande
@tanmaydeshpande 3 жыл бұрын
@@alephanull1953 why use ed when you can simply write code in binary on paper
@migue7490
@migue7490 3 жыл бұрын
I feel so comfortable using Vim and I realized that I know only 0.01% of its features. To delete ending " instead of macros I prefer %s/"$//g, and I instead of doing "norm" in block mode I use "I", or "A" directly, I don't know if what I do works in all cases. Great vid!
@umka7536
@umka7536 3 жыл бұрын
:11,+25 norm 0x$x
@phillipmartin3910
@phillipmartin3910 3 жыл бұрын
That's why I don't understand why guys spend all this time learning Vim when they're never going to use most of it's features. It obvious most are just following the heard and doing what's cool. It's like the sudden popularity of tiling widow managers, it's a fad that will fade.
@jacderida
@jacderida 3 жыл бұрын
@@phillipmartin3910 Vim will be 30 years old this year, and vi goes back to the 70s. That's a pretty long fad. I've been using it as my main editor now for 6 years.
@umka7536
@umka7536 3 жыл бұрын
@@phillipmartin3910 Because you want to be efficient and non-distracted. VIM boosts my productivity.
@CristiNeagu
@CristiNeagu 3 жыл бұрын
@@umka7536 Ah yes. I so hate when VS Code makes me press End to move all my cursors to the end of the line. Typing in %s/"$//g is so much faster and makes so much more sense.
@jandrews377
@jandrews377 3 жыл бұрын
Hi Derek, love your work. I am fully sold on 'vim', however, I think its a bit disingenuous suggesting that find-replace can take minutes or hours. Even the most basic text editors provide find/replace. The macros feature is definitely a time-saver though. Good vid.
@Chiny_w_Pigulce
@Chiny_w_Pigulce 3 жыл бұрын
You can easily swap lines in VSCode with alt+arrow key
@maybeanonymous6846
@maybeanonymous6846 2 жыл бұрын
i have that shortcut on my vim config
@radol
@radol 2 жыл бұрын
You can also select multiple lines holding alt and press end to move cursors to end of each line. I don't know how recording macros to do this is supposed to be superior
@hil449
@hil449 2 жыл бұрын
@@radol oh really? How about selecting 2000 lines? Trust me, I've done that in sublime a couple years ago lmao if only I had knew vim
@harshpanchal5878
@harshpanchal5878 2 жыл бұрын
@@maybeanonymous6846 how?? 🤔
@nodge9671
@nodge9671 Жыл бұрын
@@hil449 to select all of them hold alt then press page down.
@luck3949
@luck3949 3 жыл бұрын
Vim can save you hours of work* *After spending tens of hours on configuring and learning vim.
@nomathic7672
@nomathic7672 3 жыл бұрын
Well yeah, that's literally with everything. You can save hours of getting from point A to B by driving instead of walking but that would mean you have to spend more time learning how to drive and making money to pay for the car. It doesn't mean it still isn't fast. Learning vim isn't difficult if you are above 8 years old.
@luck3949
@luck3949 3 жыл бұрын
@@nomathic7672 or you can just use jetbrains IDEs that are intuitive and work out of the box just fine.
@farpsy
@farpsy 3 жыл бұрын
more like hundreds thousands
@nomathic7672
@nomathic7672 3 жыл бұрын
@@luck3949 I never said that wasn't true. I'm saying that anything that increases efficiency can take time but that doesn't make it inefficient. Does that make sense to you?
@nomathic7672
@nomathic7672 3 жыл бұрын
Honestly, developers that can't even understand their own points scare me.
@sabyabhoi8841
@sabyabhoi8841 3 жыл бұрын
Love your content DT! Happy New year!
@Omikronik
@Omikronik 3 жыл бұрын
My favourite vim commands are o and O. I hated having to hold left or right arrow key and press enter to open a new line above or below.
@SoundToxin
@SoundToxin 3 жыл бұрын
Yes, I love how many actions can work from anywhere. Same with dd instead of having to go to the start or end of the line and then doing shift-home or shift-end and backspace.
@IlyesSem
@IlyesSem 3 жыл бұрын
Hi ! A few more tips : Going back to the last cursor place - g; - but you can also browse your location stack with - C^O - (backward) and - C^I - (forward) Indent a whole paragraph (in your case here) : - >ip - (no need to count, and you can stay in normal mode - even less painful !) Adding quotes for each line : select lines, go in command mode and type - norm yss" - (which relies on tpope's vim-surround plugin) (6 less seconds wasted !) For the sudo trick, if you can't remeber it there's chrisbra's SudoEdit plugin which does this great - :SudoWrite - You can edit multiple files (vim file2 file2 file3), record macro like DT did here and apply it to each file ( - w | n - in command mode to write and go to the next file) With a shell you also can record your macro and do this : # for i in file1 file2 file3; do vim $i -c "norm @o" -c "wq"; done # (o is the name of my macro here) Thank's DT for these tips ! I hope mine are helping you too !
@miallo
@miallo 3 жыл бұрын
There is no need to reselect the same block again if you want to perform another command, '< and '> will remember the last selected region. And if you really want to select the same region again, just type gv and for changing the `o`ther end of the selection to fine-tune it, just press o If there was whitespace after the last character and you wanted to move the cursor there instead of the very end, there is also g_
@txemaotero3250
@txemaotero3250 2 жыл бұрын
After so many years using vim I don't know how but I am still learning new stuffs, amazing. I didn't know about abbreviations. Thank you for the content DT! Keep going!!
@timoteostation
@timoteostation 3 жыл бұрын
One of the most useful tricks I like in vim is the ":%" function. I can search and replace portions of text using regular expressions. Example: :%s/apple/orange/g It will replaces all instances of "apple" for "orange" on the entire document. If you are expert in regular expressions, you can do a lot of things with this feature.
@user-lb1ib8rz4h
@user-lb1ib8rz4h Жыл бұрын
fyi, it's the s doing the heavy lifting, not % % is not a substitution function, it is a range specifying the entire file. you can use line numbers too for the range. s means substitute, and g means globally within a line (part of regex syntax) so for example to remove all quotes from lines 10-43: :10,43s/"//g
@timoteostation
@timoteostation Жыл бұрын
@@user-lb1ib8rz4h another trick that I like to use is to remove specific line using a pattern. :%/apple/d It removes any line containing the "apple" pattern. Sadly I'm not so good with regular expressions, but the :% function in vim is very useful.
@Imaltont
@Imaltont 3 жыл бұрын
One of my personal favorites that I use pretty much every day at work is vim's grep integration (or ripgrep in my case). Navigating large codebases is super fast if you just have a few keywords/patterns to feed into grep from vim and let it do it's magic, and then just have all the results in the quick fix list for easy access to the files/locations in the file(s).
@TheAnffer
@TheAnffer 3 жыл бұрын
I've been using vim for maybe 3 months with a couple of plugins and it is awesome! This video added a couple of tools to my toolbox. Good video DT
@timfreedman873
@timfreedman873 2 жыл бұрын
Another great Vim video DT. You make learning Vim easier, thanks mate.
@AFKay-wh6qh
@AFKay-wh6qh 3 жыл бұрын
The way you pronounce "Vim" is amazing
@zeroone171
@zeroone171 3 жыл бұрын
Vyoom
@smuecke
@smuecke 3 жыл бұрын
Viəm
@lupanama1960
@lupanama1960 3 жыл бұрын
the usage of norm and that cgn + colon is really neat
@pikzel
@pikzel 3 жыл бұрын
As a text editor, vim is great. But I save much more time with an IDE like the ones from Jetbrains when it comes to safe refactoring, debugging, code analysis, etc. I never have to leave the IDE to do anything. And you can even use vim key bindings in them.
@mohityadav21
@mohityadav21 2 жыл бұрын
It takes more time/keystrokes and remembering than simple vs-code multi-cursor approach. But it seems more powerful.
@yiyatsen
@yiyatsen 3 жыл бұрын
To move a line, I use alt+arrow key I don’t think VIM is any faster
@tsukiiiiiii
@tsukiiiiiii 3 жыл бұрын
You can just use the arrow key, no problem. Or the traditional "h, j, k, l" key.
@kellingc
@kellingc 3 жыл бұрын
this is teally cool stuff. Thank you for taking the time to demonstrate this.
@sumitrawat3742
@sumitrawat3742 3 жыл бұрын
13:05 you can use gv to use the last selection again
@LeCockroach
@LeCockroach 3 жыл бұрын
I love the idea and power of VIM and vim clones, and I tried them at least 5 times in the past and in the end went back to my previous editor or whatever. It feels like you need a lifetime to learn the basics and then you discover a plugin that possibly improves your workflow and you need to relearn everything again. But it's true that you can (once you master it) do almost anything very fast. Useful video!!
@matheuslemos1288
@matheuslemos1288 3 жыл бұрын
that last command will save me hours of editing /etc config files, thanks dt
@magnusanderson6681
@magnusanderson6681 3 жыл бұрын
What I have done is save it as a random file under /temp, then sudo mv. But yeah thats a much better solution Actually thats what I did in nano, I don't know how to save a file as something in vim. Time to duck it
@poopcatapult2623
@poopcatapult2623 3 жыл бұрын
12:00 easier way to enter insert mode after marking a visual block is to press shift + I. Great tips in here, thanks!
@zeocamo
@zeocamo 3 жыл бұрын
20:04 if you do this a lot you can add it to your init.vim or vimrc just add the following "cmap w!! w !sudo tee > /dev/null %" and if you write :w!! and enter it will run this command, it has been in my config for many many years now and it just save me.
@f23anone82
@f23anone82 3 жыл бұрын
What I love the most about VIM, is that is has unlimited depth. Literally every video I saw on VIM has this minor tips and tricks which you can incorporate into own workflow
@heroe1486
@heroe1486 3 жыл бұрын
Meh " but [nano,atom,sublime] can do EVERYTHING vim does faster and in a more intuitive way "
@vitiok78
@vitiok78 3 жыл бұрын
I think instead of learning these new strange bindings I can just learn regular expressions syntax that is used almost everywhere, so I won't forget it, and with the help of these expressions I can do almost all these tricks in good regular text editor
@lawrencedoliveiro9104
@lawrencedoliveiro9104 3 жыл бұрын
Quoth Jamie Zawinski: “A programmer has a problem, and thinks: “I know-I’ll use a regular expression to solve it”. Now they have _two_ problems.”
@vitiok78
@vitiok78 3 жыл бұрын
@@lawrencedoliveiro9104 Actually, simple regular expressions are very easy. My point is that I as a programmer already know them at the level needed for searching in the text editor. I don't need to learn more vim's spells
@lawrencedoliveiro9104
@lawrencedoliveiro9104 3 жыл бұрын
@@vitiok78 It’s not either/or.
@user-lb1ib8rz4h
@user-lb1ib8rz4h Жыл бұрын
@@vitiok78 you can use regex in vim too lol :10,43s/"//g would've removed all the quotes in those specified lines too
@javierdediegoguzman
@javierdediegoguzman 3 жыл бұрын
What I think about vim is that, the time it saves doesn't matter as much as the "flow" it gives u, allowing u to do as u think, and not fight the program.
@kylestubblefield3404
@kylestubblefield3404 3 жыл бұрын
We received a 6000 page document that was supposed to be a spreadsheet, but it was sent in PDF. Worse that it was "Printed to PDF" which broke the columns up onto 3 different pages. it was a mess. I used a vim macro to solve this. It took me about 45 minutes create the macro and edit this document. learned something new here, I will have to use that !sudo tee % trick
@foxhoundz1x92
@foxhoundz1x92 3 жыл бұрын
VSCode does everything mentioned in this video plus a ton more. That being said, I appreciate people that still use and maintain 30 year old software (40+ if you count vi).
@someonehere4380
@someonehere4380 2 жыл бұрын
"plus a ton more" as if he mentioned everything you can do in vim
@JoePerkins666
@JoePerkins666 Жыл бұрын
When you edit the array contents, half of the time you don't need to enter command mode, just press I and you can add the " at the start for example.
@gasparfreak
@gasparfreak 3 жыл бұрын
Used Vim for a long time, but vscode is just better for my work. Best thing microsoft did.
@estring69
@estring69 Жыл бұрын
You can emulate Vim in vscode. So definite win there....
@sundarbe
@sundarbe 3 жыл бұрын
I’ve been using vim for past 20 years and never used abbreviations command! Vim multiple files opened as buffers can do wonders.
@phyzix_phyzix
@phyzix_phyzix 3 жыл бұрын
That quote remove example in most editors: Drag select lines you want to remove quotes from. Use find/replace in selection quote with empty character. Hit enter. Literally takes 2 seconds. No need for a macro there.
@rochr4
@rochr4 3 жыл бұрын
Love Vim, I use it for years and yet learned something, thanks.
@nielsbom5558
@nielsbom5558 3 жыл бұрын
I've used Vim for a couple year, now using VSCode. Vim is great for navigating, selecting and manipulating text. Deep configuration and extending Vim was hard, even after a couple years. VSCode is very comfortable. Extensions mostly "just work". I really love the command palette.
@heroe1486
@heroe1486 3 жыл бұрын
coc.nvim make things "just works" ( even if I don't like that expression) too, without abandoning all the vim goodness not present on vscode ( even with VscodeVim )
@ddotmars
@ddotmars Жыл бұрын
@@heroe1486 only issue coc.nvim is slow as hell because it uses node :( such a shame
@vikingthedude
@vikingthedude 9 ай бұрын
We got LSP and treesitter boys. The future is bright
@tarpan360
@tarpan360 3 жыл бұрын
The downside is that you have to remember a ton of shortcuts. It's not a problem if you use them regularly, but the rare ones take time to recall - it's easier and faster in other text editors (you just do it with the mouse or right-click for a context menu). Besides, I really need a color-picker and I have never managed to make it work reliably in vim.
@vlatkosurlan545
@vlatkosurlan545 8 ай бұрын
Mostly you don't remember anything. They're just mnemonics mostly: Delete Inside Word: diw (it will delete the word where the cursor is inside) Select To
@jumpyjacko
@jumpyjacko 3 жыл бұрын
i learnt vim just little back. very good editor
@mavitorino
@mavitorino 3 жыл бұрын
Great video! Just loved the w sudo tee command!
@GertBoers
@GertBoers 3 жыл бұрын
Very informative! Thanks!
@SandboxGeneral
@SandboxGeneral 3 жыл бұрын
Sweet. Need more VIM videos, please!
@magnusanderson6681
@magnusanderson6681 3 жыл бұрын
See kzbin.info/www/bejne/jnKViJ2Al9Kgpa8 I need to rewatch that now that I actually use vim
@eeaaay
@eeaaay 3 жыл бұрын
Hey DT! Happy New Year!
@craterface12
@craterface12 3 жыл бұрын
Thank you for the macro example
@_nikolanenadovic
@_nikolanenadovic 3 жыл бұрын
The last one is pure gold!
@davidolson1077
@davidolson1077 3 жыл бұрын
I've been using vim (originally vi) for so long that I have a hard time teaching someone how to use it since it's my fingers that know what to do, not my brain! In any case, there's one thing I've occasionally done in vim that I think may be much more time consuming in a lot of other editors, namely editing on the basis of columns. Suppose, for example in the file that was being edited, you wanted to capitalize the first letter of every one of those array elements. Just block select them and type ~. It's also possible to, say, block select the bottom half of the list and then cut and paste it as a second column next to the first half of the list. That ability to invoke an external tool to process (a portion of) your file via the :! construct is extremely powerful. Sorting is an obvious example but I've also used that technique to convert a binary file into a text representation of the contents, do my hacking, then covert back to binary, i.e., I don't need a separate hex editor.
3 жыл бұрын
You don't need norm to insert at the beginning of selected lines, you can just do it straight in normal mode.
@bellybooma
@bellybooma Жыл бұрын
I still remember before I knew Vim doing archaic things like like highlighting text with the mouse, using the narrow keys to slowly navigate, etc. With Vim it's a completely new experience to text editing. And the best part about it, it's future proof. Vim has been around since the early 90s and Vim along with it's variants are still growing. Most modern text editors including sublime text, VSCode, Atom, etc. all have Vim plugins and/or packages. I'm still fairly new to Vim (been using it moderately for about 1 year) and still learning new tricks and shortcuts every day. Bonus points cause usually when peers see you use vim they are impressed or surprised. Cheers to Vim and all the Vim users out there!
@madyogi6164
@madyogi6164 3 жыл бұрын
Use it for years now. If you remember even some basic stuff, lot of things gets done quicker. I liked it in partiular, for replacing with regular expressions (even if I forget them fast / don't use too often). Also saves time on hand moves from keyb. to mouse and back... ;)
@sergeykolesnik1171
@sergeykolesnik1171 3 ай бұрын
The double quote staff can be easily done with any editor (notepad++, for example) with multiple cursor support. That includes almost every ide.
@KyleLanmon
@KyleLanmon 3 жыл бұрын
cgn is going to save me so much time! I constant have to context switch to rename things, but no more!
@noferblatz
@noferblatz 3 жыл бұрын
Maybe I don't understand what you're doing, but you don't need to type colon before slash to search. In normal mode, you can simply type the slash key. Done this way, it will search from the beginning of the document.
@jaritos675
@jaritos675 3 жыл бұрын
What about Kakoune. I know you did a video on it but I'm still wondering
@AnalyticMinded
@AnalyticMinded 3 жыл бұрын
Good info! I've been using Vim for almost 2 years now, and it's been amazing! Learning new techniques is never-ending, though. I still feel like such a N00b. By the way, I don't know why, but typing a line number + gg takes me to that line number, whether it's up or down. I used to switch between gg and G, but I don't feel I have to anymore.
@somnvm37
@somnvm37 2 жыл бұрын
(vscode) 1. moving lines of text well, you can use alt+up/down for moving lines, ctrl+shift+arrow to select a word shift+alt+up(or down) would make another cursor abve, then you can ctrl+l to select a line. And now you 10 lines with 12 keystrokes. 2. looking for text and then moving: ctrl+f and alt+arrow. If you want to grab the next line also alt+shift+up(down)
@nevoyu
@nevoyu 3 жыл бұрын
Ok DT, next time we have a patron talk I now have a new thing to task about besides the Gnome desktop, Defaults Matter, and Microsoft Windows. Because I really don't like Vim for my creative writing.
@fabrice9848
@fabrice9848 Жыл бұрын
If you use WSL, use ctrl+q instead of ctrl+v to prevent the abbreviation from expanding.
@comraq3637
@comraq3637 2 жыл бұрын
"set -o vi" After learning this, I realized that I want vi bindings in everything that involves typing text.
@fabrice9848
@fabrice9848 Жыл бұрын
I had no idea Vim was that awesome! Thanks a lot. Which resource would your recommend to someone looking for mastering Vim?
@distant6606
@distant6606 2 жыл бұрын
Learning vim is like going to the gym. You start off knowing it wont give you immediate results and its not gonna be a fun thing, but the more u use it the more effective/fast you re gonna be.
@carstenschlegel6975
@carstenschlegel6975 2 ай бұрын
Multiple Runs of a Macro (21@2) has two problems: First, if an error occurs (e.g. fxx - Find x, delete it - and there is no x in the line, e.g. with an empty line). The complete execution is terminated. The second problem: the macro must go to the next line manually (0j or similar). The "norm" command also helps here. The same macro WITHOUT going to the next line. Select all lines (or enter the line number e.g. line 10 to 20 with :10,20) And then :norm @2 (displayed :'
@yogxoth1959
@yogxoth1959 3 жыл бұрын
Haven't watched your channel in awhile but that beard looks great on you!
@DistroTube
@DistroTube 3 жыл бұрын
Hey, thanks!
@samu-1337
@samu-1337 3 жыл бұрын
Vim is the way too go, use it full time now, learning new things all the time. I think vim + terminal is the real strength, no way vscode/webstorm can compete then.
@katech6020
@katech6020 3 жыл бұрын
I am using vim extensions for vscode so I have the best in both worlds, neovim features and vscode features at the same time, and I will probably switch to this when it is ready: onivim.io/
@samu-1337
@samu-1337 3 жыл бұрын
@@katech6020 do you have the tmux experience? Can you executive terminal commands inside vscode? Can you modify git aliases? And how "light" is your vscode?
@enricosevenfoldism
@enricosevenfoldism 3 жыл бұрын
I really wanna use neovim or vim but its to difficult to config and the docs is seems like they assume u to have knowledge in programming language already, and im beginner so i use vscode with neovim keybind extension,
@samu-1337
@samu-1337 3 жыл бұрын
@@enricosevenfoldism I'm 30 and have been in the "insert" mode everyday between 6 year's of age and 30, ofc it feels "easier" initially, but that's only a reflection of practiceed time, you need too switch your mindset to vim. Make it you'r way of life, i.e. add the vimium plugin to your browser..
@katech6020
@katech6020 3 жыл бұрын
@@samu-1337 I use code-oss and it has an integrated terminal for commands, for extension I just have ones that make me work faster or improve things, I installed around 12. for light it is an electron app so you know what to expect. for git, it has a lot of features that I use a lot since I am a front end web dev, and I need to work with other devs many times and push code and manage conflicts...
@craigw4644
@craigw4644 3 жыл бұрын
Thanks DT: Started using vim a year ago. It's all I use now unless I have a bunch of files to modify in different directories, copying and pasting between them. In those cases, like using Atom. Atom has many similar short cuts like vim. I know we can still use vim to edit multiple files; however, have not taken the time to master using vim in that capacity. Vim gets installed on every PC I work on, can't even remember the last time I installed nano.
@LocoFreeman
@LocoFreeman 3 жыл бұрын
That last command got me!
@MrLotrus
@MrLotrus Жыл бұрын
Last two weeks I spent around 30 hours customizing my neovim, zsh and tmux setup. Very efficient))
@rob9709
@rob9709 3 жыл бұрын
Nice tutorial, thanks ;) Note that if you want to indent (unindent) multiple lines from the command line, you can also use this syntax :10,10+(the number of lines you want to indent)>
@RichM1967
@RichM1967 3 жыл бұрын
To remove the double quotes from the end of the line can be done like this :10,42s/"$//g $ means end of line. For the beginning of the line, use ^. To add a quote to the begining of lines 10-42. :10,42s/^/"/g. The Ending is :10,42s/$/"/g
@polgzz
@polgzz Жыл бұрын
11:15 DT, that is actually even easier than you did it. You can directly hit "I" (so, shift + i) when visually selecting various lines, and when you do it, even if it SEEMS that what you type next is only being applied to the first line, actually, when you hit escape it will apply it to EVERY line that you had selected! So, no need for ": norm I". Just "I" after selecting and directly type or delete what you want to change at the beginning of those lines!
@IDOLIKIofficial
@IDOLIKIofficial Жыл бұрын
I really miss some essential plugins in VScode compared to NVIM. For example TailwindCSS intelisense (I know there is one for nvim, but I can't see what those values are - like in vs code pt-3 shows how much padding that will add..)
@mustyhead
@mustyhead 3 жыл бұрын
I love it when I get to learn new things! :) I used vim for my NaNo the last couple years and am using it for most of my writing. I've learned to use folding to organize notes and hide text when I don't want to be distracted. xp in normal mode is my favorite quick fix for transposed characters. Yesterday, not knowing how to navigate multiple edit histories just about bit me in the ass (thank the gods I'd saved just before screwing the pooch). I really need to practice that. One last thing. I don't use vim to save time or be efficient. I use it because it's comfortable and lets me work in peace. The time/efficiency aspect is just icing on the cake.
@atimholt
@atimholt 3 жыл бұрын
I don't find macros to be nearly as useful as :global (“:g”) and :substitute (“:s”). To get rid of all the quotation marks, it's just :'
@kardashevr
@kardashevr 3 жыл бұрын
yea, but what if you don't want to delete ALL quotation marks, but on a specific range of lines?
@atimholt
@atimholt 3 жыл бұрын
@@kardashevr I usually use visual mode for that.
@kardashevr
@kardashevr 3 жыл бұрын
@@atimholt cool!
@ChrisCox-wv7oo
@ChrisCox-wv7oo Жыл бұрын
@@kardashevr:start_n,stop_ns///[modifiers] .,+5s will sub from current line to next 5 -5,+5s will sub from prev 5 to next 5
@Sk8erMorris
@Sk8erMorris 3 жыл бұрын
Thanks for these videos
@DieguitoJohnson
@DieguitoJohnson 3 жыл бұрын
Almost every editor nowadays are super customizable. After using VIM for a time i only found that if you get used to not touching the mouse it can become very usefull and comfortable, but also if i wanted to i can customize VS Code in a way that i dont need the mice too. I think it comes to a personal opinion of what you like most. Anyways knowing a bit of VIM comes very handy when working on multiple remote linux machines and you need to edit.
@heroe1486
@heroe1486 3 жыл бұрын
Remote + basically knowing vim key bindings gives you the ability to use any editor because most have vim extensions. Today Vscode is the hot product, a week ago it was atom, a month ago it was Sublime. You never know what the next "hot" thing would be, it's far more handy to know vim. + If you really dive into vim real capabilities no other text editor can compare tbh. Edit : And it's way faster than any Electron app, Vscode with large projects/files isn't close to neovim speed
@SpencerA99
@SpencerA99 3 жыл бұрын
If I edited a write protected document (aka needed sudo to edit) and didn't realize until I finished editing, is there a way to basically do "sudo :wq"?
@SpencerA99
@SpencerA99 3 жыл бұрын
Figured it out... :w !sudo tee % > /dev/null Find it by running :hE212 in vim
@darkmattergamesofficial
@darkmattergamesofficial 3 жыл бұрын
I can see how the keybinds will save time. I use the old Blender (2.79) still because I memorized all of the important keysbinds, I am lighting fast at it. I suppose I could upgrade and reconfigure the newer versions but I use it for gamedev. A model is a model at the end of the day, doesn't matter how fancy the program is. What is important is your workflow. Same goes for code!
@OscarForero
@OscarForero 3 жыл бұрын
I notice some art in your terminals, Bomberman, pacman, etc. What program is that?
@igorordecha
@igorordecha 3 жыл бұрын
10:26 you can do that easily in vscode using multicursor. Just go to the beginning of line 11 and then shift+Alt+LMB on the beginning of line 42. Now press Del to remove all opening quotes. To remove closing quotes just press End Backspace. End key just moves every cursor to its end of line. I started learning vim today to maybeeee replace vscode in the future but this feature is so good and I use it so often I might not switch to vim as my main editor ever.
@Dizzle0318
@Dizzle0318 3 жыл бұрын
Whatever works for you the best mate. That was not the fastest way to make that edit. Just a simple example. The vim way of doing that is different than the vs code way but I prefer the vim way and it's very fast. Also I can edit my macro with a few key strokes and reuse it for something else without having to do the other selections again. And if your really in love with that there is a vim plugin for it. But again it's personal preference and the vim way is still faster. That being said. Vscode users who knows there keybindings can also get it done. Less the tool and more the person. Whatever works 🎩👍 code on!
@pabloraindogarcia8107
@pabloraindogarcia8107 Жыл бұрын
There is also multicursor for vim
@yujinyuz
@yujinyuz 3 жыл бұрын
I didn't know about the gn motion. Thanks
@Sofoslav
@Sofoslav 3 жыл бұрын
From my experience Vim is just another editor. It has some powerful editing mechanisms, but most of them (or maybe all of them) are present in other editors which are much easier to use.
@dtkedtyjrtyj
@dtkedtyjrtyj 3 жыл бұрын
Had I begun with Linux five to ten years earlier I suspect I'd have been a hardcore vimmer. But today I don't have the time, interest or reason to learn a new text editor. I got some advice years ago: "Choose one text editor and learn it really, really well." _That_ is what will save hours of work. Vim is _one_ editor you can learn well, as is the JetBrains suite or probably emacs.
A First Look At SpaceVim
25:52
DistroTube
Рет қаралды 198 М.
What Are The Benefits Of Emacs Over Vim?
29:44
DistroTube
Рет қаралды 168 М.
Whyyyy? 😭 #shorts by Leisi Crazy
00:16
Leisi Crazy
Рет қаралды 18 МЛН
1 класс vs 11 класс  (игрушка)
00:30
БЕРТ
Рет қаралды 3,3 МЛН
$10,000 Every Day You Survive In The Wilderness
26:44
MrBeast
Рет қаралды 130 МЛН
Each found a feeling.#Short #Officer Rabbit #angel
00:17
兔子警官
Рет қаралды 6 МЛН
Neovim Is a Waste Of Time, And I LOVE It | Prime Reacts
17:00
ThePrimeTime
Рет қаралды 84 М.
Let Vim Do the Typing
32:07
thoughtbot
Рет қаралды 210 М.
Ubuntu, Then Arch. It's The Road So Many Of Us Travel.
9:34
DistroTube
Рет қаралды 178 М.
Is It "WRONG" To Learn Emacs With The Evil Bindings
20:51
DistroTube
Рет қаралды 14 М.
Vim Tips You Probably Never Heard of
12:11
Luke Smith
Рет қаралды 112 М.
Vim Tips And Tricks Some Of My Favorite Vim Commands
17:05
DistroTube
Рет қаралды 59 М.
Don't use VSCode
35:31
PyCon South Africa
Рет қаралды 209 М.
i tried Vim...
10:06
Alex Ziskind
Рет қаралды 41 М.
The 12 Linux Apps Everyone Should Know About
21:20
DistroTube
Рет қаралды 446 М.
10 Advanced Vim Features (You Probably Didn't Know)
21:47
Sebastian Daschner
Рет қаралды 66 М.
Bardak ile Projektör Nasıl Yapılır?
0:19
Safak Novruz
Рет қаралды 5 МЛН
Mem VPN - в Apple Store
0:30
AndroHack
Рет қаралды 85 М.
i like you subscriber ♥️♥️ #trending #iphone #apple #iphonefold
0:14
Девушка и AirPods Max 😳
0:59
ОТЛИЧНИКИ
Рет қаралды 15 М.
iPhone 15 Unboxing Paper diy
0:57
Cute Fay
Рет қаралды 3,7 МЛН