Vim Tips And Tricks Some Of My Favorite Vim Commands

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

I often am asked about why I love Vim so much? In this video, I will discuss some of my favorite Vim commands. These are commands that I find very useful in my workflow, and they are a big reason why I fell in love with Vim.
WANT TO SUPPORT THE CHANNEL?
💰 Patreon: / distrotube
💳 Paypal: kzread.info?even...
🛍️ Amazon: amzn.to/2RotFFi
👕 Teespring: teespring.com/stores/distrotube
DONATE CRYPTO:
💰 Bitcoin: 1Mp6ebz5bNcjNFW7XWHVht36SkiLoxPKoX
🐶 Dogecoin: D5fpRD1JRoBFPDXSBocRTp8W9uKzfwLFAu
📕 LBC: bMfA2c3zmcLxPCpyPcrykLvMhZ7A5mQuhJ
DT ON THE WEB:
🕸️ Website: distrotube.com/
📁 GitLab: gitlab.com/dwt1
🗨️ Mastodon: fosstodon.org/@distrotube
👫 Reddit: / distrotube
📽️ LBRY/Odysee: odysee.com/@DistroTube:2
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/
🎵 Tenacity: github.com/tenacityteam/tenacity
💻 VirtualBox: www.virtualbox.org/
🗒️ Doom Emacs: github.com/hlissner/doom-emacs
Your support is very much appreciated. Thanks, guys!

