Code Monkey home page Code Monkey logo

kitty-weechat-hints's Introduction

Python 3.9 License: GPL v3 Code style: black

Description

A kitty kitten that aims to act like the native URL hints kitten (bound to ctrl+shift+e by default), while supporting WeeChat's line wrapping for URLs. The goal is to be able to use URL hints directly without having to go into WeeChat's raw mode (bound to meta+l by default) first.

Dependencies

โ€ฆ as well as kitty and WeeChat.

Screenshots

Before: using kitty's native URL hints kitten, wrapped URLs are not detected/opened correctly.
Before

After: using this script, wrapped URLs are detected/opened correctly. After

Usage instructions

In WeeChat, weechat.look.prefix_suffix and weechat.look.separator_vertical must be set to the same value. Additionally, the WEECHAT_SEPARATOR variable in the weechat_hints.py script must be updated to reflect that value.

Download and place the script (weechat_hints.py) in the ~/.config/kitty/ directory, for example:

cd ~/.config/kitty/
wget 'https://github.com/GermainZ/kitty-weechat-hints/raw/master/weechat_hints.py'

Once that is done, kitty must be launched as such: kitty -o 'map kitty_mod+e kitten hints --customize-processing weechat_hints.py' weechat.

The shortcut can be customized, for example map f1 can be used instead to keep the original kitten intact as a backup, and make the WeeChat-aware one available by pressing the F1 key.

Notes

The script has to make certain assumptions, and may not work correctly if your WeeChat layout is vastly different or for specific messages. It should, however, provide a starting point that you can adapt.

kitty-weechat-hints's People

Contributors

germainz avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.