Commit 07f26465 authored by Philip Linghammar's avatar Philip Linghammar
Browse files

Updates vim.md

Auto commit by GitBook Editor
parent e2e3aaa4
Loading
Loading
Loading
Loading
+25 −21
Original line number Diff line number Diff line
# Vim

http://www.viemu.com/a-why-vi-vim.html
And also this classic answer: https://stackoverflow.com/questions/1218390/what-is-your-most-productive-shortcut-with-vim

[http://www.viemu.com/a-why-vi-vim.html](http://www.viemu.com/a-why-vi-vim.html)  
And also this classic answer: [https://stackoverflow.com/questions/1218390/what-is-your-most-productive-shortcut-with-vim](https://stackoverflow.com/questions/1218390/what-is-your-most-productive-shortcut-with-vim)

## Core concepts

@@ -12,6 +11,14 @@ In vim you have the concept of buffers.
# List buffers
:buffers

# Switch buffer
# By number
b1
b2
# By name
b [name]


# Close/delete a buffer
:bdelete
:bd
@@ -25,7 +32,7 @@ In vim you have the concept of buffers.

**start of line**

`0` (zero)
`0` \(zero\)

**end of line**

@@ -77,7 +84,6 @@ Operators are commands that do things. Like delete, change or copy.
`ce` - change until end of the word.  
`c$` - change until end of line.


## Combining Motions and Operators

Now that you know some motion commands and operator commands. You can start combining them.
@@ -97,12 +103,10 @@ You can use numbers to perform operations.

`3dd` - delete three lines


## Replace

If you need to replace a character, there is no need to enter insert-mode. You can just use replace


Go to a character and the press `r` followed by the character you want instead.

`rp` if you want to replace p.
@@ -135,14 +139,14 @@ The `"` means that we are not entering a registry. And the `*` means the OS-clip

Here is all your vim-configuration.


## Plugins

Install vundle here  
https://github.com/VundleVim/Vundle.vim
[https://github.com/VundleVim/Vundle.vim](https://github.com/VundleVim/Vundle.vim)

**Add plugin**

Add plugin to your .vimrc-file and then open vim and write

`:PluginInstall`