Back to Browse

Different ways to start Vim to enhance your workflow - Vim Tips (4)

6.6K views
Apr 8, 2021
16:16

Twitter: https://twitter.com/ben_kadel Github: https://github.com/kardelio The FORTH instalment in the widely acclaimed and massively beloved vim show: 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 a variety of awesome & easy ways to OPEN vim to achieve a range of diverse & useful effects that will directly enhance your Vim workflow and overall speed-up your editing inside the world's greatest editor. Use the timestamps below (YouTube chapters) to skip ahead to specific sections described below... To start with I show you how you can open Vim and immediately have your cursor ready to go in the exact location that you want to start editing, in particular I show you how to jump to a specific line number and a line that contains a matching regex pattern. These tips will help you get to where you need to edit fast! Next I introduce you to 2 modes of operation that vim has and can be opened in. The first of these two modes of operation, is Vim's diff mode, where you can compare the differences between 2 files in an incredibly easy to understand and digest UI (within Vim). The second of these modes is (Vim community please forgive me) Vim's lesser known "EASY" mode, where vim essentially functions like the simplified nano editor, with stripped back functionality and forcing the user to always only be in INSERT mode. Knowing about these 2 additional modes of operation will provide you with additional capability, in terms of quickly assessing the differences between files and also provide rookie vim users a simplified version of our favourite editor. Next I explain how you can pass command line argument vim commands to Vim as you are triggering it, these vim commands are then run immediately as soon as Vim is opened. This is so useful and once you know about this functionality you are only limited then by the Vim commands that you know. You can create all sorts of brilliant and useful aliases for vim, so that when you open vim, your custom commands and key presses are triggered, setting your Vim environment up ready for you to speed into your workflow! Finally I show you the correct way to pass the output of one shell command directly into vim so that you can digest the output in the comfort of Vim. This may seem immediately like a trivial thing and you are probably screaming at the screen "Just use pipes", to which you would be partially correct, however if you have ever tried to directly pipe output into vim, you will know that its not that simple. I show you how simply adding a hyphen enables Vim to understand that it should read from STDIN instead of a file and enables your pipes to work! I hope you enjoy this video as much as I enjoyed making it! Vim Tips! Timestamps ====================== 00:00 - Intro 02:55 - Jump to specific line num 03:33 - Jump to regex pattern 04:32 - Compare 2 files (diff mode) 05:49 - Start diff mode with already open file 07:12 - Turn off diff mode 07:30 - Start in "EASY" mode 08:50 - Exit vim in "EASY" mode 09:28 - Pass vim a command to trigger when opened 11:34 - Additional example of passing command 12:19 - Open output of shell command in vim 14:33 - Outro 15:32 - Bloopers Links ====================== Open file to line number: https://www.cyberciti.biz/faq/linux-unix-command-open-file-linenumber-function/ https://unix.stackexchange.com/questions/49996/vim-open-file-and-goto-line-number-using-filenameline-nbr Run a command immediately when starting vim: https://stackoverflow.com/questions/6821033/vim-how-to-run-a-command-immediately-when-starting-vim Vim Diff mode: http://vimdoc.sourceforge.net/htmldoc/diff.html Vim Easy mode: https://www.reddit.com/r/vim/comments/7acax2/easy_mode_exists_i_guess/ Exit Easy mode in Vim: https://stackoverflow.com/questions/27439656/how-to-exit-from-vim-y-in-console Pipe output to Vim: https://askubuntu.com/questions/510890/how-do-i-redirect-command-output-to-vim-in-bash Vim Features (Includes more): https://www.freecodecamp.org/news/learn-linux-vim-basic-features-19134461ab85/#:~:text=Steps%3A,take%20you%20to%20edit%20file2 ------------------------------------- Tools: ------------------------------------- Video Editing: https://www.blackmagicdesign.com/products/davinciresolve/ Image Editing: https://www.gimp.org/ Camera: Canon M50 ------------------------------------- Credits: ------------------------------------- Intro Card Music: https://www.purple-planet.com In Video Music: Youtube Audio Library In Video Background: Made by me Thumbnail Background: Pexels.com (No Attribution Required) Sound Effects: http://soundbible.com/ Vid: 46 #Vim #VimTips #UsefulWaysToOpenVim

Download

0 formats

No download links available.

Different ways to start Vim to enhance your workflow - Vim Tips (4) | NatokHD