No project description provided
Project description
Zach's Overengineered Kakoune Plugins
They say that for any given job, if Python isn't the best tool for the job, then it's the second-best tool for the job.
Kakoune has a lot of amazing plugins and user-modes, and they're usually not written in Python.
So, since I must be working with the second-best tool for the job, I thought I would go the whole 9 yards and overengineer the h*ck out of it 😉. In true abstractlyZach fashion, this project includes:
- reimplementations of awesome scripts that could be one-liners in
bash
with, like, 5 pipes - dependency injection
- readability as a priority
- composition over inheritance
- rigorous testing
- helpful command-line menus
- milliseconds of extra run-time! Python is an interpreted language!
- intense CI practices
- linting and autoformatting
- lots of documentation
- minimal use of Mocks, maximal use of better test doubles like Fakes and Stubs
- robust error-handling
- fine-grained logging options
Also, I was pretty excited about kakoune.cr, but I was super fuzzy on how to actually use it. Hopefully these plugins will serve as living documentation on some good ways to leverage this tool.
Installation
as a user
I recommend using pipx for installation. It allows you to install python packages on your machine in separate virtual environments without having to manage the virtual environments yourself. pip
also works if you prefer that.
pipx install kak-plugins
as a developer
We use poetry to do package and dependency management. For bonus points, install it using pipx
instead of their recommended method.
pipx install poetry
git clone https://github.com/abstractlyZach/kak_plugins.git
cd kak_plugins
poetry install
Dependencies
- Kakoune, of course 😄
- kakoune.cr
- enables us to retrieve info from Kakoune
- provides an interface to control Kakoune
- A clipboard command-line utility. I use these:
pbcopy
for OSX- xclip for Linux
- wl-clipboard for Wayland (if you don't know what this is and you use Linux, you'll probably use
xclip
)
Setup
There are some environment varibles you will need to define in order to use these plugins. You would probably define these in your ~/.bashrc
, zshrc
, or ~/.profile
. I define mine here
# program that reads stdin and writes to your system clipboard
export CLIPBOARD="pbcopy"
Plugins
github-permalink
Create a permalink to a file on GitHub with lines pre-selected. Example. The selected line or range of lines matches your current selection in Kakoune and will be copied to your clipboard program.
github-permalink --help
in kak
This method is great for using in your everyday editing
- open a file in Kakoune
- make a selection
- in normal mode, use
:$ github-permalink
- you now have a permalink to your kakoune selection. it should look something like this https://github.com/abstractlyZach/kak_plugins/blob/write-readme/README.md#L40
I like binding this command to hotkeys so I can hit 2 buttons and then paste the link into Slack or something.
in a terminal
This method is great for learning, development, and debugging
- open a file in kakoune
- make a selection
- open a connected terminal. there are a couple of recommended methods
- use
:>
in normal mode - kcr-fzf-shell
- use
github-permalink --help
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file kak_plugins-0.5.1.tar.gz
.
File metadata
- Download URL: kak_plugins-0.5.1.tar.gz
- Upload date:
- Size: 9.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.4 CPython/3.9.4 Linux/5.4.0-1046-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2a8b660d82c8b68b6bd8245ec5b94204faaecfc02ea4a83221ab60f1a8eae434 |
|
MD5 | befe134af52a2dc5807755a5f716b2f8 |
|
BLAKE2b-256 | 405b52f9c99f8aaf2e1d225ab0dbd9ce10fc5239da00aa08f7e1e7ebbda3f236 |
File details
Details for the file kak_plugins-0.5.1-py3-none-any.whl
.
File metadata
- Download URL: kak_plugins-0.5.1-py3-none-any.whl
- Upload date:
- Size: 8.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.4 CPython/3.9.4 Linux/5.4.0-1046-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5ab1512d2f25077d4931b356a456616d1adf380d86d4eb817a0ce9dc15964c47 |
|
MD5 | 5cdf15c58ee33fa7721d15f4558efc9c |
|
BLAKE2b-256 | 67b257c447cd68a7d8d8942f73f86ce749abe666efeb1035c6096c72b31cbef7 |