Kakoune

23 readers
7 users here now

Unofficial community for talking about the kakoune text-editor.

Official website: http://kakoune.org/

Official Forum: https://discuss.kakoune.com/

Github: https://github.com/mawww/kakoune

The Kakoune logo is designed by p0nce

founded 1 year ago
MODERATORS
1
 
 

I've just added the following to my kakrc and I love it :)

## Equals pipe
map global normal = "ya = <esc>p|"

It does the following when I hit '=' in normal-mode:

  1. It copies the currently selected string
  2. It enters insert-mode and types " = "
  3. it pastes the previously selected string
  4. it starts a pipe with the just pasted string

I use kakoune, not just for coding, but also for writing reports.

Take the string 1011 1010. If I select it and pipe it into a cli-tool that translates it into decimal, I get 186. But if I pipe it with this new '=', I get 1011 1010 = 186.

It is not life-changing, but it has definitely improved my writing flow :)

I use it mostly with this tool for translating between binary and decimal, but also with a calculator to quickly get the result of an equation and still have the equation in my document :)

2
 
 

One of the things I enjoy the most about working in Kakoune, is how seamlessly it integrate with command-line tools.

This is a list of the command-line tools I use, when writing in Kakoune. You are very much encouraged to share the tools you use, in the comment section :)

I study computer science and I use Kakoune both for writing code and for writing solutions to math-questions. These tools are what helps me in my use-cases :)

Yesterday, while writing in Haskell, I selected all of my document and piped it through "grep ::" to quickly get a list of all functions I had defined.

I also often use wc -c and wc -l to count how many characters or lines a text segment takes up. I do this by selecting the text and piping it into the respective command. This replaces all the text by the answer. I then undo, to have my text back.

A few times, I've also piped into sort, to quickly sort some lines of text.

I've also written a few small CLI tools myself, that I use on a regular basis.

A small calculator, that I use for solving trivial math problems. (It only works with integers and basic operators at the moment). I've written this myself, because it keeps the original equation when writing it's output, rather than replacing my equation with the solution

A small program for repeating a string. I use this for writing trailing zeroes or other patterns. It is very fast to highlight the text you want to repeat and pipe it into this program.

I've written many other small cli tools for specific use cases, and Kakoune just makes it so easy and fast to write and use tools.

For most purposes, you don't have to use Kakoune-script, you just write whatever program you want that operates on text and you're golden. This is the beauty of the unix philosophy :)

To conclude:

Most of the tools I use, I have written myself, but I use 'grep', 'sort' and 'wc' too.

3
 
 

I think this might be relevant for this community :)

I learned of a nice way to notate trees in raw text. It is as follows:

-a
 |
 +-aa
 | |
 | +-aaa
 | |
 | +-aab
 |
 +-ab
   |
   +-aba
   |
   +-abb

I hope this example demonstrates it fine :)

I was wondering though - Are there any good ways to notate matrices in raw text ?

Please share, if you have any notation for matrices or other nice ways to notate stuff in raw text :)

4
7
submitted 10 months ago* (last edited 10 months ago) by gramgan@lemmy.ml to c/kakoune@discuss.tchncs.de
 
 

cross-posted from: https://lemmy.ml/post/15059150

Hey friends,

I tried Kakoune for the first time recently—I definitely feel like it gets keybindings right. So I just wrapped up configuring Helix to (as far as I can tell) use those bindings (basically, it totally cuts out select mode and makes things much faster). Thought I'd share for anyone else interested.

[keys.normal]
H = "extend_char_left"
J = "extend_line_down"
K = "extend_line_up"
L = "extend_char_right"

W = "extend_next_word_start"
E = "extend_next_word_end"
B = "extend_prev_word_start"

A-j = "join_selections"

A-n = "search_prev"
N = "extend_search_next"
A-N = "extend_search_prev"

[keys.normal.g]
e = ["goto_last_line", "goto_line_end"]
G = ["select_mode", "goto_file_start", "normal_mode"]
[keys.normal.G]
H = "extend_to_line_start"
L = "extend_to_line_end"
E = ["select_mode", "goto_last_line", "goto_line_end", "normal_mode"]
[keys.normal.v]
t = "align_view_top"
b = "align_view_bottom"
v = "align_view_center"

Happy editing!

5
 
 

Very open-ended. Looking into Kakoune and just out of pure curiosity, I was wondering which plugins/setups you have and/or recommend?

6
 
 

Hello and welcome to this new community for talking about Kakoune !

I am by no means an expert on kakoune, but I love using it. I created this community, exactly because I am not an expert, and I wanted some place to learn more and talk to other people who like kakoune :))

If you want to ask a question about kakoune, share your kakrc, your favourite plugins or your workflow using kakoune - please do so here :))

If you're not (yet 😉) using kakoune, you're also welcome to participate and ask questions :))