From 92b481038d1a62e7ccd4223937239772de91b509 Mon Sep 17 00:00:00 2001 From: Jeremy Kaplan Date: Sat, 17 Oct 2026 20:04:53 -0400 Subject: [PATCH] helix: Add snippets --- helix/languages.toml | 4 ++++ helix/snippets/go.toml | 8 ++++++++ helix/snippets/javascript.toml | 14 ++++++++++++++ helix/snippets/zig.toml | 22 ++++++++++++++++++++++ 4 files changed, 48 insertions(+) create mode 100644 helix/snippets/go.toml create mode 100644 helix/snippets/javascript.toml create mode 100644 helix/snippets/zig.toml diff --git a/helix/languages.toml b/helix/languages.toml index 09cb273..b78e100 100644 --- a/helix/languages.toml +++ b/helix/languages.toml @@ -2,6 +2,7 @@ name = "go" auto-format = true formatter = { command = "goimports" } +language-servers = [ "scls", "gopls", "golangci-lint-lsp" ] [language-server.gopls.config.hints] assignVariableTypes = false @@ -31,3 +32,6 @@ refresh = "onSave" [[language]] name = "python" auto-format = true + +[language-server.scls] +command = "simple-completion-language-server" diff --git a/helix/snippets/go.toml b/helix/snippets/go.toml new file mode 100644 index 0000000..45fcffa --- /dev/null +++ b/helix/snippets/go.toml @@ -0,0 +1,8 @@ +[[snippets]] +prefix = 'trun' +description = 't.Run(string, func(t *testing.T))' +body = ''' +t.Run("$1", func(t *testing.T) { + ${0:t.Fatal("TODO")} +}) +''' diff --git a/helix/snippets/javascript.toml b/helix/snippets/javascript.toml new file mode 100644 index 0000000..82e8a6b --- /dev/null +++ b/helix/snippets/javascript.toml @@ -0,0 +1,14 @@ +[[snippets]] +prefix = 'clog' +description = 'console.log(...)' +body = 'console.log($0)' + +[[snippets]] +prefix = 'cdeb' +description = 'console.debug(...)' +body = 'console.debug($0)' + +[[snippets]] +prefix = 'cerr' +description = 'console.error(...)' +body = 'console.error($0)' diff --git a/helix/snippets/zig.toml b/helix/snippets/zig.toml new file mode 100644 index 0000000..322a167 --- /dev/null +++ b/helix/snippets/zig.toml @@ -0,0 +1,22 @@ +[[snippets]] +prefix = 'Struct' +description = 'Struct declaration' +body = ''' +const $1 = struct { + ${0} +}; +''' + +[[snippets]] +prefix = 'Enum' +description = 'Enum declaration' +body = ''' +const $1 = union(enum) { + ${0} +}; +''' + +[[snippets]] +prefix = 'dbg' +description = 'Debug print' +body = 'std.debug.print("$1\n", .{ $0 });'