ORCUS Logo
Datenschutz Impressum Kontakt
Referenzen News Externe Links
email

externer Anbieter: translate.google.com

Datenschutz-Hinweis: Durch Auswahl von "OK":

OK

externer Anbieter: validator.w3.org

Datenschutz-Hinweis: Durch Auswahl von "OK":

OK

externer Anbieter: validator.w3.jigsaw.w3.org

Datenschutz-Hinweis: Durch Auswahl von "OK":

OK
prev. page next page / HOME / IRC - LM support / ot-snippet - simple IRC-helper /[custom file - create, manual export]

Custom file

Although one could edit ot-snippet-002.sh to customized snippets, its prefered to export current definitions to a custom file and edit snippets there. A custom file contains only snippet definitions and optional additional/private variable definitions (helpers for repeated patterns).

You are in no way forced to use any premade snippets, just empty the custom file and add your own snippets as needed.

On startup ot-snippet checks if there exists a ot-snippet*.txt custom file and loads it.

The snippet definitions of the custom file replace the internal snippet definitions (which are simply not defined in that case); this avoids having to touch ot-snippet itself to deactivate/comment or delete snippet definitions there.

Create a custom file

Use the ot-snippet --new-custom option to create an initial custom file. The custom file will contain an excerpt of all active snippet definitions. It will be named like the name/symbolic-link being used to run ot-snippet and saved at the same location; see symbolic links - custom file for details.

Assuming a default setup for ot-snippet-002.sh - according custom files are named like:

src usedcustom filemode
~/bin/ot-snippet-strm ~/bin/ot-snippet-strm.txtstream
~/bin/ot-snippet-para ~/bin/ot-snippet-para.txtparam
~/bin/ot-snippet-002.sh ~/bin/ot-snippet-002.txtparam

To create a custom file for the stream mode variant you just run:


ot-snippet-strm --new-custom
        
ot-snippet V. 002#199 2022-01-25
custom = /home/demo/bin/ot-snippet-strm.txt
created new custom-file



press Shift+PgUp to scroll back
press RETURN to close window

Custom file and updates

If you are already using a custom file, you just have to rename it, to match expected V002 custom file names - see above: create custom file - table

As the --new-custom option is available since ot-snippet V001#066 and the supported snippet format is identical, you can keep your previous edits with ot-snippet V002 :


ot-snippet.sh --new-custom
        
ot-snippet V. 001#66 2019-12-05
custom = /home/demo/bin/ot-snippet.txt
created new custom-file



press Shift+PgUp to scroll back
press RETURN to close window

... to export your V001 edits and rename the created V001 custom-file to match with ot-snippet V002 expected custom file names (see above).


mv ~/bin/ot-snippet.txt ~/bin/ot-snippet-strm.txt
        

Manual export

If you are using an older ot-snippet version (not supporting the export feature), or the export feature isn't working for any reason, one can extract snippet definitions manually.

There are two comments defined within ot-snippet.sh (V001) and ot-snippet-002.sh (V002) to mark the begin and end of the relevant custom section:

# ==========================================
# for a custom snippet-file >>>>>>>>>>>>>>>>
# START COPY HERE
# END COPY HERE
# for a custom snippet-file <<<<<<<<<<<<<<<<

A custom file should only contain text from within this section.

To stick with your own snippets entirely, you just create an empty text file, matching the expected naming convention and add snippets; see: create custom file - table

Don'ts - warning

Do not try to just rename V001 ot-snippet.sh and use it instead of a custom file. You are breaking V002 functionality this way.

Background: the custom file is sourced by ot-snippet to make snippet keys (variables), internal snippet variables and snippet helper functions accessible; as an unwanted side effect this reads (old) V001 internal function definitions too, thus replacing/breaking V002 functionality.


prev. page next page / HOME / IRC - LM support / ot-snippet - simple IRC-helper /[custom file - create, manual export]