(rhombus is https://github.com/racket/rhombus/; lang docs at https://docs.racket-lang.org/rhombus/index.html)
@benknoble had the following suggestions on discord:
- create a new
ftplugin/rhombus.vim that tweaks :setlocal commentstring and b:undo_ftplugin. vim also suggests setting b:undo_indent; see :h ftplugin.
- add
.rhm to
|
au BufRead,BufNewFile *.rkt,*.rktl,*.zuo call RacketDetectHashLang() |
- document how to set up an LSP for Rhombus. i see ALE support for racket in
|
let b:ale_linter_aliases = ['racket'] |
and
|
let b:ale_linter_aliases = ['racket'] |
for neovim + lspconfig i have this configuration for myself; maybe it will help someone:
local lsplang = require('lspconfig.configs')
if not lsplang.rhombus then
lsplang.rhombus = {
default_config = {
cmd = {"racket", "-l", "racket-langserver"},
filetypes = { "rhombus" },
root_dir = vim.fs.dirname,
settings = {},
},
}
end
lspconfig.rhombus.setup {}
Note that there are some limitations to this setup.
- syntax highlighting is only enabled through the LSP, and the LSP has some bugs (in particular it doesn't do
SematicTokens for keywords). that should probably be an upstream bug.
- autoindentation isn't automatic. we could fix that with some manual work in
rhombus.vim. i think the recommended way is indent-expression?
(rhombus is https://github.com/racket/rhombus/; lang docs at https://docs.racket-lang.org/rhombus/index.html)
@benknoble had the following suggestions on discord:
ftplugin/rhombus.vimthat tweaks:setlocal commentstringandb:undo_ftplugin. vim also suggests settingb:undo_indent; see:h ftplugin..rhmtovim-racket/ftdetect/racket.vim
Line 66 in 0ca759e
vim-racket/ftplugin/jsond.vim
Line 21 in 0ca759e
vim-racket/ftplugin/racket-info.vim
Line 73 in 0ca759e
Note that there are some limitations to this setup.
SematicTokensfor keywords). that should probably be an upstream bug.rhombus.vim. i think the recommended way is indent-expression?