org-lsp

Keys in Helix

Helix has no plugins, so org-lsp sets no keys there, and Helix cannot run a server's command from a key and tell it where the cursor is. What Helix does have is the code action menu, and the server offers its commands there: in Org files, in the agenda and in capture buffers. helix.org says how to set Helix up.

The code actions#

Press Space a (code_action) in an Org file to see the changes that apply at the cursor:

ActionWhat it does
org.todo.nextCycle TODO state forward (→ the state it goes to)
org.todo.previousCycle TODO state backward (→ the state it goes to)
org.priority.upRaise the priority
org.priority.downLower the priority
org.timestamp.upIncrease the part of the timestamp at the cursor
org.timestamp.downDecrease the part of the timestamp at the cursor
org.date.laterMove the date one day later
org.date.earlierMove the date one day earlier
org.clock.inClock in on the entry (a clock that runs elsewhere stops)
org.clock.outClock out, while a clock runs
org.clock.cancelCancel the clock, while one runs
org.checkbox.toggleToggle the checkbox
org.table.recalculateRecalculate the table

More where they apply: on a headline, a list item or a table, in a code block, and in an entry:

ActionWhat it does
org.meta.leftPromote the heading; outdent the item; move the table column left
org.meta.rightDemote the heading; indent the item, the drawer or the block; move the table column right
org.shiftmeta.leftPromote the subtree; outdent the item with its children; delete the table column
org.shiftmeta.rightDemote the subtree; indent the item with its children; insert a table column
org.meta.upMove the subtree, the item or the table row up
org.meta.downMove the subtree, the item or the table row down
org.shiftmeta.upDelete the table row
org.shiftmeta.downInsert a table row above
org.table.insert.row.belowInsert a table row below
org.table.hlineInsert a rule below the table row
org.table.hline.aboveInsert a rule above the table row
org.table.blank.fieldBlank the table field
org.table.toggle.column.widthShrink or expand the table column
org.babel.tangleTangle the file's code blocks (in a code block)
org.babel.executeEvaluate the code block through Emacs
org.edit.specialEdit the block in a file of its own
org.archive.subtreeArchive the subtree
org.archive.siblingArchive the subtree under its Archive sibling
org.archive.tagToggle the ARCHIVE tag

An unknown citation key also offers the keys close to it (Replace with @key).

The menu shows only those that would change something. Helix has no status line for the clock; org-lsp agenda --log in a terminal shows what was clocked.

What asks for something#

With show_document and message_requests set as helix.org says, more commands are code actions in an Org file, those that ask for something or open a document:

ActionWhat it does
org.todoChange the TODO state, picked from a list
org.prioritySet the priority, picked from a list
org.scheduleSchedule the entry: the date is typed
org.deadlineSet the deadline of the entry: the date is typed
org.tags.setSet the tags of the headline: they are typed
org.property.setSet a property of the entry: it and its value typed
org.effort.setSet the effort of the entry: it is typed
org.refileRefile the entry, the target picked from a list
org.sortSort the entries, the items or the table rows
org.clock.reportInsert or update a clock table
org.clock.gotoGo to the clocked entry, while a clock runs
org.clock.in.lastClock in the last clocked task
org.meta.returnA new heading, item or table row
org.insert.todo.headingA new TODO heading, or item with a checkbox
org.insert.heading.afterA new heading after the subtree
org.cut.subtreeCut the subtree (and org.copy.subtree, paste)
org.agenda.listThe agenda for the current week or day
org.agenda.todosThe list of all TODO entries
org.agenda.dispatchAgenda commands: the agenda menu, its views picked
org.captureCapture, the template picked from a list

What is picked from a list comes first in the code actions once the command has asked: Space a again, and the choices head the menu, each with its key in brackets (Agenda for the current week or day [a], Task [t]). What is typed is a rename at the cursor: Space r, the answer as the new name, Enter. The server says which it waits for in the status line (Schedule: answer with a rename at the cursor).

In the agenda#

The agenda is a file, Agenda.org, and every command its keys have in Emacs is a code action there: on an entry's line the entry's first, then the view's.

On an entry's lineThe view
Agenda: go to the entry (also gd)Agenda: go forward in time, backward
Change the TODO state, the priorityAgenda: go to today, go to a date
Schedule the entry, the deadlineAgenda: day view, week, fortnight, month
Set the tags of the headlineAgenda: rebuild
Clock in, Clock outAgenda: filter by …, remove all filters
Refile the entry, Archive the subtreeAgenda: log mode, the clock report
Add a note to the entryAgenda: mark all entries, a bulk action
Agenda: mark the entry for a bulk actionAgenda: write it to a file
Store a link to the place at the cursorAgenda commands

Follow mode, going to the entry in another window and column view are not among them: they need to know where the cursor goes, or draw over the lines. Space k on a line shows its entry. The buffer picker (Space b) goes back to the agenda where its cursor was. The server's edits leave the buffer changed: :buffer-close! closes it. Saving the files the agenda's commands changed is Helix's own :write-all: Save all Org files is not offered, as the server cannot save a file and Helix does nothing with the files a server names to save.

In a capture buffer#

ActionWhat it does
org.capture.finishCapture: finish, filing the entry
org.capture.abortCapture: abort, leaving the target
org.capture.refileCapture: refile the entry, to a target

The buffer stays open once the entry is filed: Helix closes no buffer for a server, which shows where capture started instead.

Changing the key#

The menu is Helix's own code_action command, so its key is set in Helix's config.toml like any other:

[keys.normal]
"C-." = "code_action"

[keys.normal.space]
o = "code_action"

Helix cannot bind a key to one particular action.