Intro: The Vim Philosophy

This commit is contained in:
Marco Hinz 2016-01-27 16:00:00 +01:00
parent 5ab66cb6df
commit 09765d6b8c
2 changed files with 29 additions and 1 deletions

View File

@ -10,6 +10,7 @@ All notable changes to this project will be documented in this file.
- Intro: [First steps](README.md#first-steps) - Intro: [First steps](README.md#first-steps)
- Intro: [What kind of Vim am I running?](README.md#what-kind-of-vim-am-i-running) - Intro: [What kind of Vim am I running?](README.md#what-kind-of-vim-am-i-running)
- Intro: [Cheatsheets](README.md#cheatsheets) - Intro: [Cheatsheets](README.md#cheatsheets)
- Intro: [The Vim Philosphy](README.md#the-vim-philosophy)
- Basics: [Marks?](README.md#marks) - Basics: [Marks?](README.md#marks)
- Basics: [Changelist?](README.md#changelist) - Basics: [Changelist?](README.md#changelist)
- Basics: [Changelist? Jumplist?](README.md#changelist-jumplist) - Basics: [Changelist? Jumplist?](README.md#changelist-jumplist)
@ -30,7 +31,7 @@ All notable changes to this project will be documented in this file.
- Usage: [Editing remote files](README.md#editing-remote-files) - Usage: [Editing remote files](README.md#editing-remote-files)
- Usage: [Restore cursor position when opening file](README.md#restore-cursor-position-when-opening-file) - Usage: [Restore cursor position when opening file](README.md#restore-cursor-position-when-opening-file)
- Usage: [Handling backup, swap, undo, and viminfo files](README.md#handling-backup-swap-undo-and-viminfo-files) - Usage: [Handling backup, swap, undo, and viminfo files](README.md#handling-backup-swap-undo-and-viminfo-files)
- Usage: [Running external programs and using filters](#running-external-programs-and-using-filters) - Usage: [Running external programs and using filters](README.md#running-external-programs-and-using-filters)
- Usage: [MatchIt](README.md#matchit) - Usage: [MatchIt](README.md#matchit)
- Debugging: [Verbosity](README.md#verbosity) - Debugging: [Verbosity](README.md#verbosity)
- Debugging: [Debugging Vim scripts](README.md#debugging-vim-scripts) - Debugging: [Debugging Vim scripts](README.md#debugging-vim-scripts)

View File

@ -11,6 +11,7 @@ added every day. Things about to be added can be found here:
#### [Intro](#intro-1) #### [Intro](#intro-1)
- [What is Vim?](#what-is-vim) - [What is Vim?](#what-is-vim)
- [The Vim Philosphy](#the-vim-philosophy)
- [First steps](#first-steps) - [First steps](#first-steps)
- [What kind of Vim am I running?](#what-kind-of-vim-am-i-running) - [What kind of Vim am I running?](#what-kind-of-vim-am-i-running)
- [Cheatsheets](#cheatsheets) - [Cheatsheets](#cheatsheets)
@ -141,6 +142,32 @@ Read [Why, oh WHY, do those #?@! nutheads use
vi?](http://www.viemu.com/a-why-vi-vim.html) to see common misconceptions about vi?](http://www.viemu.com/a-why-vi-vim.html) to see common misconceptions about
Vim explained. Vim explained.
#### The Vim Philosophy
Vim adheres to the modal editing philosophy. This means that it provides
multiple modes and the meaning of keys changes according to the mode. You
navigate files in _normal mode_, you insert text in _insert mode_, you select
lines in _visual mode_, you access commands in _command-line mode_ and so on.
This might sound complicated at first, but has a huge advantage: you don't have
to break your fingers by holding several keys at once, most of the time you
simply press them one after the other. The more common the task, the fewer keys
are needed.
A related concept that works well with modal editing are operators and motions.
_Operators_ start a certain action, e.g. changing, removing, or selecting text.
Afterwards you specify the region of text you want to act on using a _motion_.
To change everything between parentheses, use `ci(` (read _change inner
parentheses_). To remove an entire paragraph of text, use `dap` (read _delete
around paragraph_).
If you see advanced Vim users working, you'll notice that they speak the
_language of Vim_ as well as pianists handle their instruments. Complex
operations are done using only a few key presses. They don't even think about it
anymore as [muscle memory](https://en.wikipedia.org/wiki/Muscle_memory) took
over already. This reduces [cognitive
load](https://en.wikipedia.org/wiki/Cognitive_load) and helps focusing on the
actual task.
#### First steps #### First steps
Vim comes bundled with an interactive tutorial that teaches the most basic Vim comes bundled with an interactive tutorial that teaches the most basic