Marks & Folds - Vim Tips (5)

  Рет қаралды 9,683

Ben Kadel

Ben Kadel

Күн бұрын

Twitter: / ben_kadel
Github: github.com/kardelio
P.S. I hope you enjoy the fun introduction as much as I enjoyed making it ;) ... Enjoy
The FIFTH instalment in the widely acclaimed and massively beloved vim show: VIM TIPS!
( • Vim Tips )
This series, hopefully, provides small & easily consumed Tips & Tricks. That you can use in Vim to help you become a better Vim-er and is for Beginners & Intermediate Vim users alike. The aim is to hopefully expose/highlight some of Vim's massive (maybe even lesser known) functionality & features with clear explanations & examples.
In this episode I show you two incredibly useful features that exist already in Vim, that, when used, will enhance your speed & efficiency in the world's greatest Editor. These two features are called: Marks & Folds.
Use the timestamps below (KZbin chapters) to skip ahead to specific sections described below...
To start with I explain MARKS in Vim. The ability to essentially make a bookmark on any location within your Vim buffer. You can then quickly & easily jump to these marked locations. You can of-course list your marks & delete your marks. Not only that but you can jump to the specific column position within your mark too, not just the line that was marked!
In regards to Marks in Vim, I personally prefer to have a constant visual representation of where my marks are throughout my files, so I installed (& recommend) a brilliant plugin called Vim-Signature (github.com/kshenoy/vim-signature) that displays your marks with a small neat letter in the left side panel against the line number for the lines.
Next I explain Folds. The ability to create regions in the contents of your file that can be concatenated down (or minimised) so that if you are not interested in that part of the file or if it is simply a large text block that you want to skip around, then you can use folds to do just that. Like in other IDEs & Text Editors, folds in vim allow you to collapse the regions and see just a very brief summary of what is within the folded region. Folds in Vim give you a huge amount of control, you can set the fold method to be manual and create/delete all of your own specified regions or you can choose any of the following fold methods: marker, indent, syntax or diff and let Vim figure out how to allocate your fold regions for you.
All of these fold methods are explained in the video!
I hope you enjoy this video & hopefully learn a little something from it!
Timestamps ======================
00:00 - Intro
00:04 - Vim Tips Intro
03:34 - Marks & Folds Theory
04:35 - Marks
04:46 - Create a Mark
05:08 - Jump to a Mark
05:37 - See all marks
06:12 - Vim-Signature Plugin (See Marks)
07:12 - Multiple marks on 1 line
07:32 - Delete a Mark
07:54 - Columns in Marks
08:30 - Jump to column position in Mark
08:56 - Cycle through Marks
09:24 - Cycle through column positions in Marks
10:04 - Special Marks
10:56 - Folds
11:07 - Folds explained
11:40 - Fold Methods
12:19 - Manual: Fold Method
12:32 - Set a Fold Method
12:54 - Create a Fold
13:32 - Open/Close/Toggle a Fold
14:06 - Folds in Folds
14:47 - Collapse all Folds
15:03 - Reveal all Folds
15:26 - Delete single Fold
16:02 - Delete Folds recursively
16:49 - Marker: Fold Method
17:39 - Marker demo
18:49 - Change Fold Marker
20:03 - Indent: Fold Method
21:09 - Syntax: Fold Method
22:24 - Diff: Fold Method
23:29 - Open Vim in diff mode
24:53 - Closing
25:17 - Outro
25:47 - Bloopers
Links ======================
Vim Wiki Folding:
vim.fandom.com/wiki/Folding
Vim Wiki Marks:
vim.fandom.com/wiki/Using_marks
Vim-Signature Plugin (See marks in side-bar):
github.com/kshenoy/vim-signature
-------------------------------------
Tools:
-------------------------------------
Video Editing: www.blackmagicdesign.com/prod...
Image Editing: www.gimp.org/
Camera: Canon M50
-------------------------------------
Credits:
-------------------------------------
Intro Card Music: www.purple-planet.com
In Video Music: KZbin Audio Library
In Video Background: Made by me
Icons: Icons made by Freepik from www.flaticon.com
Thumbnail Background: Pexels.com (No Attribution Required)
Sound Effects: soundbible.com/
Vid: 53
#Vim #VimTips #VimMarksFolds

