Vim Tips And Tricks Some Of My Favorite Vim Commands

Поделиться
HTML-код
  • Опубликовано: 24 ноя 2024

Комментарии • 151

  • @_lessthanzero_
    @_lessthanzero_ Год назад +77

    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

  • @howard-c6h
    @howard-c6h Год назад +33

    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 5 месяцев назад

      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)?

    • @philpeko1796
      @philpeko1796 Месяц назад

      @@VortexFlickens You might wanna find out with ":help insert-mode" which BTW contains ":help compl-autocomplete". Peace & Prosper 🤝🖖

    • @scoopy-poop
      @scoopy-poop 15 дней назад

      Wow I didn’t know about capital i that is a life saver. I remapped caps lock to esc on tap and control on hold, do you think my pinky will still hurt in the long run compared to using the actual escape key(most top left key on keyboard) to escape. Been using vim for 3 months and I love it. I already feel like I move way faster than with keyboard and mouse.

  • @paskuini
    @paskuini Год назад +13

    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

  • @Liamnissan22222
    @Liamnissan22222 Год назад +36

    “I love vim!”
    Sets EDITOR to eMacs 😂

  • @MasterHigure
    @MasterHigure Год назад +39

    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".

  • @im_sreyas
    @im_sreyas Год назад +38

    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 11 месяцев назад +2

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

    • @daveqr
      @daveqr 8 месяцев назад +1

      Insanely useful comment.

    • @im_sreyas
      @im_sreyas 8 месяцев назад

      @@daveqr Thanks ....❤️

    • @champx5
      @champx5 Месяц назад

      is there a way to save comments??

  • @dereklomax161
    @dereklomax161 Год назад +8

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

    • @jp62200
      @jp62200 Год назад

      And o for below

  • @dragonsage6909
    @dragonsage6909 Год назад +9

    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.

  • @johansmolinski
    @johansmolinski Год назад +1

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

  • @JorgeDB
    @JorgeDB Год назад +20

    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 Год назад

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

    • @fincali197
      @fincali197 Год назад

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

  • @zerotheory941
    @zerotheory941 Год назад +6

    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.

  • @steeeeeeeeeeep2189
    @steeeeeeeeeeep2189 Год назад +4

    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 Год назад +5

    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 8 месяцев назад +1

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

  • @teksaucee
    @teksaucee Год назад +3

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

  • @jed_hed2474
    @jed_hed2474 Год назад +21

    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

    • @Cathyprime
      @Cathyprime Год назад +11

      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 Год назад +1

      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 Год назад +5

      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

    • @Cathyprime
      @Cathyprime Год назад

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

  • @johansmolinski
    @johansmolinski Год назад +1

    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.

  • @MakingStuffWithEvan
    @MakingStuffWithEvan Год назад +1

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

  • @terry1311
    @terry1311 7 месяцев назад +1

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

    • @dracbyte
      @dracbyte 3 месяца назад

      I was a fan of :x until I discovered ZZ.

  • @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.

  • @matk2283
    @matk2283 11 месяцев назад +1

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

  • @programmingloop7
    @programmingloop7 6 месяцев назад

    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

  • @ringo8410
    @ringo8410 Год назад +25

    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 Год назад +12

      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 Год назад +3

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

    • @gungun974
      @gungun974 Год назад +5

      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 Год назад +1

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

  • @jeromegay9865
    @jeromegay9865 Год назад +8

    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 Год назад +4

      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

    • @jp62200
      @jp62200 Год назад +1

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

  • @chaitanyashahare2734
    @chaitanyashahare2734 Год назад

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

  • @alexeiz
    @alexeiz Год назад +1

    Always learning something new with DT.

  • @richardgill7781
    @richardgill7781 Год назад +2

    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)

  • @oalfodr
    @oalfodr Год назад +4

    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

  • @Nicfallenangel
    @Nicfallenangel Год назад +4

    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 Год назад +1

      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 Год назад

      can you do a video where you explain that please

  • @benj6964
    @benj6964 Год назад +1

    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...

  • @khalilovitch_
    @khalilovitch_ Год назад +3

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

  • @김담천
    @김담천 11 месяцев назад +1

    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?

    • @lipfried
      @lipfried 10 месяцев назад

      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.

  • @boyscout399
    @boyscout399 Год назад +2

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

  • @Yupppi
    @Yupppi 11 месяцев назад

    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
    @MsDuketown Год назад

    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.

  • @nicholek11
    @nicholek11 Год назад +4

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

    • @jp62200
      @jp62200 Год назад

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

  • @AliensInc.
    @AliensInc. Год назад +1

    Love this, more of this would be nice

  • @anon_y_mousse
    @anon_y_mousse Год назад +2

    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

  • @AceofSpades5757
    @AceofSpades5757 Год назад +1

    VIM IS THE GREATEST EDITOR OF ALL TIME

  • @patrickprucha5522
    @patrickprucha5522 Год назад

    Excellent video. Thanks very much

  • @hectorrbv
    @hectorrbv Год назад

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

  • @keithmcgavin5396
    @keithmcgavin5396 Год назад +4

    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

  • @luigimirabelli5504
    @luigimirabelli5504 Год назад

    Thanks for the video! It's really useful.

  • @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.

  • @silicondecay
    @silicondecay Год назад

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

  • @zenitsu2989
    @zenitsu2989 Год назад +2

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

  • @gogma9967
    @gogma9967 Год назад

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

  • @fahimabrar2922
    @fahimabrar2922 Год назад

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

    • @jp62200
      @jp62200 Год назад

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

  • @adibhanna
    @adibhanna Год назад +1

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

    • @DistroTube
      @DistroTube  Год назад

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

  • @Good-and-Geeky
    @Good-and-Geeky Год назад

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

  • @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!

  • @netstreamer1
    @netstreamer1 2 месяца назад

    My favorite and easiest ways to quit from vim are pressing ZZ (quit and save) or ZQ (quit without saving)

  • @Pherecydes
    @Pherecydes Год назад +1

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

  • @mariorpn
    @mariorpn 10 месяцев назад

    Amazing tips!

  • @improvisedchaos8904
    @improvisedchaos8904 Год назад +1

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

  • @sirrobertdowneysenior8080
    @sirrobertdowneysenior8080 Год назад

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

  • @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!!!! ???

  • @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.*

  • @guillaumef9313
    @guillaumef9313 Год назад +1

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

    • @jp62200
      @jp62200 Год назад

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

  • @CLUBFOOTBALL18
    @CLUBFOOTBALL18 Год назад

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

  • @jp62200
    @jp62200 Год назад

    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

  • @chuanqisun
    @chuanqisun Год назад

    Maybe a review on AstroVim?

  • @streambarhoum4464
    @streambarhoum4464 Год назад

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

  • @BitJam
    @BitJam Год назад +1

    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.

  • @ShrekBytes
    @ShrekBytes Год назад

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

  • @marshallhank891
    @marshallhank891 Год назад

    I always feel like Walter white is teaching me vim😂

  • @IainNitro
    @IainNitro Год назад +1

    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 Год назад +2

      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_ Год назад +1

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

  • @mystic_monk55
    @mystic_monk55 Год назад

    Which program is this which is used for keycasting?

  • @Codigger-br2rt
    @Codigger-br2rt 8 месяцев назад

    How does Vim clear all tags?

  • @AlbertXuY
    @AlbertXuY Год назад

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

  • @dhavald4359
    @dhavald4359 Год назад

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

  • @dominikpotulski576
    @dominikpotulski576 Год назад

    thank you

  • @Bogdanko93
    @Bogdanko93 9 месяцев назад

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

  • @TheGodzilla2201
    @TheGodzilla2201 Год назад

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

  • @wjorgegoszcz7220
    @wjorgegoszcz7220 Год назад +1

    ZQ quit without saving (normal mode)

  • @PeIeus
    @PeIeus Месяц назад

    16:59 lmaooooooooooooooooooooo

  • @rawdawg7995
    @rawdawg7995 6 месяцев назад

    Great video my friend! Thank you much!

  • @GabrielCriado
    @GabrielCriado Год назад +1

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

    • @jp62200
      @jp62200 Год назад

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

  • @kebman
    @kebman 9 месяцев назад

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

  • @LucasD.C.
    @LucasD.C. Год назад +2

    yoooo :D

  • @marioschroers7318
    @marioschroers7318 Год назад +1

    Back to vim from Doom Emacs? 😆

    • @SisypheanRoller
      @SisypheanRoller Год назад +1

      You can use both.

    • @DistroTube
      @DistroTube  Год назад +4

      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. ;)

  • @nnkbrain
    @nnkbrain Год назад +1

    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

  • @fpgaguy
    @fpgaguy 4 месяца назад +1

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

  • @brandon_wallace
    @brandon_wallace Год назад

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

  • @zestynotions
    @zestynotions Год назад +2

    ZZ = exit vim

  • @rotteegher39
    @rotteegher39 Год назад

    I put the 666 like just now

  • @damian_madmansnest
    @damian_madmansnest Год назад

    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)

  • @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.

  • @tobiadeniji6630
    @tobiadeniji6630 Год назад

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

    • @tobiadeniji6630
      @tobiadeniji6630 Год назад

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

  • @_jdfx
    @_jdfx Год назад +1

    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.

  • @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

  • @ninah5603
    @ninah5603 Год назад

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

  • @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.

  • @kebman
    @kebman 9 месяцев назад

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