Workflows That Work

What is your workflow with Kakoune (and the environment around it)?

Dunno if that counts, but here time lapse of me making generative art with CFGD and Kakoune. LF file manager + Kakoune is perfect combination for navigating and quick edits.

In the video I use my cfdg plugin to render on save, it’s pretty convenient.

1 Like

@TeddyDD that is exactly what I was looking for – also very cool!

Here’s a workflow question: lsp-diagnostics is nice, but is there a way to jump to the next/previous error like :cn :cp in Vim?

As far as I know, no. There is lint-next-error command for standard Kakoune linting mechanism. I’d open an issue on lsp repo, it would be nice to have feature.

My workflow: I’ve got a 1080p monitor, and I use the i3 window manager to divide the screen into two panes, side-by-side. If I need more than two windows open, I’ll put the panes into “rolodex” or “vertical tabs” mode, where the title-bars of all the windows in that pane are stacked vertically at the top, and the active window of that pane takes up the rest of the space. That way, it’s always easy to flip focus between the left and right panes, and fairly easy to change which windows are visible on the left and right.

If need to make changes to many files, I’ll often have them all open in separate windows in the same pane, although mawww’s find command makes switching buffers painless enough that I’ll probably do less of that in future.

In the opposite pane, I’ll usually have reference material - API docs, Stack Overflow, a bugtracker, whatever. Depending on the language I’m working with, it might also be a tools client, or just a terminal where I can hit Up and Enter to re-run my test-suite.

So far I’ve found myself putting Kakoune into the background to interact with Git, but I probably should keep doing that in a separate terminal in case somebody ever writes a GUI front-end for Kakoune.

This is a key piece of my workflow. I have on my to-do list to see if I can patch the tmux-new-* commands to run a shell “underneath” the new kakoune client, so that <c-z> still works. I looked into a bit, but it actually seems pretty hard owing to what options are available for bash.

I use an extensively configured tmux. One “window” (tab) per project, with multiple panes in it. I have a p script that starts a tmux window and Kakoune session and a few panes. It’s still awkward and often doesn’t work, so I’m not publishing that yet.

Tmux is configured with the old <c-w> commands from Vim. Which is very nice. <c-w>hjkl to move, <c-w>N enter copy mode. I’ve added <c-w><digit> to go to pane <digit>, and put the pane number in its border decorations. Here’s a screenshot of my parinfer-rust project.

I’m using tmate for remote pairing with colleagues (often with emacs), but it’s way behind tmux and so is missing a lot of my config features. I have plans this week to see if I can use my own bastion server with tmux so that I don’t need tmate.

1 Like

I have been doing this for a long time and it works wonderfully, with fast user creation/setup scripts and tear down scripts.

I’ve been hoping that I can just forward the tmux socket using ssh -L/-R, however, it doesn’t seem to work that way. :frowning:

I’m hoping to not need to maintain a dev environment in the cloud.

Do you have any links for scripts?

Here’s a workflow question: lsp-diagnostics is nice, but is there a way to jump to the next/previous error like :cn :cp in Vim?

For future reference, there currently is such a command

Following commands may help:

define-command ne -docstring 'go to next error/warning from lsp' %{ lsp-find-error --include-warnings }
define-command pe -docstring 'go to previous error/warning from lsp' %{ lsp-find-error --previous --include-warnings }
define-command ee -docstring 'go to current error/warning from lsp' %{ lsp-find-error --include-warnings; lsp-find-error --previous --include-warnings }

I used :ne somewhere in the middle in my code refactoring session.

I’ve missed move by paragraph feature of Vim, so I’ve implemented it like so:

map -docstring "move one paragraph down"        global goto 'p'     '<esc>/[^\s]<ret><a-i>p'
map -docstring "move one paragraph up"          global goto 'P'     '<esc><a-/>[^\s]<ret><a-i>p<a-;>'

However this doesn’t play nice with G(extend) movements, and it fills search register with [^\s]. Any suggestion on how to improve it?

For “move by paragraph”, do you mean Vim’s { and } movements? That should be [p and ]p in Kakoune (and {p and }p for extending).

oh, i never knew that there are [ and ] motions… Thanks a lot