http://vim.wikia.com/wiki/Macros
Neuer Macro:
q<letter><commands>q
Macro ausfuehren:
<number>@<letter>
Macros in visual Mode ausführen:
Select the lines
:normal @q
http://vim.wikia.com/wiki/Search_and_replace
:[range]s[ubstitute]/pattern/string/[options]
Range: %
complete file
g
globally
c
confirmation
vimdiff file1 file2 ...
:vnew
:windo diffthis
:diffoff
Background passt die Farben auf verschiedene colorschemes an. Ist besonders wichtig, wenn man es hin und wieder aendert.
:set background=light
:set background=dark
Maus interaktion deaktivieren:
:set mouse=
Übersicht über die Plugins
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
http://www.rosipov.com/blog/custom-templates-in-vimwiki/
Wichtigste Befehle:
\ww start vimwiki
:VimwikiAll2HTML create HTML
Codesnippet:
”{{{ Codesnippet }}}”
Configuration: https://gist.github.com/maikeldotuk/54a91c21ed9623705fdce7bab2989742#gistcomment-2856827
let g:vimwiki_list = [{ \ ‘auto_export’: 1, \ ‘automatic_nested_syntaxes’:1, \ ‘path_html’: ‘$HOME/Sync/wiki_html’, \ ‘path’: ‘$HOME/Sync/wiki’, \ ‘template_path’: ‘$HOME/Sync/wiki/template/’, \ ‘syntax’: ‘markdown’, \ ‘ext’:’.md’, \ ‘template_default’:‘markdown’, \ ‘custom_wiki2html’: ‘$HOME/Sync/wiki2html.sh’, \ ‘template_ext’:’.html’ }]
au BufRead,BufNewFile *.md set filetype=vimwiki
let g:taskwiki_sort_orders={“C”: “pri-”} let g:taskwiki_syntax = ‘markdown’ let g:taskwiki_markdown_syntax=‘markdown’ let g:taskwiki_markup_syntax=‘markdown’
Conceallevel:
:set conceallevel=0
https://github.com/honza/vim-snippets/tree/master/UltiSnips
Make a new snippet: :UltiSnipsEdit
Snippet layout:
snippet triggerword example snippet text endsnippet
Finally, let’s try out visual mode. Press a capital V (for linewise visual mode) followed by S<p class=“important”>.
Hello world!
ctags installieren apt-get install exuberant-ctags
Mit F8 toggeln
https://raw.githubusercontent.com/godlygeek/tabular/master/doc/Tabular.txt
Ein paar Beispiele:
Text selektieren:
:Tabularize /|/
:Tabularize /,
:Tabularize /,/r0
:Git
:Git mergetool
:Git log
:Git diff
https://stackoverflow.com/questions/1497958/how-to-use-vim-registers#1498026
Alle Register anzeigen: :reg
In Register k kopieren: "kyy
Register suchen: /<C-r>k
https://www.linux.com/learn/tutorials/357267-using-spell-checking-in-vim
:set spell
z=
http://vim.wikia.com/wiki/Make_Vim_completion_popup_menu_work_just_like_in_an_IDE
echo test | vim -
mk
`k
'k
:marks
\# 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
https://realpython.com/blog/python/vim-and-python-a-match-made-in-heaven/
Quickfix List https://vimhelp.org/quickfix.txt.html#grep
Helpgrep: https://vimhelp.org/helphelp.txt.html#%3Ahelpgrep
:copen
:vimgrep /test/j *.wiki
:lgrep test *.wiki
:grep -r -i --include=*.wiki Vimwiki ./
:grep -ir --include "*.md" "sick"