update helix config
This commit is contained in:
parent
fb9f7e4997
commit
458c1c54fd
3 changed files with 94 additions and 18 deletions
62
dot.config/helix/README.md
Normal file
62
dot.config/helix/README.md
Normal file
|
@ -0,0 +1,62 @@
|
|||
# Helix Configuration
|
||||
|
||||
## Language Server Setup
|
||||
|
||||
Language Servers to install to get the config to work as is:
|
||||
|
||||
### General editor features
|
||||
|
||||
"Simple" Completions, like words, emojis, kanji, etc
|
||||
|
||||
```sh
|
||||
cargo install --git https://github.com/estin/simple-completion-language-server.git
|
||||
```
|
||||
|
||||
### Web development
|
||||
|
||||
Vuejs, Typescript, Javascript, HTML, CSS
|
||||
|
||||
```sh
|
||||
# vscode-langservers-extracted includes LSs for html, css, json, markdown and eslint
|
||||
# typescript runtime should be installed globally to make the typescript and vue language servers work
|
||||
npm i -g typescript typescript-language-server vscode-langservers-extracted emmet-ls @vue/language-server
|
||||
```
|
||||
|
||||
### JSON, YAML, TOML
|
||||
|
||||
```sh
|
||||
npm i -g vscode-json-language-server # part of vscode-langservers-extracted
|
||||
npm i -g yaml-language-server
|
||||
# TOML: see https://taplo.tamasfe.dev/cli/installation/binary.html for taplo binarys
|
||||
cargo install taplo-cli --locked # or cargo install taplo-cli --locked --no-default-features --features lsp
|
||||
```
|
||||
|
||||
### Rust
|
||||
|
||||
To learn more about the Rust language, check out [rust-lang.org](https://www.rust-lang.org/). The language server for Rust I use is [rust-analyzer](https://rust-analyzer.github.io/). There was [RLS](https://github.com/rust-lang/rls) before, but it got [deprecated](https://blog.rust-lang.org/2022/07/01/RLS-deprecation.html) in favour of rust-analyzer. Check out [installation info for the binary](https://rust-analyzer.github.io/manual.html#rust-analyzer-language-server-binary) or install via [Rustup](https://rustup.rs/):
|
||||
|
||||
```sh
|
||||
rustup component add rust-analyzer
|
||||
```
|
||||
|
||||
### Zig
|
||||
|
||||
To learn more about the Zig language, check out [ziglang.org](https://ziglang.org/). The language server for Zig is called [ZLS](https://github.com/zigtools/zls).
|
||||
Make sure to always keep the version of Zig and ZLS in sync. The version at the time of writing was 0.13.0.
|
||||
|
||||
```sh
|
||||
# or check out binary release on github.com/zigtools/zls
|
||||
git clone https://github.com/zigtools/zls
|
||||
cd zls
|
||||
zig build -Doptimize=ReleaseSafe
|
||||
```
|
||||
|
||||
### V
|
||||
|
||||
V is another rather young programming language, that aims to be simple, fast and safe. Check out [vlang.io](https://vlang.io/) for more.
|
||||
[VLS](https://vpm.vlang.io/packages/vls) is the language server for V.
|
||||
|
||||
```sh
|
||||
# Since V 0.3.1 the language server can simply be installed via
|
||||
v ls --install
|
||||
```
|
|
@ -1,2 +1,2 @@
|
|||
#!/bin/sh
|
||||
npm i -g vscode-langservers-extracted typescript-language-server emmet-ls @vue/language-server yaml-language-server
|
||||
npm i -g typescript typescript-language-server vscode-langservers-extracted emmet-ls @vue/language-server yaml-language-server
|
||||
|
|
|
@ -1,13 +1,6 @@
|
|||
[[language]]
|
||||
name = "html"
|
||||
|
||||
[language.auto-pairs]
|
||||
'(' = ')'
|
||||
'{' = '}'
|
||||
'[' = ']'
|
||||
'"' = '"'
|
||||
'`' = '`'
|
||||
'<' = '>'
|
||||
[language-server.gpt]
|
||||
command = "helix-gpt"
|
||||
args = ["--stdio", "--handler codeium"]
|
||||
|
||||
[language-server.emmet-ls]
|
||||
command = "emmet-ls"
|
||||
|
@ -47,24 +40,39 @@ command = "typescript-language-server"
|
|||
args = ["--stdio"]
|
||||
config.hostInfo = "helix"
|
||||
config.plugins = [
|
||||
{ name = "@vue/typescript-plugin", location = "/home/normankoehring/.nvm/versions/node/v20.9.0/lib/node_modules/@vue/typescript-plugin", languages = ["javascript", "typescript", "vue"] }
|
||||
{ name = "@vue/typescript-plugin", location = "/home/normankoehring/.nvm/versions/node/v20.12.2/lib/node_modules/@vue/typescript-plugin", languages = ["javascript", "typescript", "vue"] }
|
||||
]
|
||||
|
||||
[language-server.vue-language-server]
|
||||
command = "vue-language-server"
|
||||
args = ["--stdio"]
|
||||
config.hostInfo = "helix"
|
||||
config.typescript = { tsdk = "/home/normankoehring/.nvm/versions/node/v20.9.0/lib/node_modules/typescript/lib" }
|
||||
config.typescript = { tsdk = "/home/normankoehring/.nvm/versions/node/v20.12.2/lib/node_modules/typescript/lib" }
|
||||
|
||||
[language-server.vls]
|
||||
command = "v"
|
||||
args = ["ls", "--stdio"]
|
||||
config.hostInfo = "helix"
|
||||
|
||||
[[language]]
|
||||
name = "html"
|
||||
[language.auto-pairs]
|
||||
'(' = ')'
|
||||
'{' = '}'
|
||||
'[' = ']'
|
||||
'"' = '"'
|
||||
'`' = '`'
|
||||
'<' = '>'
|
||||
|
||||
[[language]]
|
||||
name = "typescript"
|
||||
auto-format = true
|
||||
language-servers = [ "typescript-language-server", "eslint", "emmet-ls" ]
|
||||
language-servers = [ "typescript-language-server", "eslint", "emmet-ls", "gpt" ]
|
||||
formatter = { command = "prettier", args = [ "--parser", "typescript" ] }
|
||||
|
||||
[[language]]
|
||||
name = "javascript"
|
||||
language-servers = [ "typescript-language-server", "eslint", "emmet-ls" ]
|
||||
language-servers = [ "typescript-language-server", "eslint", "emmet-ls", "gpt" ]
|
||||
formatter = { command = "prettier", args = [ "--parser", "typescript" ] }
|
||||
auto-format = true
|
||||
|
||||
|
@ -75,13 +83,13 @@ auto-format = true
|
|||
|
||||
[[language]]
|
||||
name = "html"
|
||||
language-servers = [ "vscode-html-language-server", "emmet-ls" ]
|
||||
language-servers = [ "vscode-html-language-server", "emmet-ls", "gpt" ]
|
||||
formatter = { command = 'prettier', args = ["--parser", "html"] }
|
||||
auto-format = true
|
||||
|
||||
[[language]]
|
||||
name = "css"
|
||||
language-servers = [ "vscode-css-language-server", "emmet-ls" ]
|
||||
language-servers = [ "vscode-css-language-server", "emmet-ls", "gpt" ]
|
||||
formatter = { command = 'prettier', args = ["--parser", "css"] }
|
||||
auto-format = true
|
||||
|
||||
|
@ -91,12 +99,18 @@ auto-format = true
|
|||
scope = "source.vue"
|
||||
injection-regex = "vue"
|
||||
file-types = ["vue"]
|
||||
language-servers = [ "vue-language-server", "eslint"]
|
||||
language-servers = [ "vue-language-server", "eslint", "gpt" ]
|
||||
formatter = {command = 'prettier', args= ["--parser", "vue"]}
|
||||
roots = ["package.json", "vue.config.js", ".prettierrc.json"]
|
||||
|
||||
[[language]]
|
||||
name = "v"
|
||||
auto-format = true
|
||||
language-servers = ["vls"]
|
||||
file-types = ["v"]
|
||||
roots = ["v.mod"]
|
||||
|
||||
[[language]]
|
||||
name = "zig"
|
||||
auto-format = true
|
||||
file-types = ["zig", "c", "cpp", "h", "hpp"]
|
||||
|
|
Loading…
Reference in a new issue