######### ####### ####### ####### ## ## ## ## # ## # ## ## ## ## ## ###### ## ## #### #### ## ## ## ### ### ## ## ## ## ## ## ## ## # ## # ## ## ####### ####### ####### ~ Linux / FOSS Meetup Linz ~

~ Jan 2024 ~

CC BY-SA 4.0 Daniel KNITTL-FRANK


Whois

Vim

### ### #### # # ## ## ## ## ## ## ## ## #### #### ## ## ## ## ## ## ## ## ## ## ## ### ## ## ## ## ## # ## ### ## ## ## # #### #### ####

https://en.wikipedia.org/wiki/Vim_(text_editor)

First Things First

Testimonials

Vi is like a Ferrari, if you're a beginner, it handles like a *****, but once you get the hang of it, it's small, powerful and FAST! --- (Unknown)

VIM is like a new model Ferrari, and sounds like one too - "VIIIIIIMMM!" --- (Stephen Riehm, Germany)

https://elias.rhi.hi.is/vim/quotes.html

Mode Based Editing

Getting Started

Vim comes with vimtutor binary which provides an "interactive" tutorial.

You should try it :]

Basic Motions

^ k Hint: The h key is at the left and moves left. < h l > The l key is at the right and moves right. j The j key looks like a down arrow. v

But you can almost always simply use the arrow keys to navigate

Shameless plug: … or you can learn Neo to avoid moving your hand to the arrow keys

Basic Inserting

To enter insert mode:

When Something Goes Wrong

Don't panic and <ESC>

Cool Selection Tricks

Basic Editing

Copy & Paste

More Motions

Combining Keys

Compose single keys to build powerful actions:

Text Object Selection

v enters visual mode (selecting text)

Searching

Text layout

Autocompletion

Registers

Macros

Registers can be used to store and replay macros

()guw~)

Pro-tip: Macros are simply text in registers, you can yank, edit, and paste them: "rp and "ry

Quick Filter

Need to filter current line through external command?

Command Line Mode ("ex" mode)

:[range][command]

Useful commands:

Useful Config Options

``` set number " show line numbers

set ignorecase smartcase " ignore case if pattern lower case

set incsearch " incremental search set hlsearch " highlight all matches

" show non-printing characters (make sure your terminal supports UTF8!) set list listchars=tab:→ ,nbsp:␣,trail:•,space:⋅ ```

Can be persisted in ~/.vimrc. If you want to have a look at my settings, check out https://github.com/knittl/.files/blob/master/.vimrc

Plugins

Plugin Manager: Plug

$ curl -fLo ~/.vim/autoload/plug.vim --create-dirs \ https://github.com/junegunn/vim-plug/raw/master/plug.vim

Then add to your ~/.vimrc:

call plug#begin() Plug 'git repository url' call plug#end()

Useful Plugins (Incomplete List)

Using Vim in Other Applications

Sources and Further Reading

Contact