Vim

%toc

Macros

Neuer Macro:

q<letter><commands>q

Macro ausfuehren:

<number>@<letter>

Substitute

:[range]s[ubstitute]/pattern/string/[options]

Range: % complete file

Options

Vimdiff

vimdiff file1 file2 ...
:vnew
:windo diffthis
:diffoff

Colors

Background passt die Farben auf verschiedene colorschemes an. Ist besonders wichtig, wenn man es hin und wieder aendert.

    :set background=light
    :set background=dark

Plugins

Übersicht über die Plugins

Vundle

Paketmanager

Quickstart: https://github.com/gmarik/Vundle.vim#quick-start

git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim And inside vim: :VundleInstall

Neue Konfig laden:

:so %
:VundleInstall

Plugins die noch nicht da sind

Vimwiki

Wichtigste Befehle:

\ww start vimwiki
:VimwikiAll2HTML create HTML

Codesnippet:

"{{{
Codesnippet
}}}"

UltiSnips

Make a new snippet: :UltiSnipsEdit

Snippet layout:

snippet triggerword
example snippet text
endsnippet

Vim-surround

Finally, let's try out visual mode. Press a capital V (for linewise visual mode) followed by S<p class="important">.

<p class="important">
  <em>Hello</em> world!
  </p>

tagbar

Mit F8 toggeln

tabular

ycm You complete Me

Installation:

syntastic

Neocomplete

Register

Alle Register anzeigen: :reg

In Register k kopieren: "kyy

Register suchen: /<C-r>k

Spellcheck

:set spell

z=

Completition

Pipe into Vim

echo test | vim -

Marker

mk
`k
'k
:marks

Regex

# Meaning
. any character except new line
\s whitespace character
\S non-whitespace character
\d digit
\D non-digit
\x hex digit
\X non-hex digit
\o octal digit
\O non-octal digit
\h head of word character (a,b,c...z,A,B,C...Z and _)
\H non-head of word character
\p printable character
\P like \p, but excluding digits
\w word character
\W non-word character
\a alphabetic character
\A non-alphabetic character
\l lowercase character
\L non-lowercase character
\u uppercase character
\U non-uppercase character
# Meaning
& the whole matched pattern
\L the following characters are made lowercase
\0 the whole matched pattern
\U the following characters are made uppercase
\1 the matched pattern in the first pair of \(\)
\E end of \U and \L
\2 the matched pattern in the second pair of \(\)
\e end of \U and \L
\r split line in two at this point
\9 the matched pattern in the ninth pair of \(\)
\l next character made lowercase
~ the previous substitute string
\u next character made uppercase

Python

neovim