Пікірлер: 40
@BenKadel
@BenKadel 2 жыл бұрын
FYI jump to 03:34 in the video to skip the fun/silly intro and get straight into the content!
@rbettsx
@rbettsx 2 жыл бұрын
Thanks. Think about it. Your audience are Vim users. Vim users don't like wasting time.
@ShaunakDe
@ShaunakDe 7 ай бұрын
I enjoy the silly intro, but also appriciate you posting a skip timestamp!
@hamzamohd.zubair1709
@hamzamohd.zubair1709 Жыл бұрын
Truly worth 100 trillion dollars, can you please make more. Your teaching is so good, we'll forgive you the silly intros.
@rendezvous4304
@rendezvous4304 Жыл бұрын
Nice and clear way of explaining the task. Great work. Hats Off to you
@gauravparvat5291
@gauravparvat5291 2 жыл бұрын
Completely enjoyed watching even on my phone. Only video I found throughly explaining this subject. Will look forward to see (screencast or something similar) how you incorporate this particular feature in YOUR workflow.
@BenKadel
@BenKadel 2 жыл бұрын
Thank you so much for your kind feedback! Really makes my day when i read stuff like this!
@gauravparvat5291
@gauravparvat5291 2 жыл бұрын
@@BenKadel Hell yeah! That is what I live for. And I always search it for in youtube. I don't know, I love to see how other programmers work and steal bits and pieces relevant to my environment. So yes, will be definitely keeping an eye on that.
@SuperKashiyuka
@SuperKashiyuka Жыл бұрын
Best vim tutorial on youtube ! Thanks !
@malamhari_
@malamhari_ 9 ай бұрын
Thanks man for bringing such informative video!
@chuny_dev
@chuny_dev 2 жыл бұрын
Nice content bro, thanks for all your tips
@EnriqueDominguezProfile
@EnriqueDominguezProfile 2 жыл бұрын
Great video! I'm glad I found this on Reddit.
@bhaveshverma8629
@bhaveshverma8629 2 жыл бұрын
Again gain more information about vim. Thanks
@adityams1659
@adityams1659 2 жыл бұрын
Finally its here!
@BenKadel
@BenKadel 2 жыл бұрын
Indeed it is ;)
@farzadmf
@farzadmf 2 жыл бұрын
Super useful vidoe, thank you
@kirubakaranshanmugam
@kirubakaranshanmugam 25 күн бұрын
Recently watched your video and its really helpful. I was chasing internet and ChatGPT to make the Vim folding the patch files for clutter free view. Can you help on this ?
@ujjval2
@ujjval2 11 ай бұрын
How did you bind a key "-m" with the piece of code?
@underflowexception
@underflowexception Жыл бұрын
how can i show if there's a fold on the current line next to the line number?
@tiagodejesus456
@tiagodejesus456 Жыл бұрын
Great video! :-)
@shanewalsch
@shanewalsch 2 жыл бұрын
Can you please share your vimrc, your vim looks cool
@silentvolcano7608
@silentvolcano7608 2 жыл бұрын
Helpfull
@bhaveshverma8629
@bhaveshverma8629 2 жыл бұрын
How to persist fold in vim buffer
@mitidziracerex3512
@mitidziracerex3512 Жыл бұрын
You scared me! You jumped out like the devil!
@shanewalsch
@shanewalsch 2 жыл бұрын
what font do you use?
@BenKadel
@BenKadel 2 жыл бұрын
Hey Shane, sorry where abouts do you mean? for the video thumbnail or somewhere in the video?
@shanewalsch
@shanewalsch 2 жыл бұрын
@@BenKadel in vim
@guruphiji
@guruphiji Жыл бұрын
They were Honk Kong $!!!
@oxoqunb5741
@oxoqunb5741 2 жыл бұрын
OA..wudnt u fit better in Monty Python?
@subnumeric
@subnumeric 2 жыл бұрын
intro takes 4:25 ffs
@BenKadel
@BenKadel 2 жыл бұрын
Yeh thats why I added chapters for those that want to skip past the intro 👍
@noosetime9423
@noosetime9423 2 ай бұрын
manual folds seems so stupid lol
@Barakatic
@Barakatic 2 жыл бұрын
Your video not working well, it's slow and freezing. Maybe you choose wrong format .
@BenKadel
@BenKadel 2 жыл бұрын
Is it? Can you tell me where abouts the slow and freezing is? Because when i see it it looks fine to me?
@Barakatic
@Barakatic 2 жыл бұрын
@@BenKadel it was freeze on first 2 minutes while you are browsing email till end of funny part . I watched again it's ok but still there slowness on that part I mentioned above.
@BenKadel
@BenKadel 2 жыл бұрын
ok thanks for letting me know, i checked that bit a few times my end here now and cant see anything, ill check again later just to be sure! but thank you for letting me know and giving me this heads up :)
@Barakatic
@Barakatic 2 жыл бұрын
@@BenKadel sure, we thank you for valuable contents.
@BenKadel
@BenKadel 2 жыл бұрын
@gofudgeyourselves9024
@gofudgeyourselves9024 5 ай бұрын
Cool intro. Subscribed from adb droidcon italy talk
@gofudgeyourselves9024
@gofudgeyourselves9024 Ай бұрын
2024 i just watch the intro
10 Advanced Vim Features (You Probably Didn't Know)
21:47
Sebastian Daschner
Рет қаралды 65 М.
Китайка и Пчелка 4 серия😂😆
00:19
KITAYKA
Рет қаралды 2,5 МЛН
$10,000 Every Day You Survive In The Wilderness
26:44
MrBeast
Рет қаралды 102 МЛН
Универ. 13 лет спустя - ВСЕ СЕРИИ ПОДРЯД
9:07:11
Комедии 2023
Рет қаралды 693 М.
What are APIs | YouTube API to get Subscriber Count
21:29
Ben Kadel
Рет қаралды 5 М.
Understanding The Vim Registers
31:12
Beginbot
Рет қаралды 23 М.
My Favorite Vim Tricks
14:39
MAKC
Рет қаралды 178 М.
The Holy Grail of Neovim Note Taking
14:38
DevOps Toolbox
Рет қаралды 291 М.
Vim Folds Make Your Code More Readable
9:45
NeuralNine
Рет қаралды 4 М.
Let Vim Do the Typing
32:07
thoughtbot
Рет қаралды 210 М.
Rethinking Neovim as a Tool For Writers
8:48
DevOps Toolbox
Рет қаралды 15 М.
The Hidden Cost Of GraphQL And NodeJS
28:35
ThePrimeTime
Рет қаралды 181 М.
Задача APPLE сделать iPHONE НЕРЕМОНТОПРИГОДНЫМ
0:57
What model of phone do you have?
0:16
Hassyl Joon
Рет қаралды 77 М.
iPhone 15 Unboxing Paper diy
0:57
Cute Fay
Рет қаралды 1,7 МЛН
wyłącznik
0:50
Panele Fotowoltaiczne
Рет қаралды 24 МЛН
СТОИТ ЛИ БРАТЬ IPHONE 13 В 2024?
13:53
DimaViper Live
Рет қаралды 23 М.