vim
-
Help, Links and Cheat Sheet
- https://i.imgur.com/YLInLlY.png
- https://www.digitalocean.com/community/tutorials/how-to-use-vim-for-advanced-editing-of-plain-text-or-code-on-a-vps—2
- https://bitbucket.org/tednaleid/vim-shortcut-wallpaper/raw/tip/vim-shortcuts.png
- http://vimcasts.org/episodes/
- http://amix.dk/vim/vimrc.html
- http://dougblack.io/words/a-good-vimrc.html
- http://blog.sanctum.geek.nz/vim-filename-completion/
- https://sanctum.geek.nz/arabesque/vim-anti-patterns/
- https://vimhelp.org/
- https://vimways.org/2018/debugging-your-vim-config/
-
Macros
-
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
-
-
Substitute
-
http://vim.wikia.com/wiki/Search_and_replace
:[range]s[ubstitute]/pattern/string/[options]
Range:
%
complete file -
Options
-
g
globally -
c
confirmation -
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
-
Maus
Maus interaktion deaktivieren:
:set mouse=
-
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
-
Vimwiki
-
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
-
UltiSnips
-
https://github.com/honza/vim-snippets/tree/master/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”>.
Hello world!
-
tagbar
-
ctags installieren
apt-get install exuberant-ctags
Mit F8 toggeln
-
tabular
-
https://raw.githubusercontent.com/godlygeek/tabular/master/doc/Tabular.txt
Ein paar Beispiele:
Text selektieren:
:Tabularize /|/ :Tabularize /, :Tabularize /,/r0
-
syntastic
-
Neocomplete
-
Fugitive
:Git :Git mergetool :Git log :Git diff
-
Register
-
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
-
Spellcheck
-
https://www.linux.com/learn/tutorials/357267-using-spell-checking-in-vim
:set spell
z=
-
Completition
-
http://vim.wikia.com/wiki/Make_Vim_completion_popup_menu_work_just_like_in_an_IDE
-
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
-
https://realpython.com/blog/python/vim-and-python-a-match-made-in-heaven/
-
Grep
-
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"