I’ve been using Ctrl+u and Ctrl+d for a while now, but you’re right, the standard resulting cursor placement is jarring. It never occurred to me to script in a “zz” at the end to fix that. Great suggestion!
@quintondeanmusic
Жыл бұрын
Yep! I just made those changes to my config and my brain is so happy. God dammit dopamine!
@Handleui
9 күн бұрын
You should try M as well. The others are H and L for top and down.
@devvorb1571
Жыл бұрын
I feel like mastering vertical movements is one of those things that makes you just so much more efficient!
@justalawngnome7404
Жыл бұрын
One of the best reasons for mastering vertical movements in Vim that you didn’t mention: almost all of them can also be used for navigating Linux manual pages as well. A very useful skill all around!
@CrazyMineCuber
Жыл бұрын
Use vim as your pager to keep everything consistent.
@darukutsu
Жыл бұрын
I recently switched to "page" which is basically vim/nvim pager written in Rust way more faster to load.
@derdere7803
Жыл бұрын
One of the vertical movements I use every now and then is percent movement. “25%” gets you 1/4 of the code. It’s very useful when you are perusing through a large xml or json file. You don’t have to know total line numbers or anything. And one more thing. If half page scrolls are slow for you you can use ctrl+f/b for full page forward and back.
@tuananhdo1870
5 ай бұрын
I kind of not want to remember too many things, so I only want to remember ctrl d and u
@markmcdonnell
Жыл бұрын
Although I've used Vim for 10+ years I still watched and loved the remap trick with zz to center the scroll. That was worth watching for
@kelvindecosta5350
Жыл бұрын
Can't wait to be blazingly fast at code editing! Thanks Mr. Prime!
@m47h4r
Жыл бұрын
Fan tas tic. Totally what I use on a daily basis. In addition, IDK if it's vertical motion or lsp related vertical motion, but mapping j & k for next/prev diagnostics is my all time favorite. I find myself hitting j once I rename sth in refactoring, it's very delicious to jump to exactly what you want. (of course if the file has many unused code etc etc it becomes useless)
@hberto
Жыл бұрын
I’ll love to see content regarding to find/replace in Neovim, even using for some years I still struggle every time I need to do that. Amazing content!
@f0lderfile
Жыл бұрын
i just wanna say thank you; thanks to your videos i have really been enjoying the process of writing code and not just solving the problems
@gery49
Жыл бұрын
Here are a few more I use often: 100gg will also go to line 100 or whichever line you want Pressing * with the cursor in a word will forward search for that word If you used gg and added an import at the top you can use Ctrl-O to jump back where you were (Ctrl-I or Tab goes the opposite way) A bit more advanced but if you have a tags file for your project generated with ctags jumping around with Ctrl+[ and Ctrl+] is great. This might make a good video *wink* *wink*
@theodorealenas3171
Жыл бұрын
Yes! But keep in mind, gg is incompatible with Vi. It can trip you.
@jazzz4988
Жыл бұрын
You are one of my favorite educators on KZitem. Your vim videos are the best, and I love how many of the things I'm learning here can be used in other places! Like man pages, vimium, etc. Keep up the amazing work, you're like a cool uncle
@J1337H4X0R
Жыл бұрын
I want the wallpaper too
@jazzz4988
Жыл бұрын
@@J1337H4X0R I actually found it a while ago, all of them are in his anime repo on github!
@erenyalcn31
5 ай бұрын
I've been messing around with nvim for couple days now and it is actually so fun. It felt overwhelming at the beginning and I still suck with hjkl movements but after getting comfortable with a few motions it really starts to become a lot easier. Also my typing is getting a lot better. Thanks man!
@BB-848-VAC
Жыл бұрын
These videos are giving me massive motivation. been depressed and stagnant for a whole year basically.
@ThePrimeagen
Жыл бұрын
Let's break the stagnation, together
@Bielocke
Жыл бұрын
You got this Brian, in no time you will be improving, blazingly fast.
@sRavioli
Жыл бұрын
same, switching to nvim is helping me feeling more productive
@vvvvvvvvvvv631
Жыл бұрын
@@sRavioli Exactly. It always feels good when you accomplish something. Learning vim might help with that. nvim therapy!!
@outscope23
Жыл бұрын
I love these videos as well, because improving your keyboard workflow results in so much satisfaction when creating programs and documents, especially while using mechanical keyboards/split keyboards. But the rise of AI (chatGPT over the last days) gives me the depressing feeling of doing this all in vain. Imagine how unfullfilling it could be to just talk to an AI to generate the code you want instead of using your hands to create stuff via keyboard input. Might be time to switch into the trades. Creating things with your hands is too ingrained into human beings to just automate it away. How are we supposed to gain some satisfaction and fullfillment when everything will be generated by just saying/writing a few sentences? It's not like we are going to be wizards casting spells..
@MS-el8wj
Жыл бұрын
I started using VIM in septmeber influced by you. This is the first video i knew everything you said.. It feels good. Love you man
@sasakanjuh7660
Жыл бұрын
You can also jump to a line without :, basically just type the line number + G, and it takes you to the exact line :)
@Kriszzzful
Жыл бұрын
wouldn't work with relative line numbers, would it
@sasakanjuh7660
Жыл бұрын
@@Kriszzzful Well, in my opinion line representation is just for user convenience, it doesn't affect how Vim itself performs actions, so yes, it applies to/works with both regular and relative lines :)
@sasakanjuh7660
Жыл бұрын
Because it works on an absolute line number basis, the way Vim is showing lines to the user is irrelevant, at least I think so :)
@Kriszzzful
Жыл бұрын
@@sasakanjuh7660 but there was kinda of the point he made here, if you have relative line numbers you can jump to a spot relative to you based on those numbers. If you now recommend to use absolute line numbers + G as your workflow it would be much more convenient to show absolute numbers in VIM, otherwise youd have to guess or even worese, calculate 😵💫
@andrewc8125
Жыл бұрын
I should say thank you. I made my decision to switch to Vim from VSC after watching your youtube. I should say...Vim is just WOW
@torphedo6286
Жыл бұрын
Every time I go back and re-watch a video in this playlist I go "wow, that's the most useful thing I've ever heard! I wish I knew that 2 months ago."
@sunnyheheheh9401
Жыл бұрын
Thank you , you continue to optimize my vim so much I love it
@stappa7
Жыл бұрын
'G' an 'gg' motions are useful because you can also use them to navigate to specific lines. To jump to line 50, you just type '50gg' or '50G', and voila. I find it more fast and easier than using : command.
@stappa7
Жыл бұрын
Additionally, if you jump to top/bottom page with gg/G motion, you can return to previous position with double backtick motion. So sometimes i like to write some TODO/thoughts comments at the bottom of the file, and jump back and forth to fast inspecting it.
@Konnuslahti
Жыл бұрын
I think you are kind of underselling the use of G / gg here, I find myself doing G very often when I enter a file because typically the important stuff to focus on is towards the bottom. Especially if you use vim for note taking, then G is used almost always because notes continue at the bottom of the file. But good video, especially good point on / vs {}. Codebases often (unfortunately) lack the paragraphs to make consistent use of {}. 😂
@ThePrimeagen
Жыл бұрын
It's funny that you use G so often. I tend to organize my file in logical groups. So the bottom isn't necessarily useful, or more useful than the middle. But control d and u totally worth getting used to
@Konnuslahti
Жыл бұрын
Well certainly at some point the file turns into a logical group of items but especially at the beginning of a new file or feature, I tend to build the file from top to bottom
@austinb7145
Жыл бұрын
Love your passion for these videos. You've took me from vim-novice to vim-butter; I'm just too fast now
@MiceInDownpour
Жыл бұрын
you don't need to :linenumber - you can just combine any line number with gg/G respectively and get the same result :)
@adissentingopinion848
Жыл бұрын
Heck, if you type a number in command mode you also go there like G.
@daltonyon
Жыл бұрын
I can't live without relative lines, its so useful! I see some videos on internet that people complicate vim and I love yours videos because you uncomplicate VIM and after somedays training I feel so powerful with this motions. I'm use until today } to move, but now I will use CTRL + d and u with this awesome noremap. Thanks Prime!!!!
@csabafarago4095
9 ай бұрын
Ah man, actually I will learn Vim no matter what. Thank you so much for these videos! You rock!
@chyldstudios
Жыл бұрын
Watching the Primeagen is super easy, barely an inconvenience.
@Luclecool123
Жыл бұрын
My way of remembering between G and gg is that G is "heavier" because it is capitalized so it will bring me all the way down of the document 🤷♂️
@Undrios
Жыл бұрын
on vsCode there is "Relative Line Numbers" extension to show Relative Line Numbers :) • 04:22 to do it in vsCode you: (ctrl + p) -> write :96 to go to the 96th line
@petrpechkurov3095
Жыл бұрын
Thank you, Mr. ThePrimeagen!
@hld3738
Жыл бұрын
I just wanted to say thank you for this series. I've been slowly making my way through the motions a couple at a time. I'm using Vim motions now for Intellij and vscode, I look forward to changing to Neovim, in like a year 😃
@Aucacoyan
Жыл бұрын
Excellent video. Keep up! So far I know most of the commands, let's see if I know the next ones!
@rasmuslarsen77
Жыл бұрын
jumping to a specific line number, i prefer the motion gg. fx 25gg will go to line 25.
@艾曦-e4g
Жыл бұрын
See it again and feeling of the "blazingly fast". And waiting for the next update "blazingly fast". LOL!
@RolandHaller
Жыл бұрын
I'd love to see a Vim-foo speed competition, like different users and strategies taking a few katas in different languages and markdown… I'd binge that shit like speedruns…
@guysherman
Жыл бұрын
Also gg takes you to that line number
@someone43543
Жыл бұрын
I AM EXCITED! FIRED UP! Keep up the good videos!
@hamm8934
Жыл бұрын
Could you do a video on which vim debugger you use and how you have it configured? Thanks! Love the videos :)
@avimehenwal
Жыл бұрын
nice trick with `{movement}zz` loved it. I am going to update my .vimrc today :) Super thanks for the great video again prime
@rp2804
Жыл бұрын
Editor did a fine job at that office simulator!
@markvaldez8602
Жыл бұрын
thank you Primeagen! Seriously though really appreciate your work ethic and it inspires me!
@sidisting1381
Жыл бұрын
I think there is a better way to move vertically which is to use this plugin: 'easymotion/vim-easymotion' and have a mapping like the one below (which is the one I use) :nmap s (easymotion-s) you can use a key other than "s" if you find yourself using "s" (substitute a character) a lot. it allows you to navigate not only to a specific line, but to a SPECIFIC LETTER within that line with only TWO KEYSTROKES (you'll rarely need three)
@betterinbooks
Жыл бұрын
I dont know if it conflicts with anything but I mapped to 4j and to 4k for when I want to move fast up and down. instead of and . and if 4 isn't fast enough for you, you can always do 5, 6... -- init.lua vim.keymap.set('n', '', '4j') vim.keymap.set('n', '', '4k') vim.opt.scrolloff = 8 with scrolloff = 8 it's pretty good. you don't even need zz at the end. also I should mention, I decreased the repeat delay and increased repeat speed on keyboard settings.
@Zertockreturn
Жыл бұрын
Just tried out Haskell. What a wild ride of confusion to begin with, would be fun having a video of you doing something in it.
@vincenzorm117
Жыл бұрын
Please keep making videos. These are very helpful :D
@dannyv339
7 ай бұрын
3:28 Genius!
@patricioferraggi505
Жыл бұрын
btw, you can also do Number + G to go to that line (for the example of :100 )
@budimanjojo4456
Жыл бұрын
the thing I hate about using line numbers to go up and down is I need to type the numbers which are so far away from my finger reach. I've been using up/down paragraph since forever but I think I need to start using the page up/down now. Thanks for this, actually got something new to learn although I've been using vim for so long.
@leszekrozkiewicz2372
Жыл бұрын
Grejt Grejt ;) work The Great Primeagen
@hugonijhuis-mekkelholt1321
Жыл бұрын
Great series, just missing the uplifting music from the old series to get pumped blazingly fast!
@ashutoshandhare7626
Жыл бұрын
Hey man, this is such a great series! I've been trying vim for quiet some time now but always stop using because it's so difficult to navigate and operate. Thanks a lot for this series! Also can you put the part number in the video titles? So that it'd be easier for the upcoming parts of this series? Also when are uploading the next part of this series?
@markmcdonnell
Жыл бұрын
My vertical searching pattern is generally... 1. Ctrl d/u 2. * n/N 3. / (inc. generic search like /func) 4. Sidebar of symbols (via plugin) 5. Search symbols via LSP/Telescope
@billeterk
Жыл бұрын
If you’re old fashioned (or LSP set up lazy) ctags/uctags and :ta / ^] work ok too.
@adamgy
Жыл бұрын
the neoscroll plugin is also pretty good for easing the disorientation from ctrl-d / ctrl-u
@MrR8686
Жыл бұрын
Diesel of the vim diesel
@davidhochstetler7981
Жыл бұрын
Oh yeah, we getting vertical today
@neoland1527
28 күн бұрын
i cracked laughing at a tutorial that also made me learn. This was a first.
@lagwulf1637
Жыл бұрын
I even write LaTeX with vim sometimes - I build kinda memory hook...I want to append text, so let's: Go (to the end and insert line beneath). ;)
@mondo1926
Жыл бұрын
@ThePrimeagen is bringing back ZZ Top in style 😉
@jeanpaulgalea3577
Жыл бұрын
Love your content Prime! Thanks for keeping us motivated and entertained! What plugin are you using to display the git branch name at the bottom?
@NDValle
Жыл бұрын
I was waiting for this video!
@kodder
Жыл бұрын
Here is how I remember gg vs G. Usually you say gg (good game) when you finish 1st... so gg -> 1 ... top of the file.
@jakal13
Жыл бұрын
ctrl+l or :redraw- exits the the search-mode in case you are stuck, cause you pressed Enter🖖
@gachikuku
Жыл бұрын
Thank you!
@Solsenderz
9 ай бұрын
I did the customization before I even learn 1 language, lol, IDK if that was necessary, I really know not a single danm language. I just like the flow of vim, and after customization, I feel like I started to understand a few things in programming terms, though.
@DeadRobotDev1
Жыл бұрын
Do you have plans to continue this series? I've found it incredibly helpful. I've picked up some commands / motions through use, but this series fills in the gaps. Either way, thank you!
@maxakn
Жыл бұрын
zz yesss eureka moment
@Richard-sp3ul
Жыл бұрын
I need a little prime in me every day just to feel normal.
@vorax1213
Жыл бұрын
4:25 you can also just do "100gg" instead of typing ":100"
@Drama-ck2tp
Жыл бұрын
keep em coming prime!
@scottastatine
Жыл бұрын
Love Emacs with vim keybindings!?
@GAccountMe
Жыл бұрын
Thx!! More vim content!!🎉
@nahfamimgood
Жыл бұрын
thanks dad
@filko3578
Жыл бұрын
Comment for the algorithm. Tokiooo
@mrsubrange
Жыл бұрын
and by the way: Karen-something, we don't need a HR department here, because your job will be taken over by a brand new AI/ML algorithm, so you're fired!
@Quatsch83
Жыл бұрын
Shouldn't the and mappings be M rather than zz? zz just recenters the line the cursor is on to the middle by scrolling the buffer. M will move the cursor to the middle line without scrolling the buffer.
@ThePrimeagen
Жыл бұрын
i like zz
@ThePrimeagen
Жыл бұрын
not only that but M moves cursor. so you would go 1/2 page down, but if you were 1/3 up the page you would get less than 1/2 page scroll and then you would get this weird oscillation effect until you finally centered yourself (depending on your scrolloffset)
@Quatsch83
Жыл бұрын
@@ThePrimeagen Ha...ignore what I said. I forgot I had remapped and in my vimrc based on the tip for smooth scrolling in the vim help's tips.txt file: :map I agree remapping it to have zz makes way more sense. For the mapping I have, it needs the M at the end to keep the cursor in the middle...
@sidisting1381
Жыл бұрын
Have you ever tried "yonchu/accelerated-smooth-scroll" vim plugin, and what is your opinion about it?. I think it makes the experience of navigating horizontally with and much better.
@Mafanca
Жыл бұрын
I want moreee! need more smothness! ...please.
@SharkBear314
4 күн бұрын
I love you
@SrPoto05
Жыл бұрын
Excelente video, me motiva aprender mucho a manejar más rápido nvim, saludos desde colombia :3
@NalumGames
Жыл бұрын
Didn't know about jumping to a line with :line-number, I type the line number and press shift-g for the same thing.
@SkyKosiner
Жыл бұрын
This man vims hard
@ThePrimeagen
Жыл бұрын
I do yoni
@acklackl
Жыл бұрын
Why not use sneak, or leap. I'm currently using leap. But cool tip on using zz after scrolling to center, quite handy
@zerdofish9989
Жыл бұрын
game and changer
@ra-dro
Жыл бұрын
Hey @ThePrimeagen, maybe you could create some lection about modifying data in Vim. For example, how to convert export enum Category { a. JavaScript b. CSS c. HTML d. TypeScript e. Angular } into export enum Category { 'JavaScript', 'CSS', 'HTML', 'TypeScript', 'Angular', }
@droid-fs8fu
Жыл бұрын
Does anybody know how to make the zz remap in VSCode Neovim? I can't seem to figure out how to fire both. The following remap does not work :-) { "command": "vscode-neovim.send", "key": "ctrl+d", "when": "editorTextFocus && neovim.mode != insert", "args": "zz" }
@cloudmindead5560
Жыл бұрын
Thats another reason for you to completely switch to neovim :D
@baz_sh
Жыл бұрын
Is the VIMRC video no longer available? I can't find it 🤔
@AlexanderNohe
Жыл бұрын
What do you think of Astro vim? I'm a little too lazy for my own setup and it seems to do a lot of things I want oob
@shrek1412
Жыл бұрын
Hi @ThePrimagen, is there any way to move verticall like w, e, b in horizontal movement? I find it is hard to press number buttons? Thanks
@julo.parapente
Жыл бұрын
Thank's for the vid! What do you guys think about motion plugins such as leap? I have mixed feelings: on one hand, it seems like a nice productivity boost with a gentle learning curve. On the other hand, I fear it may make me lose the habit of regular vim motions, and make it hard on me if I ever have to use a vi-like editor without my config (or worse: vs code with the vim plugin 🥶)
@gamezoid1234
Жыл бұрын
Lol, my vertical motions are way better than my horizontal motions. I basically already do the search thing and I've never really focused on my vertical motions. the / operator is amazing. trying to use f to jump to something on has been a bitch.
@Ghasakable
Жыл бұрын
this is very much useful, thank you for much for pointing out the `zzz` for centering the view, I have now less headache. Here are my configurations for Lua, I just added also the { and } centered as you did with others -- [Vim As Your Editor - Vertical Movements ] vim.api.nvim_set_keymap("n", "", "zz", {noremap = true, silent = true}) vim.api.nvim_set_keymap("n", "", "zz", {noremap = true, silent = true}) vim.api.nvim_set_keymap("n", "", "zz", {noremap = true, silent = true}) vim.api.nvim_set_keymap("n", "", "zz", {noremap = true, silent = true}) -- How about {} jumping, which works the same, vim.api.nvim_set_keymap("n", "{","{zz",{noremap = true, silent = true}) vim.api.nvim_set_keymap("n", "}","}zz",{noremap = true, silent = true}) -- For better-searching vim.keymap.set('n', 'n', 'nzzzv') vim.keymap.set('n', 'N', 'Nzzzv')
@caoticus
7 ай бұрын
Feel realy stupid asking this ... but ... how can I find the playlist this video belongs to ?
@samsak1239
Жыл бұрын
I wanted to hit the like button but the like counter was 404, so I didn't. I'll do it after it resolves.
@brandonduvalbenn3400
Жыл бұрын
I set `scrolloff` to 999 so that my cursor is always centered. No need for `zz` after that.
@dhruvgupta9633
Ай бұрын
can anyone give link to vim rc video the one in description is not wokring and i can't find it either by searching it.
@cthutu
Жыл бұрын
I use Neovim and I don't have the :VimBeGood command.
@nikilk
5 ай бұрын
@ThePrimeagen [3:34] For remapping ctrl + d to ctrl + d followed by zz to recenter, I found a solution that works on the Kinesis keyboards. The below macro does the same job one for ctrl + d and the next for ctrl + u. {lctr}{d}>{x1}{s9}{-lctr}{d}{+lctr}{z}{z} {lctr}{u}>{x1}{s9}{-lctr}{u}{+lctr}{z}{z}
Пікірлер: 237