Пікірлер: 146

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

    vab - selects content within parenthesis () along with it vib - selects only the content within parenthesis vaB - for {} vib - for {} % will help to jump between matching brackets, tags for that matter anything D - deletes from cursor position to the end of the line Y - copys till the end of the line xp - really helpful to swaps letter like , bnigo --> bingo gj - normally vim skips the line if its wrapped. gj helps to go down for that gv - selects the previously selected part in visual mode. gf - jumps to the file when on the file path. For Web developers cit will jump into the tag. vit will juno into the tag in visual mode

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

    “I love vim!” Sets EDITOR to eMacs 😂

  • @user-bl8yh5qu1u
    @user-bl8yh5qu1u Жыл бұрын

    Long time vim user here, here are some commands I can't live without that weren't mentioned: 1. Use A key to goto the end of line and I key to go to the start of the line. 2. The f key and t key to navigate in normal mode and to manipulate text in inset mode(paired with the c and d key). 3. Use "ciw" instead of "diw" to delete and go to insert mode. 4. Bind "jk" and "kj" to so you can save your pinky. 5. The C key, D key and "cc". After 20 years of using vim, my advice is to try to stay in normal mode as much as possible, and you'll find yourself blazing fast.

  • @VortexFlickens

    @VortexFlickens

    Ай бұрын

    New vim user here! I use neo vim with auto completion especially for C. My biggest frustration is that I make a lot of errors in insert mode. And I always feel and tend to using the the Arrow Keys to fixing these errors which could be typos. Secondly neo vim auto completes parenthesis and and makes my cursor inside it! How do I get outside those parenthesis or any blocks without using arrow keys without escape (I tried ctrl+o but that's also bit hard). Any tips on how u proceed in these situations? What do u use for auto completion (tab/enter or ctrl+y)?

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

    Indenting python scripts with = is difficult because the indentations define the ends of blocks. In bash you have keywords to define both ends of a block, and in C-family syntax it's curly braces. So the indentation itself carries non-superfluous meaning in Python, while in many other languages it can be unambiguously determined by the code in the immediate surrounding. Using c (for "change") instead of d (for "delete") puts you right into insert mode after the deletion, no matter what kind of deletion you do. And when deleting a word, note that dw and cw only delete from the cursor and out. daw and caw take the entire word. Finally, da" includes the quotation marks, as opposed to di".

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

    Hi derek! Linux user from spain here, sorry if my english is a little basic. I started learning vim (and awesome wm) with your videos (i've thought on learning it many times before and ended up not bothering) and i am loving how versatile it is, i never understood why it was so 'famous' until now. Thanks for sharing your knowledge on this, i am enjoying like a child with your content. And also thanks for sharing the keystrokes on this video, it was so helpful

  • @im_sreyas
    @im_sreyas11 ай бұрын

    in vim there is actually a lot of things you can do diw - delete inside word (delete a word) daw - delete around word(deletes a word including the whitespace) you can also use 'W' it will also do the same but it will consider a word as a collection of characters surrounded by whitespace di{ - delete the content inside {} di( - delete the content inside () da{ - delete inside {} including the {} like this there are more (di", di'..etc) instead of i (inside) or a (around) you can also use s ( surrounding ) it will delete the surrounding characters you are mentioning most of these is useful for programmers instead of d you can use c ( c stands for change ) it will go to insert mode after the operation is done, but d will stay in normal mode use y instead of d and c, then you are doing yanking (copy) all the other are same also you can use v (it is for visual mode - for selecting text) for line search you can use f and F, it will find a purticular character in a line and then you can use ; and , to move forward and backword through that search character if there is more, f is for searching after and F is for searching behind also there is t and T - f stands for find, and t stands for till it will also find but wont go to that character, instead a character behind the actuat character you are mentioning, it will make sense when you do operations like delete, for example you can do dta ( it will delete the characters from where you are till the character 'a' or delete till character 'a') if you use f then the character a will also be deleted. instead of line you can search in entire document using /searchword and ?searchword (/ is for searching forward and ? is for backword) then you can use n to move throught that search forward and N for backword next time if you want to search the same keyword or searchword just press / and enter for the basic movement you can use j (down), k (up), l (right), h (left), all the keys are available in home row then moving faster using w - word -> word -> word e - end of each word b - move word backword or beginning you can also use numbers, it can be considers as a multiplication, if you do 2j it will jumb two words down (nj , where n is a number) this is not only possible with j k l h , but also with almost every command i have told earlier for example i need to delete two word then i can do d2w..etc there is also combination of commands like dd, yy, cc...etc dd will delete a line yy will yank(copy) a line cc will delete a line then go to insert mode ( while d stay in normal mode) this can also be combined with number like 2dd ( delete two line or d2d...etc) for doing number combined operations it is better to do set the numbering to relative rather than normal numbering, don't get what i said, right? just look at the video, he is using relative numbering rather that continueous, for that just do :set relativenumber ( we are now using ex commands, ex commands starts with a : ) you can use :edit or :e for creating or editing file eg. :edit newFile.js will create a file if not exist in the current path or will go to edit the purticular file if exist you can do :w for writing the file :q for quiting the file or just :wq for write and quit also you can do global replacement in the document by using :%s/textThatShouldBeReplaced/newText now how can we move from normal to insert mode, most of the people will do ( i ) but there are more i - insert mode ( it will put the cursor before the character you are in) a - around ( it will put the cursor after the character you are in) I (capital i ) for insertig at the start of line A - insert at the end of line these are used to go from normal mode to insert mode, where you can type like you do in a normal text editor... use % for going to end of line and ^ for going to start of line (where first character starts) 0 for going to actual starting position or 0th column esc, control + c, control + [ --- can be used to go to normal mode from insert mode there is a lot like this... some tips from me : you can remap the key binding as you want, but if you are a programmer and you are using different text editrors then it is not recommended.... the reason is, i am using vs code as my main text editor for all my works, i often use ide's.... so when i am using other editors or using the computer of someone else, it is really hard because in first i have remapped my keys in different way because some of them are not acceptable for me, like the esc key, are you kidding me, i can't even reach the esc key, so i remapped it into jj, so i just need to type jj to go to normal mode, now it is pretty much easy, but the problem will really happen when changing editor or computer because the remapping json file is in my computer or in the vs code and it is a bit time comsuming to set up or just add all those keybinding to other editors or ide's and it may be easy for vs code configuring but not for other ide's, it is sure that vim extension is available at almost everywhere, but the remapping is done in different ways in different application, this problem happended to me when i have used the android studio, vim is available there in the name of ideavim, but i dont know how to configure or remap the keys or else you need understand it in the way of vim, because i guess vim offerese key remapping commands so you just need to use some ex commands to do that, but on that time learning any of this is time comsuming, also when i use others computer i use jj all the time to go to normal mode, and then it will print to screen because vim is not installed on there computer and even if it is installed, i need to remap it, if the remapping is not needed, then i could have been installed vim and used on there computer. do you know how harder it is to use the arrow keys to move around if you are a vim user, so all of the things above mentioned can be avoided by simply using default configuration. and i am now using default configuration. using touch typing + vim + some practice you can become god in handling file and text. nobody will even get understand what you are doing, they will be amazed of yours speed. im on the way to become that god, just need to have some practive because i have changed on the default configuration in the last week, also vim is really good for touch typers.... because they don't like to leave from there home row like me....☺

  • @Yupppi

    @Yupppi

    6 ай бұрын

    From vim tips and tricks video to the full vimtutor paraphrasing starting from the first chapter.

  • @daveqr

    @daveqr

    3 ай бұрын

    Insanely useful comment.

  • @im_sreyas

    @im_sreyas

    3 ай бұрын

    @@daveqr Thanks ....❤️

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

    One thing I like a lot is pressing f and then a character to find the next instance of the character in that line, and F to find the previous one. This also works with delete: df( will delete everything from your cursor to the first opening parenthesis it finds (including it). And t can do the same, but stopping before reaching the character: dt( will delete from the cursor to the character before the next parenthesis and dT( will delete from the cursor to the character after the previous parenthesis. Edit: Forgot to mention, you can use I (capital i) to enter insert mode at the beginning of the line (technically, before the first non-blank character) and A to enter insert mode at the end of the line.

  • @fincali197

    @fincali197

    Жыл бұрын

    and also, at the very beginning, you could use alt+j instead of ddp

  • @IreizD

    @IreizD

    9 ай бұрын

    @@fincali197 Is that really standard vim behavior? I use a plugin for that.

  • @fincali197

    @fincali197

    9 ай бұрын

    @@IreizD yeah sorry, I was using LazyVim at the time. I think it's possible without a plugin though.

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

    Gotta spread that Vim love! I'm shocked by how many people have at least heard of vim because of the "how to exit vim" meme even if they don't understand why it's funny.

  • @terry1311
    @terry13113 ай бұрын

    Great tips! Here's another useful one: colon x enter - save and exit, replaces colon wq enter. One keypress saved 🙂

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

    Life changing commands that blew my mind dap to delete a paragraph O to open insert mode on the line above

  • @jpp62200

    @jpp62200

    9 ай бұрын

    And o for below

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

    A handy delete command that DT missed or forgot. Say you want to delete lines 6 through 14 in a document. In normal mode, type :6, 14d and enter. The lines will be deleted "in place" without having to use dd on each line.

  • @MasterHigure

    @MasterHigure

    Жыл бұрын

    Or put the cursor on line 6 and press either 9dd (delete the current line 9 times successively) or d8j (move the cursor 8 lines down and delete every line you come across, including starting and ending line). This is a lot easier with relative line numbers.

  • @ringo8410

    @ringo8410

    Жыл бұрын

    @@MasterHigure Cool, I didn't know that trick. Vim is more of a journey than a destination.

  • @gungun974

    @gungun974

    Жыл бұрын

    Personally to delete a bunch of line, I go to visual line mode (Shift V) then a select my lines with up or down (j ou k) and I just press delete (d).

  • @LDavis

    @LDavis

    Жыл бұрын

    ​@@ringo8410 that is the truth, my friend, vim IS a journey

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

    I've used Vim every day, for the last 20 years, I'm still learning new tricks.. it's the cats meow.. Thanks for this, I've learned a few new ones.

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

    2:16 to swap lines you can use M-, what's interesting is how you can swap parts of text in visual mode with just selecting text

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

    f and F (t and T) to find characters in line. Then repeat with ; or ,. Can also combine with visual/delete/replace commands. g; and g, to move among the recent changes. ctrl+v for visual block. ctrl+a and ctrl+x for advancing and decreasing a number (including dates with the speeddating plugin!) . to repeat the last action. Macros. An additional level of zen power. Programmed hot keys with space being the leader. Can add signatures, insert timestamps, open file read-only in new tab, call a function, a compiler or a script on the file (LaTeX it, calculate math expressions from within Vim, search for certain patterns).

  • @fejiberglibstein

    @fejiberglibstein

    3 ай бұрын

    i did not know about g; and g,, thats so cool

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

    Always loved your content, very useful. Thank you :)

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

    Ctrl + c serves the exact same function as the ESC key but you don't have to move your hands to execute. Similarly, Ctrl + i performs an indention. Really handy when the tab key is just bouncing you around or if you want to keep your hands on the main keys

  • @Yoolayn

    @Yoolayn

    Жыл бұрын

    not exactly, if you have something bound to work on switching to normal mode, or just escaping, it will not trigger when pressing ctrl + c. ctrl + [ on the other hand works exactly the same as ESC key

  • @sub-harmonik

    @sub-harmonik

    Жыл бұрын

    lunarvim maps 'jk' to go to normal mode and in english that makes some sense imo. that way you don't have to move to the escape key either

  • @rafalg87

    @rafalg87

    Жыл бұрын

    Every OS allows changing CapsLock to work like Esc now, so that's the best option IMO.

  • @gnuemacs1166

    @gnuemacs1166

    Жыл бұрын

    Ctrl [ is sec not ctrl c as someone else has said

  • @Yoolayn

    @Yoolayn

    Жыл бұрын

    @@gnuemacs1166 Holy molly is that the GNU/Emacs the best operating system?

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

    I learned a lot of new things. Not all useful, because my fingers are encoded with alternatives that I know and like, but many are new to me. Nice work! When MS Word appeared, few people around me speculated that it will never be as useful as vim already is. Different times, different needs.

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

    Thing that really helped me is you can pipe output into vim which is nice for some syntax highlight echo "whatever" | vim -

  • @jpp62200

    @jpp62200

    9 ай бұрын

    You can execute a command and paste it inside vim also :r! Example :r!ls -l

  • @matk2283
    @matk22836 ай бұрын

    Excellent tips and short cuts on vim. appreciate posting this, Mathew from Colorado

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

    As a new vim user this could'nt not come at a better time 😅 slowly getting into it , there's so much keybinds 😆

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

    Commenting out every line of current file, in normal mode: ggGi# and to reverse it, ggGx (where means Ctrl+v).

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

    To highlight and insert hash symbols to the beginning of consecutive lines (or the hash can be any word/letter) Ctrl + v , j , j, j, j, I, #, Esc Likewise to delete Ctrl + v , j, j, j, j, x

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

    Always learning something new with DT.

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

    I've been using vim since around 2000, still learning things now and then. Didn't know Ctrl+w in insert mode for instance. Thanks for that! :) I'll give back this: In insert mode, start writing a few characters of a word that exists within the file (or another file opened in this session), hit Ctrl+n and it will autocomplete it.

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

    I have never even thought to compare vim with simple text editors. I do often compare it with IDEs like vscode or eclipse. And usually wins for me

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

    Thanks for the video! It's really useful.

  • @AliensInc.
    @AliensInc. Жыл бұрын

    Love this, more of this would be nice

  • @MakingStuffWithEvan
    @MakingStuffWithEvan9 ай бұрын

    Control O in insert mode is a game changer. Thanks!

  • @programmingloop7
    @programmingloop7Ай бұрын

    I'm learning Vim and I find it useful and fun, like the copy or delete inside quotes, but some of these commands are also simple in vscode. Uncomment line (can be anywhere in the line not just in the comment character): *cmd+?* Move line down or up once or many times: *Option + up or down arrow* Delete whole file (Similar in almost all OS): *cmd+a then backspace* Delete previous word: *option + backspace* Delete everything before cursor: *cmd+backspace* The indentation vscode can do automatically on save and also code formatting, deleting white space etc This is not a knock on vim as I already stated I like vim. The only command I saw that to my knowledge is not as simple in vscode is the editing inside of quotes or brackets etc. That's pretty useful and I'm adding that to my workflow

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

    One feature I use regularly is ":s" this runs search and replace in the file like the sed command. You need to specify a range to use it, but there are a couple shortcuts built into command mode that make it easy: If you select lines with visual mode and then start command mode with :, vim automatically adds "" meaning run the command on the selected lines. You can manually select the lines with :[START],[STOP] so for example ":3,5" will run the command on lines 3 through 5. Entering a percent sign (%) in command mode runs the command on the whole document. Back to the s command, I use it to replace multiple instances of a variable or keyword. For instance, I named a variable "big_name" and I want to make it "common_name" in the whole file that's easily done with: :%s/big_name/common_name/g Just like the command line sed application, the "s" command understands regex queries: :%s/^#\s*// Will remove all "hash" markings at the beginning of lines, so it will uncomment any line in the file that starts with "#" and any number (including 0) of white space characters after it.

  • @anon_y_mousse

    @anon_y_mousse

    Жыл бұрын

    And if you add c to the end of the line with :%s it will ask about each replacement so you can reject it selectively.

  • @albert3407

    @albert3407

    10 ай бұрын

    can you do a video where you explain that please

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

    To close the help buffer, actually you can close it like any other buffer, so :q (to me easier and faster than Ctrl+W c)

  • @patrickprucha5522
    @patrickprucha55227 ай бұрын

    Excellent video. Thanks very much

  • @mariorpn
    @mariorpn5 ай бұрын

    Amazing tips!

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

    in escape mode , gq will split a long line into multiple lines

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

    Now I've known all these commands for a couple of years I miss the good time when I would watch these videos and be mind blown by vim...

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

    Hey DT, thanks for this video. Even though it's not mindblowing, I realized over the years that very few people know that ":x" (think 'exit') does the same as ":wq" Part of the vim-way is using the shortest command and in this case, you reduce the number of keystrokes by a whooping 33%! Been following you for years, I love your content! Greetings from Paris, France

  • @BitJam

    @BitJam

    Жыл бұрын

    I use "ZZ" for this which is very convenient on a US keyboard because "z" is next to the shift key. It's less convenient on a French keyboard.

  • @jochen7919

    @jochen7919

    Жыл бұрын

    I always use ZZ even though it requires both hands on my keyboard layout.

  • @jeromegay9865

    @jeromegay9865

    Жыл бұрын

    @@BitJam Thanks, good tip! And works for me too, I've been using US keyboards for years

  • @jpp62200

    @jpp62200

    9 ай бұрын

    ZZ has the advantage of not modifying file date if no modifications was done.

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

    My two favorite commands are ZZ instead of :wq and binding jj to exit insert mode

  • @fred-2.7182
    @fred-2.7182 Жыл бұрын

    7:09 Wow, that was new to me. That's a nice shortcut.

  • @Yupppi
    @Yupppi6 ай бұрын

    yip/yap was god damn awesome to learn. I learned ci{ instead of di{, didn't consider they're basically the same in this context. But also ce and cE were quite nice. And using f or F in combination of other motions. And finding out that if you start the motion with alt, it'll put you back to the normal mode without escaping. And the number modifiers are obviously must, very basic but convenient. A must be my favourite though, nothing like adding that ; right where it belongs. Or = to indent the line automatically in the correct place! Ctrl+u or d are also really nice to quickly browse the document. Nvim has just made life so nice, especially when programming on a laptop where I definitely don't want to use the mouse. Shift+v as well, getting the whole line is so practical. Like Vy for repeating code lines that need only minor variation. And jumping paragraphs to empty line with { and }. Almost forgot but finding the start of the codeblock and then jumping back and forth with % is also so handy many times. Not only to find the other end but for editing too. You know it's a great video if all the motions that are your favourites are mentioned. When I started learning, I wrote all the motions I wanted to use on a note file, ended up roughly 100 lines long. Then tried to start using them even if it would take me longer to think about it and how the combination goes than to manually walk there. It's initially slowing you down but feels rather satisfactory to remember the neat motions and start getting faster on them, and have them come from the backbone more often. Honestly I found everything about vim mind blowing after I learned how to quit vim. I actually was for real the guy who got stuck in vim back when I was on the introduction class inside unix and accidentally opened a file in vim. I'm so glad I got turned and decided to try and dive in, because even after a week it felt impossible to go back. Vscode felt so slow and mouse heavy.

  • @MsDuketown
    @MsDuketown8 ай бұрын

    I always confuse they VIM commands with the BSD commands. Thanks for the visuals along the cheatsheet. I like reading and listening at the same time.

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

    Very nice! Vim is my favorite editor! Question: When you are typing the commands, at the bottom it appears some vim tips/options in red color, how do you do that? Is It some config you did in the vimrc? I am not talking about the screenkey app, but the red text that shows some vim options when typing the commands. Again,very good video!

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

    Hey DT! Was wondering why you use fish over zsh especially when you talk about window managers and write all these config files to make a custom experience. I feel like you should try zsh.

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

    Learning vim is the best thing that happened to me as a linux user !

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

    I've been using vim somewhat regularly for several months now and I didn't know most of this stuff

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

    this is awesome! what tool do you use to show the key presses?

  • @DistroTube

    @DistroTube

    Жыл бұрын

    'screenkey' It's in everybody's repos.

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

    You should make a video about Lunarvim, it's amazing

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

    Heyyyyyyyyyyy DT😂😂😂😂😅 Is there a program in arch linux for screen annotation and magnifying at the same time? Unfortunately gromit-mpx does screen annotation only but not zooming!!!! ???

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

    I use ci to change stuff in between quotation marks & parenthesis, cw to directly change a word under cursor.

  • @jpp62200

    @jpp62200

    9 ай бұрын

    You need to do ciw if you want to change the whole word if cursor is not at begining

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

    VIM IS THE GREATEST EDITOR OF ALL TIME

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

    I strongly suggest adding "map ; :" in vimrc, and of course not the other way around :)

  • @Good-and-Geeky
    @Good-and-Geeky8 ай бұрын

    I like using gcc to toggle a line comment or number gcc for multiple lines.

  • @kebman
    @kebman4 ай бұрын

    Sublime Text can most likely do most of this. It's really good, but kinda costly if you want to avoid the nag.

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

    thank you

  • @Pherecydes
    @Pherecydes10 ай бұрын

    Your ex() function is a brilliant idea, thanks :)

  • @user-fc4qr6xz7o
    @user-fc4qr6xz7o6 ай бұрын

    Most of vim's functions appear to be possible in the IDE using keys such as home, end, ctrl, alt, and shift. Are there any use cases that would never be possible in an IDE, but would be very useful?

  • @felipepiaceski5921

    @felipepiaceski5921

    5 ай бұрын

    Yeah, like praising the possibility of deleting everything in the document as if this is unique to vim when you can do just ctrl+a+del in every other editor... kind of tells me that vim of overrated. Don't get me wrong, it may be the best editor ever... but if this is the kind of things people say that makes if better, then I might not believe them anymore... I don't know, swapping lines with alt+up/down, commenting lines with ctrl+;, deleting a line from a specific character is usually just shift+end+del... pretty easy to me, specially because shift, ctrl and alt are right at your little finger's reach, so you don't even have to go out of your way to reach them.

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

    Hey DTPlease do vidéos for emacs using vim utilities also

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

    Maybe a review on AstroVim?

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

    *.* repeats the last commands. you can use it like a macro. so for example. go to end of line shift A and add ; Now to repeat this action in the next line just do *j.*

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

    Like most things in life; I picked my editor of choice based on the memes online. Gentoo btw

  • @rawdawg7995
    @rawdawg7995Ай бұрын

    Great video my friend! Thank you much!

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

    Despite all the features and clever scripts, I stick with the default key bindings and settings in order to keep system-hopping less frustrating.

  • @mystic_monk55
    @mystic_monk558 ай бұрын

    Which program is this which is used for keycasting?

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

    @3:57 notepad++ has that feature without forcing you to learn new typing mode and programming language to run a text application.

  • @sudheerkmuhammed6363

    @sudheerkmuhammed6363

    9 ай бұрын

    Geeks don't do different things they do things differently..

  • @jpp62200
    @jpp622009 ай бұрын

    10:26 when pasting from the Linux buffer using the mouse , I do a '':set noai '' so during the paste vim does not auto indent and doesn't add the tabs

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

    Hey DT. Great video (as always). Was wondering if these key bindings also work in neovim (nvim). Or was this just vanilla VIM? Thanks.

  • @Tile32684

    @Tile32684

    Жыл бұрын

    NeoVim is just vim with some extra features. Everything you'd do in Vim should be the same in NeoVim. Keybindings certainly are the same.

  • @_lessthanzero_

    @_lessthanzero_

    Жыл бұрын

    Yes everything will work. Neovim was created with main intention to support vast amount of plugins.

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

    Bro please make a video on how to install Hyprland on Arch using archinstall the minimal way.

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

    q to register key pressed for example qa to register keys then @a to redo all keys pressed!

  • @jpp62200

    @jpp62200

    9 ай бұрын

    And :normal @a To run it on all line of a visual block

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

    Insert mode: C-e and C-y copy text from lines above and below

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

    Does anyone know to fix the audio issue that im having while running Zorin. That is the only issue im having

  • @marshallhank891
    @marshallhank89110 ай бұрын

    I always feel like Walter white is teaching me vim😂

  • @dhavald4359
    @dhavald43599 ай бұрын

    also check "g;", "g,", "[]", "[[" etc movement keys

  • @CLUBFOOTBALL18
    @CLUBFOOTBALL189 ай бұрын

    Hi can you pls do different ways to delete a line..

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

    S for indent, Ctr-o mode, all others I know🎉

  • @LucasD.C.
    @LucasD.C. Жыл бұрын

    yoooo :D

  • @Codigger-br2rt
    @Codigger-br2rt3 ай бұрын

    How does Vim clear all tags?

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

    ZQ quit without saving (normal mode)

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

    Back to vim from Doom Emacs? 😆

  • @SisypheanRoller

    @SisypheanRoller

    Жыл бұрын

    You can use both.

  • @DistroTube

    @DistroTube

    Жыл бұрын

    Actually, everything i showed in this video works in Doom Emacs. But I didn't want to demonstrate "Vim stuff" inside "Emacs". That would have been against the rules. ;)

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

    ZZ = exit vim

  • @Bogdanko93
    @Bogdanko934 ай бұрын

    How do you display a cheat sheet after you hit "di"?

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

    I put the 666 like just now

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

    Hey dt rebuild qtile . It crashed

  • @DistroTube

    @DistroTube

    Жыл бұрын

    Actually, it is broken for me as well. I suspect I need to rebuild qtile-extras in the DTOS repo due to the recent Python update on Arch. I'll rebuild that and push it out.

  • @DistroTube

    @DistroTube

    Жыл бұрын

    Fixed. Read this issue on GitLab for the commands. gitlab.com/dtos/dtos/-/issues/180

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

    My 2 cents: I use :x instead of :wq to write and quit vim

  • @jpp62200

    @jpp62200

    9 ай бұрын

    ZZ is good too, if file not modified it will not rewrite it (and change modifications date of the file)

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

    Watching this on a smartphone totally rots. I cannot see anything.

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

    I like to use tabs and line numbers in vim, so in my ~/.vimrc I've got: set number relativenumber set showtabline=2 " tabe for opening a file in a tab, just hit enter to make it unnamed nmap \t :tabe nmap :tabn nmap :tabp

  • @damian_madmansnest
    @damian_madmansnest7 ай бұрын

    2:30 cursor movement was so unvimlike 🙃

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

    ...”Vim is great, you can just go to any character and push x and it deletes that character... wow...”And on the other stupid editors you have to to to the character and push "delete" button, how ridiculous that is... (Highly sarcastic)

  • @fpgaguy
    @fpgaguy2 күн бұрын

    I can't take you seriously if you are editing your bashrc and your editor is set to emacsclient

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

    I switched from Emacs to Vim about 15 or more years ago. I love the search commands: * search for word under cursor # reverse search for word under cursor g, go to last change n go to next match / ? change search direction I love the powerful multi-line regular expressions. I like being able to format and indent paragraphs. The ability to record key sequences and then play them back multiple times saves me tons of work. I like having a bunch of buffers I can save boilerplate text in. I'm sure other editors can do all these things but Vim makes it so easy (for me). Edit: I love rectangular copy and paste! Bonus tip: command line calculator: x2 () {awk "BEGIN{ printf \"%4.2f \", $(echo "$@" | tr '[]x' '()*' ); }" ;} You can use "x" for multiplication (to avoid globbing) and use square brackets for parens.

  • @anon_y_mousse

    @anon_y_mousse

    Жыл бұрын

    I'm curious why you'd calculate that way as opposed to just echo $(( ... )) or echo '...' | bc -ql ?

  • @BitJam

    @BitJam

    Жыл бұрын

    @@anon_y_mousse "$(( ... ))" is very primitive, for example no fractions. I often work in stripped down busybox environments where bc is not available but awk is. The tr command lets me avoid using glob characters in my input which is very convenient. The fixed precision is also convenient for me. O/C I have an x4 version. Most of the characters in my function are for these convenience features that don't exist in the alternatives you suggest. Use whatever you are most comfortable with. Amazon built their first web sites with C. It's a terrible language for web work but the devs were comfortable with it. I've found that sticking with a smaller set of tools that I am very familiar with is better for me that always switching to the best tool for the job. BTW: the dc calculator has a built-in function for doing RSA encryption/decryption which is kind of cool.

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

    For me definitely macros, and the fact that you can make 'em recursive. E.g. to move all the lines containing something to another split I usually go with smth like `/something`, and then `ggqanddhpjl@a`. When there are no more search results, it terminates (same works with other errors).

  • @andrewe4240

    @andrewe4240

    Жыл бұрын

    Also it can be achieved in a different way with :g and :norm. The former is like substitution, but instead executes some command, and the latter executes a normal mode command. With that the aforementioned thingy turns into more readable `:g/something/norm ddhpj`, if I typed that correctly.

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

    basic but useful, to replace some text in the entire document: :%s/before/after/g

  • @anon_y_mousse

    @anon_y_mousse

    Жыл бұрын

    Add a c at the end to have it ask about each substitution as well.

  • @tobiadeniji6630
    @tobiadeniji66308 ай бұрын

    Search and replace example from line 1 to 5: :1,5s/word/replacement/g

  • @tobiadeniji6630

    @tobiadeniji6630

    8 ай бұрын

    1 = first line 5 = fifth line s = search g = global

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

    :wq! should be ZZ

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

    I use .= to spell check the word I am on.

  • @theodorealenas3171

    @theodorealenas3171

    Жыл бұрын

    Dot equals? I've heard of some old Vim functionality for spell checking, but there's no way it's the dot key right?

  • @gingered

    @gingered

    Жыл бұрын

    @@theodorealenas3171 pardon me- z= is what I was looking for. "." Repeats the last action, iirc

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

    This was an awesome video. It brings me back to when I didn't know what bashrc is but it sounded so cool that I wanted Linux. I should spend some time ricing my OS sometime. Here's something I've been up to in vim lately: :e /tmp/a insert mode: grep something -n -r . | sed 's/:\([^:]*\):/ \1G /' normal mode: !!sh This gives results that look like: src/file1 21G And there is something here file2 1G var something = 32; Then I record 2 macros. One macro goes to the file and line under cursor. The other macro goes back to /tmp/a and one line below and calls the first macro. qt0W"gye0gf@gq qn (control shift 6) j@tq This way, I can do some neat tricks. I needed it a whole bunch and I'll need it plenty more, so I better find a way to automate it more or less. Would you be interested to try it out? You do seem to be into that sort of thing.

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

    :redir >> nmap.txt :silent nmap :silent imap :silent vmap :redir END

  • @kebman
    @kebman4 ай бұрын

    Search And Replace from Normal Mode do: `:%s/oldworrd/newword/g`

Келесі