Рет қаралды 9,683
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