update helix config for web development

This commit is contained in:
Norman Köhring 2024-05-15 11:49:47 +02:00
parent c6a246a73b
commit fb9f7e4997
3 changed files with 87 additions and 32 deletions

View file

@ -1,12 +1,13 @@
theme = "heisenberg2" theme = "everforest_dark"
[editor] [editor]
line-number = "absolute"
bufferline = "multiple"
text-width = 120
cursorline = true cursorline = true
mouse = true bufferline = "multiple"
rulers = [120]
[editor.statusline]
left = ["mode", "file-name", "spinner"]
center = ["diagnostics"]
right = ["selections", "primary-selection-length", "file-type", "file-encoding", "position-percentage", "position"]
[editor.cursor-shape] [editor.cursor-shape]
insert = "bar" insert = "bar"
@ -25,8 +26,8 @@ render = "all"
space = "·" space = "·"
nbsp = "⍽" nbsp = "⍽"
tab = "→" tab = "→"
tabpad = "·" # Tabs will look like "→···" (depending on tab width)
newline = "¬" #"⏎" newline = "¬" #"⏎"
tabpad = "·" # Tabs will look like "→···" (depending on tab width)
[editor.lsp] [editor.lsp]
enable = true enable = true
@ -43,29 +44,12 @@ max-indent-retain = 40
wrap-indicator = "↪" wrap-indicator = "↪"
wrap-at-text-width = false wrap-at-text-width = false
[editor.file-picker]
hidden = false
[editor.statusline]
left = ["mode", "spinner", "version-control", "file-name", "file-type", "file-encoding"]
center = ["diagnostics"]
right = ["selections", "primary-selection-length", "position-percentage", "position"]
[keys.normal] [keys.normal]
"A-," = "goto_previous_buffer" X = "extend_line_above"
"A-." = "goto_next_buffer"
"A-w" = ":buffer-close"
"A-/" = "repeat_last_motion"
A-x = "extend_to_line_bounds"
X = ["extend_line_up", "extend_to_line_bounds"]
D = "delete_char_backward" D = "delete_char_backward"
q = "move_prev_word_start" q = "move_prev_word_start"
Q = "move_prev_long_word_start" Q = "move_prev_long_word_start"
[keys.select] [keys.select]
A-x = "extend_to_line_bounds"
X = ["extend_line_up", "extend_to_line_bounds"]
q = "extend_prev_word_start" q = "extend_prev_word_start"
Q = "extend_prev_long_word_start" Q = "extend_prev_long_word_start"

View file

@ -0,0 +1,2 @@
#!/bin/sh
npm i -g vscode-langservers-extracted typescript-language-server emmet-ls @vue/language-server yaml-language-server

View file

@ -9,22 +9,91 @@ name = "html"
'`' = '`' '`' = '`'
'<' = '>' '<' = '>'
[language-server.efm] [language-server.emmet-ls]
command = "efm-langserver" command = "emmet-ls"
config.documentFormatting = true args = ["--stdio"]
[language-server.eslint]
command = "vscode-eslint-language-server"
args = ["--stdio"]
[language-server.eslint.config]
codeActionsOnSave = { mode = "all", "source.fixAll.eslint" = true }
format = { enable = true }
nodePath = ""
quiet = false
rulesCustomizations = []
run = "onType"
validate = "on"
experimental = {}
problems = { shortenToSingleLine = false }
[language-server.eslint.config.codeAction]
disableRuleComment = { enable = true, location = "separateLine" }
showDocumentation = { enable = false }
[language-server.vscode-json-language-server.config]
json = { validate = { enable = true }, format = { enable = true } }
provideFormatter = true
[language-server.vscode-css-language-server.config]
css = { validate = { enable = true } }
scss = { validate = { enable = true } }
less = { validate = { enable = true } }
provideFormatter = true
[language-server.typescript-language-server] [language-server.typescript-language-server]
command = "typescript-language-server" command = "typescript-language-server"
args = ["--stdio"] args = ["--stdio"]
config.hostInfo = "helix" 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"] }
]
[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" }
[[language]] [[language]]
name = "typescript" name = "typescript"
auto-format = true auto-format = true
language-servers = [ language-servers = [ "typescript-language-server", "eslint", "emmet-ls" ]
{ name = "efm", only-features = ["format", "diagnostics"] }, formatter = { command = "prettier", args = [ "--parser", "typescript" ] }
{ name = "typescript-language-server", except-features = ["format", "diagnostics"] },
] [[language]]
name = "javascript"
language-servers = [ "typescript-language-server", "eslint", "emmet-ls" ]
formatter = { command = "prettier", args = [ "--parser", "typescript" ] }
auto-format = true
[[language]]
name = "json"
formatter = { command = "prettier", args = [ "--parser", "json" ] }
auto-format = true
[[language]]
name = "html"
language-servers = [ "vscode-html-language-server", "emmet-ls" ]
formatter = { command = 'prettier', args = ["--parser", "html"] }
auto-format = true
[[language]]
name = "css"
language-servers = [ "vscode-css-language-server", "emmet-ls" ]
formatter = { command = 'prettier', args = ["--parser", "css"] }
auto-format = true
[[language]]
name = "vue"
auto-format = true
scope = "source.vue"
injection-regex = "vue"
file-types = ["vue"]
language-servers = [ "vue-language-server", "eslint"]
formatter = {command = 'prettier', args= ["--parser", "vue"]}
roots = ["package.json", "vue.config.js", ".prettierrc.json"]
[[language]] [[language]]
name = "v" name = "v"