https://github.com/gryf/weechat-replacer
Weechat plugin for replacing user defined keywords with specified text.
https://github.com/gryf/weechat-replacer
plugin python replace-text weechat
Last synced: 2 months ago
JSON representation
Weechat plugin for replacing user defined keywords with specified text.
- Host: GitHub
- URL: https://github.com/gryf/weechat-replacer
- Owner: gryf
- License: apache-2.0
- Created: 2016-07-30T17:19:01.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2025-01-29T17:23:12.000Z (3 months ago)
- Last Synced: 2025-01-29T18:27:32.269Z (3 months ago)
- Topics: plugin, python, replace-text, weechat
- Language: Python
- Size: 18.6 KB
- Stars: 2
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
weechat-replacer
================WeeChat plugin for replacing user defined keywords with specified text.
Installation and configuration
------------------------------In order to use it, you have to have WeeChat with Python plugin support
compiled in. Than, copy ``replacer.py`` to ``~/.local/share/weechat/python/``.
It should run on any version of the Python3.You can optionally create symbolic link to this script:
.. code:: shell-session
ln -s ~/.local/share/weechat/python/replacer.py ~/.local/share/weechat/python/autoload/replacer.py
Next, you need to add this *replacer_plugin* to Weechat completion template, so
it'll looks similar to:.. code::
/set weechat.completion.default_template "%(nicks)|%(irc_channels)|%(replacer_plugin)"
Next, load the plugin (if you choose to not load it automatically):
.. code::
/python load replacer.py
Now you all set.
Note, that even though there is possibility for keeping all files in different
place than XDG paths, this case is not tested anymore, and all the issues
regarding old files placement will be ignored.Usage
-----Abbreviations will be stored as json file
``$XDG_DATA_HOME/weechat/replacement_map.json``, which usually be
``~/.local/share/weechat/replacement_map.json`` which role is to simply persist
dictionary object on the filesystem. To add some replacement words, and text
which would those words replaced with:.. code::
/replacer add foo bar
and than, when you type ``foo`` word and press ``tab`` key, you should get
``bar`` word instead.License
-------This plugin is on Apache 2 license. See LICENSE for details.