Hey all,
So, to cut to the chase:
-
Lint and Format only on save always
I don’t really know how linting in Kakoune works, but my first assumption is that once linting is enabled in a buffer, it’s always on.
I personally don’t want that. However, I since I don’t really know, I don’t know if this configuration is redundant or not.define-command disable-lint -docstring "disable linting" %{ lint-disabled unset-option buffer lintcmd remove-hooks buffer lint } hook global BufWritePost filetype=(sh|fish|nim) %{ # Only lint on write (save) lint-enabled lint lint-disabled } hook global BufSetOption filetype=sh %{ disable-lint set-option buffer lintcmd 'shellcheck --color=auto --format=gcc --norc' } hook global BufSetOption filetype=fish %{ disable-lint set-option buffer lintcmd 'fish -n' } hook global BufSetOption filetype=nim %{ disable-lint set-option buffer lintcmd 'nim check' }
And the same would go for formatting, but I haven’t set that up yet.
-
Tab completion
I’m sure a lot of us have this snippet in our configs somewhere
hook global InsertCompletionShow .* %{ try %{ map window insert <tab> <c-n> map window insert <s-tab> <c-p> } } hook global InsertCompletionHide .* %{ unmap window insert <tab> <c-n> unmap window insert <s-tab> <c-p> }
And this works fine, mostly. One weird thing (well I’m sure it’s not actually once someone explains it), is that
<tab>
sometimes won’t do anything. It won’t indent the line when first entering insert mode and pressing it, but it will after you’ve entered in a letter and then gotten ride of that letter. So you pressi
, then you press saya
, then you backspace thata
, and now<tab>
will indent the line.I don’t know if there’s a better solution.
-
More completion! MORE
The base completing is good, but I wish we had
- Tag base completion
- Spelling(?) completion
- Some sorta omnicompletion (though I don’t fully know exactly what omnicompletion is)
In Vim, you can have
set complete+=t,k,kspell set omnifunc=syntaxcomplete#Complete
And you get some extra completions that are useful. I don’t think there’s a way to get this in Kakoune, but a lot of you know more about the internals of Kakoune than I.
EDIT: Oh! If an LSP does linting, how does Kakoune and kak-lsp
handle that? And do I need to do anything specific?