Mix
Random mix of pages and files
vim
2023.06.21 04:57:18 - 2023.11.19 22:33:35 end HowTo Gilhad

how in 'vim' editor delete empty lines in visual selection?

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.

line-continuation

: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\| vim \|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

highlight Macro ctermfg=Cyan
highlight Include ctermfg=Cyan
highlight PreCondit ctermfg=Cyan

Move cursor anywhere

'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

+------------------------------------------------------------------+
| DrawIt - plugin for drawing ASCII art                            |
+------+-----------------------------------------------------------+
| From | `<https://www.vim.org/scripts/script.php?script_id=40>`__ |
+------+-----------------------------------------------------------+
in rst
DrawIt - plugin for drawing ASCII art
From https://www.vim.org/scripts/script.php?script_id=40

Zapnout \di vypnout \ds

Push order for 6809 stack:

                  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

~/.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)

" ,? 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)

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