.. vim: noexpandtab fileencoding=utf-8 nomodified wrap textwidth=270 foldmethod=marker foldmarker={{{,}}} foldcolumn=4 ruler showcmd lcs=tab\:|- list tabstop=8 noexpandtab nosmarttab softtabstop=0 shiftwidth=0 :date: 2023.06.21 04:57:18 :modified: 2023.11.19 22:33:35 :tags: HowTo :authors: Gilhad :summary: vim :title: vim :nice_title: |logo| %title% |logo| %HEADER% how in 'vim' editor delete empty lines in visual selection? -------------------------------------------------------------------------------- .. code:: V - select lines :g/^\s*$/d g: Global command that applies the following command to all lines in the selection that match a pattern. /^\s*$/: The pattern to match. In this case, it matches all lines that contain only whitespace characters (spaces, tabs, etc.) or are completely empty. d: The command to execute for each matching line. In this case, it deletes the line. How in vim open file at cursor? -------------------------------------------------------------------------------- .. code:: gf line-continuation -------------------------------------------------------------------------------- .. code:: :h line-continuation :e ~/.vimrc map ,rr :set noexpandtab^M:set nosmarttab^M:set textwidth=270^M,r o:date: 1970.01.01 00:00:00^M \:tags: none^M \:authors: Gilhad^M \:summary: ^[:put %^MkJA^?^?^?^?^M \:title: ^[:put %^MkJA^?^?^?^?^M \:nice_title: \|mix\| %title% \|mix\|^M^M \%HEADER\%^M^M \^[:put %^MkJA^?^?^?^?^M^[80i-^[o^M^MLorem ipsum ...^M^[/:date:^M,. :%s/mix/mix/g Colors for #define, #include, #ifndef -------------------------------------------------------------------------------- `~/.vimrc` .. code:: highlight Macro ctermfg=Cyan highlight Include ctermfg=Cyan highlight PreCondit ctermfg=Cyan Move screen, so current line is at bottom -------------------------------------------------------------------------------- .. code:: zb Move cursor anywhere -------------------------------------------------------------------------------- .. code:: 'virtualedit' 've' string (default "") global or local to window global-local A comma-separated list of these words: block Allow virtual editing in Visual block mode. insert Allow virtual editing in Insert mode. all Allow virtual editing in all modes. onemore Allow the cursor to move just past the end of the line none When used as the local value, do not allow virtual editing even when the global value is set. When used as the global value, "none" is the same as "". NONE Alternative spelling of "none". Virtual editing means that the cursor can be positioned where there is no actual character. This can be halfway into a tab or beyond the end of the line. Useful for selecting a rectangle in Visual mode and editing a table. DrawIt - plugin for drawing ASCII art -------------------------------------------------------------------------------- .. code:: +------------------------------------------------------------------+ | DrawIt - plugin for drawing ASCII art | +------+-----------------------------------------------------------+ | From | ``__ | +------+-----------------------------------------------------------+ in rst +------------------------------------------------------------------+ | DrawIt - plugin for drawing ASCII art | +------+-----------------------------------------------------------+ | From | ``__ | +------+-----------------------------------------------------------+ Zapnout \\di vypnout \\ds Push order for 6809 stack: .. code:: New S Old S | | | | $0000 v v $FFFF +--+- -+--+--+--+--+--+--+--+--+--+--+--+--+---+---+--+--+--+--+- -+--+ |..|.......|..|..|CC| A| B|DP|Xh|Xl|Yh|Yl|Uh|Ul|PCh|PCl|##|##|##|..|.......|..| +--+- -+--+--+--+--+--+--+--+--+--+--+--+--+---+---+--+--+--+--+- -+--+ |Sh|Sl| +--+--+ for PSHU ... PUSH / PULL order +-----+-----------------------------+ | CC | Condition Code Register | . | +-----+-----------------------------+ /_\ | | A | A Accumulator | | | +-----+-----------------------------+ | | B | B Accumulator | | P +-----+-----------------------------+ U | DP | Direct Page Register | P L +-----+-----------------------------+ U L | X | X Index Register | S +-----+-----------------------------+ H | | Y | Y Index Register | | +-----+-----------------------------+ | _|_ | S/U | Hardware/User Stack Pointer | | \ / +-----+-----------------------------+ | ' | PC | Program Counter | +-----+-----------------------------+ Zathura size -------------------------------------------------------------------------------- .. code:: ~/.config/zathura/zathurarc set window-width 2490 set window-height 1390 4e3tina aneb náprava špatné klávesnice -------------------------------------------------------------------------------- do ~/.vimrc přidat následující kód, namapuje na ,? (,< s českou klávesnicí) zavolání programu `<4e3tina.py>`__ (nebo na _- kombinaci u pravého shiftu) .. code:: " ,? prožene visual sel programem 4e3tina.py map ,? :!4e3tina.py -s^M map _- :!4e3tina.py -s^M (za -s stiskněte ctrl-v a pak Enter, zobrazí se jako ^M) .. code:: 4e3tina.py bez parametrů vypíše help, parametry ignoruje a převádí stdin na stdout -s převede stdin na stdout, překonvertuje čísla na češtinu příklad: 4e3tina => čeština