28 lines
989 B
Rust
28 lines
989 B
Rust
//! Shared editor-integration help for the formatter and LSP adapters.
|
|
|
|
pub const EDITOR_SETUP: &str = r#"EDITOR SETUP (formatter and heuristic LSP available):
|
|
Helix ~/.config/helix/languages.toml:
|
|
[language-server.john-slop]
|
|
command = "john-slop-lsp"
|
|
|
|
[[language]]
|
|
name = "john-slop-text"
|
|
language-id = "plaintext"
|
|
scope = "text.john-slop"
|
|
file-types = ["txt"]
|
|
formatter = { command = "john-slop-fmt" }
|
|
language-servers = ["john-slop"]
|
|
|
|
Vim ~/.vimrc formatter (use gggqG for the whole buffer):
|
|
autocmd BufRead,BufNewFile *.txt setfiletype text
|
|
autocmd FileType text,markdown,rust setlocal formatprg=john-slop-fmt
|
|
|
|
Vim ~/.vimrc LSP (requires prabirshrestha/vim-lsp):
|
|
au User lsp_setup call lsp#register_server({
|
|
\ 'name': 'john-slop',
|
|
\ 'cmd': {server_info->['john-slop-lsp']},
|
|
\ 'allowlist': ['text', 'markdown', 'rust'],
|
|
\ })
|
|
|
|
See docs/editors.md for installation, existing-language setup, and validation."#;
|