Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
Beide Seiten der vorigen Revision Vorhergehende Überarbeitung Nächste Überarbeitung | Vorhergehende Überarbeitung | ||
systemverwaltung:user_info:vim [2016/03/16 09:01] admin [Splitting windows] |
systemverwaltung:user_info:vim [2021/12/02 11:27] (aktuell) |
||
---|---|---|---|
Zeile 3: | Zeile 3: | ||
" | " | ||
- | Here are some tips: | + | Here are some tips from https:// |
* | * | ||
Zeile 28: | Zeile 28: | ||
Moving from one window to the next | Moving from one window to the next | ||
- | Ctrl-w Ctrl-w: rotate through the windows | + | Ctrl-w Ctrl-w: rotate through the windows\\ |
- | Ctrl-w space: rotate through the windows | + | Ctrl-w space: rotate through the windows\\ |
- | Ctrl-w j: go to window downwards | + | Ctrl-w j: go to window downwards\\ |
- | Ctrl-w k: go to window upwards | + | Ctrl-w k: go to window upwards\\ |
- | Ctrl-w _: maximize current window | + | Ctrl-w _: maximize current window\\ |
- | Ctrl-w =: make all windows same size | + | Ctrl-w =: make all windows same size\\ |
===== Pasting indented text ===== | ===== Pasting indented text ===== | ||
Zeile 40: | Zeile 40: | ||
When vim is autoindenting the results of pasting some text can be quite horrible. There is a simpel solution for this: | When vim is autoindenting the results of pasting some text can be quite horrible. There is a simpel solution for this: | ||
+ | <code vi> | ||
:set paste | :set paste | ||
< some pasting here > | < some pasting here > | ||
:set nopaste | :set nopaste | ||
+ | </ | ||
That is all! | That is all! | ||
Zeile 54: | Zeile 56: | ||
To select a block between ( and ) do: | To select a block between ( and ) do: | ||
- | vab | + | vab |
and to select a block between { and } do: | and to select a block between { and } do: | ||
- | vaB | + | vaB |
===== Showing all your bookmarks ===== | ===== Showing all your bookmarks ===== | ||
Zeile 67: | Zeile 69: | ||
You can easy set bookmarks in your text with the command: m< | You can easy set bookmarks in your text with the command: m< | ||
- | ma | + | ma |
This sets the mark " | This sets the mark " | ||
From anywhere in your file you can jump to this mark with single-quote-< | From anywhere in your file you can jump to this mark with single-quote-< | ||
- | 'a | + | 'a |
Doing stuff until the next mark | Doing stuff until the next mark | ||
Zeile 78: | Zeile 80: | ||
Marks are not only great to find stuff in your file, you can also use them as a boundary when doing stuff over multiple lines. Example: | Marks are not only great to find stuff in your file, you can also use them as a boundary when doing stuff over multiple lines. Example: | ||
- | .,' | + | .,' |
This stands for: | This stands for: | ||
Zeile 92: | Zeile 94: | ||
Say you mark the beginning of the area with a and the end with b. Now we can do stuff like: | Say you mark the beginning of the area with a and the end with b. Now we can do stuff like: | ||
- | | + | delete area |
:' | :' | ||
- | | + | write area to a new file |
:' | :' | ||
- | | + | substitute only in this area |
:' | :' | ||
Zeile 111: | Zeile 113: | ||
You can ask vim to show a list of all your marks (and some marks it made on its own) with the command: | You can ask vim to show a list of all your marks (and some marks it made on its own) with the command: | ||
- | :marks | + | :marks |
If you are only intested in what is under mark f, you can ask vim also: | If you are only intested in what is under mark f, you can ask vim also: | ||
- | :marks f | + | :marks f |
===== Sort an part of your file in vim ===== | ===== Sort an part of your file in vim ===== | ||
Zeile 128: | Zeile 130: | ||
Hit | Hit | ||
- | :sort | + | :sort |
Et voila: the area is sorted alphabetical (well, ASCII-betical). | Et voila: the area is sorted alphabetical (well, ASCII-betical). | ||
Zeile 142: | Zeile 144: | ||
Open a filebrowser with | Open a filebrowser with | ||
- | :E | + | |
===== Edit your last shell command ===== | ===== Edit your last shell command ===== | ||
Zeile 149: | Zeile 151: | ||
In your bash-shell, hit | In your bash-shell, hit | ||
- | fc | + | |
Zeile 159: | Zeile 161: | ||
Some information of your current buffer is shown when entering the command | Some information of your current buffer is shown when entering the command | ||
- | g Ctrl-g | + | |
This includes the word-count | This includes the word-count | ||
Zeile 167: | Zeile 169: | ||
When editing a file named foo.c this mapping will open a new window with file foo.h: | When editing a file named foo.c this mapping will open a new window with file foo.h: | ||
- | map <C-h> :new %:p:r.h | + | |
- | Put this line in your .vimrc. Then, open a file foo.c and hit Ctrl-h. | + | Put this line in your '' |
(more to follow) | (more to follow) | ||
Zeile 177: | Zeile 179: | ||
Vim 101: A Beginner' | Vim 101: A Beginner' | ||
+ | |||
Vim 201: An Intermediate Guide to Vim http:// | Vim 201: An Intermediate Guide to Vim http:// | ||
Last updated: $Date: 2010-01-29 10:55:32 | Last updated: $Date: 2010-01-29 10:55:32 | ||
- | From: https:// | + | ===== vim und LaTeX ===== |
+ | |||
+ | LaTeX |