Looking for feedback after using Helix for a week #7210
Replies: 4 comments 3 replies
-
Use the latest master with multiple language servers and these settings: [language-server.ltex-ls]
command = "ltex-ls"
[[language]]
name = "markdown"
language-servers = [ "ltex-ls", "marksman" ] Bonus! The latest ltex-ls can check git commits: [[language]]
name = "git-commit"
language-servers = [ "ltex-ls" ] For more, have a look at my dotfiles: https://github.com/David-Else/developer-workstation-setup-script/tree/main/dotfiles/helix/.config/helix (These are currently for Helix 23.05 and not the new master version with multiple language servers, so the above is not included. They will be updated in due course...) |
Beta Was this translation helpful? Give feedback.
-
You can bind the paste command to any key in insert mode: [keys.insert]
C-p = "paste_clipboard_before"
Helix can sort, too. Except it's sorting arbitrary selections, not just lines.
Not a solution but more workarounds: You can select the paragraph ( Alternatively, you can set the |
Beta Was this translation helpful? Give feedback.
-
Is there any solution to this? |
Beta Was this translation helpful? Give feedback.
-
This was addressed recently with some new commands to make this easier: |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I've been using Helix for a little over a week while taking notes on things I
wanted / couldn't couldn't figure out. I've come up with some answers and
workarounds, which I've included here here in the hope that it will be
search-engine friendly. The remainder are open questions with which I'm hoping
to get some guidance. I'm also keen to hear if you find a better way to do something
that I already have an answer for.
My context is coming from VS Code with Vim keybindings. I was convinced to try
Helix after reading https://phaazon.net/blog/editors-in-2022:
Now I'm hooked on the editing style. If I go back to VS Code, I'll be
looking for a Helix-style extension to replace my Vim one.
General
Select all matches for a search pattern using a single keystroke
e.g. in normal mode, type
/hello
thenEnter
. The first occurrence isselected. How to select all occurrences?
Answer: use
%s
instead of/
.%
selects the entire document, ands
willhighlight all occurrences of the search term.
Paste from system clipboard while in insert mode
Related: Yank to system clipboard #76
I can't use
Ctrl-R
like in Vim because there's no register for the systemclipboard.
Workaround: use terminal's "paste from system clipboard" command. In my case,
Alacritty:
Ctrl-Shift-V
.Alternative (thanks to @CptPotato - comment): bind the paste command to a specific key in insert mode, e.g.
keys.insert.C-p = "paste_clipboard_before"
.Create file by opening non-existent file in picker
The file picker only opens files that exist. If I type a non-existent file
name, I'd like an option to create and open said file.
Workaround: use
:open
instead of file picker.Interactively select lines, starting from the bottom
In Vim, I do
V
then a number ofk
s.Current answer:
v
then a number ofk
s thenX
to make the selection"whole-line".
Paste a line below the current one
Yp
in VimCurrent answer:
xyP
Move cursor to the end of the selection
Suppose I've selected a range right-to-left by pressing
vbbbbb
, and Irealise that I need to grow the selection to the right a little more. My
instinct is to somehow get the cursor to the rightmost character in the
selection and start pressing
e
.Answer:
Alt-;
Create missing parent directories when saving a file
Answer:
write!
(introduced in 22.05)Go to the next diagnostic in workspace
There's an open PR for this: Jump to next/prev diagnostic in workspace (#3116) #4201
I expected
]d
to do this and was surprised to find that it only navigateswithin a file.
Workaround: use workspace diagnostic picker (
Space
thenG
)Display errors near cursor rather than in the top right corner
Related: Inline Diagnostics #6417
In VS Code, when I jump to the next error the error is rendered on the line
below the cursor. The error
lens
puts many errors inline with the code, too. I like that I don't have to move
my eyes to read the errors.
Set a global default for
:indent-style
By default I want my tab key to insert 4 spaces. This should be overridden by
language-specific settings.
Custom tab width
Related: Tab customization and retab #2576
I like tab characters to be rendered as 8 spaces so that it's easy to see when
I inserted a tab character instead of a space.
Render whitespace with visible characters inside selection
I sometimes like to render whitespace with visible characters but I find
editor.whitespace.render = "all"
too noisy. Having this behaviour within aselection is a good middle ground.
Include hidden files / directories in file picker
Answer:
editor.file-picker.hidden = true
Sort the selected lines
In Vim it's
:sort
.Answer (thanks to @CptPotato - comment): split selection by lines (
Alt-s
), sort (:sort
).Alternative:
|
,sort
,Enter
. Uses the system'ssort
program (cool!)Language-specific
Markdown
Open a link in my browser
Ideally the language server would provide a code action for this.
marksman
doesn't.Workaround: select URL (usually
mi(
ormi<
),Alt-|
,xargs xdg-open
,Enter
Wrap lines in a syntax-aware manner (ideally as I type)
:reflow
ing a single bullet doesn't indent the new lines. Doing it to a wholedocument does whacky things.
I suspect this is something that the language server should do.
Blockquote a paragraph
Again, seems like the language server should provide a code action for this.
Workaround (thanks to @CptPotato - comment): select paragraph (
mip
), split selection by line (Alt-s
), insert blockquote character on each line (i>
).Spell checking
ltex-ls
is a language server forspell checking. It only handles spell checking, so how do I make it work with
a second language server like
marksman
that has Markdown-specific codeactions?
Answer (thanks to @David-Else - comment): Helix's main branch lets you set up multiple language servers for a single language.
Rust
Bring up autocomplete dialog after
::
and.
e.g.
TypeName::
orsome_struct_value.
Use
rust-analyzer
's postfixcompletions
like
expr.if
andexpr.match
Answer: known missing feature, see
rust-analyzer magic completions not working in helix #4831 and
snippet support #395.
Code actions like "Import `Name`" and "Fill match arms"
For a while these didn't work for me. But now they do.
Answer: works on >22.08 (?)
Beta Was this translation helpful? Give feedback.
All reactions