diff --git a/bin/carg b/bin/carg new file mode 100755 index 0000000..a63958f --- /dev/null +++ b/bin/carg @@ -0,0 +1,16 @@ +#!/usr/bin/env bash + +# This program should be installed as `carg`. It fixes typos like +# +# carg oc -> cargo c +# carg obuild -> cargo build +# +# It unconditionally removes one leading `o` from its first argument and then +# runs the corrected `cargo` subcommand with the rest of the arguments. + +set -euo pipefail + +sub="$1"; shift; +sub="${sub#o}" + +exec cargo "$sub" "$@" diff --git a/bin/emoji b/bin/emoji new file mode 100755 index 0000000..5c7e3d7 --- /dev/null +++ b/bin/emoji @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +set -euo pipefail + +exec rofi -modes emoji -show emoji -emoji-mode copy diff --git a/bin/godoc b/bin/godoc new file mode 100755 index 0000000..1f22087 --- /dev/null +++ b/bin/godoc @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +set -euo pipefail + +go doc "$@" | bat diff --git a/bin/watch-test b/bin/watch-test index d332511..c479a3e 100755 --- a/bin/watch-test +++ b/bin/watch-test @@ -14,6 +14,6 @@ echo 'Press Space or edit a file to run tests' # I specifically want the command to expand here. # # shellcheck disable=SC2068 -until fd . "${dir}" | entr -cdp ${cmd[@]}; do +until fd . "${dir}" | entr -cdpr ${cmd[@]}; do echo 'Press Space or edit a file to re-run tests' done diff --git a/etc/ignore b/etc/ignore index 5cdfd76..2cd34b0 100644 --- a/etc/ignore +++ b/etc/ignore @@ -6,3 +6,4 @@ !.env !.envrc !mise.toml +!.helix diff --git a/ghostty/config.ghostty b/ghostty/config.ghostty index 0490443..95f1de0 100644 --- a/ghostty/config.ghostty +++ b/ghostty/config.ghostty @@ -1,5 +1,6 @@ font-family = Input Mono Narrow -font-style-bold-italic = BoldIta +font-style = Light + font-size = 10 theme = light:jdkaplan-light,dark:jdkaplan-dark diff --git a/git/config b/git/config index 24d9da4..2b33e39 100644 --- a/git/config +++ b/git/config @@ -95,7 +95,7 @@ dw = diff --word-diff dww = diff --word-diff --word-diff-regex=. f = fetch fb = fetch-branch -fixup = commit --amend --no-edit +fixup = commit --amend --no-edit --allow-empty-message fp = fetch --prune lag = log --graph --decorate --pretty='%C(auto)%h%d %s | %C(cyan)%an%C(reset) %C(green)<%ar>%C(reset)' lcg = log --graph --decorate --pretty='%C(auto)%h%d %s | %C(cyan)%cn%C(reset) %C(green)<%cr>%C(reset)' diff --git a/git/gitignore b/git/gitignore index fe80454..930f3d4 100644 --- a/git/gitignore +++ b/git/gitignore @@ -19,6 +19,7 @@ mise.toml .vimrc .editorconfig +.helix/ /tags /tags.lock diff --git a/helix/config.toml b/helix/config.toml index e9f573a..45756be 100644 --- a/helix/config.toml +++ b/helix/config.toml @@ -5,12 +5,16 @@ scrolloff = 1 cursorline = true trim-final-newlines = true trim-trailing-whitespace = true +end-of-line-diagnostics = "hint" [editor.cursor-shape] insert = "bar" normal = "block" select = "underline" +[editor.inline-diagnostics] +cursor-line = "warning" + [editor.file-picker] hidden = false deduplicate-links = false @@ -29,6 +33,10 @@ layout = [ ] line-numbers = { min-width = 1 } +[editor.lsp] +display-inlay-hints = true +inlay-hints-length-limit = 10 + [editor.soft-wrap] enable = true wrap-indicator = "" @@ -39,6 +47,8 @@ left = [ "mode", "spinner", "file-name", + "read-only-indicator", + "file-modification-indicator", ] center = [] right = [ @@ -49,5 +59,17 @@ right = [ "file-encoding", ] +[editor.whitespace.characters] +space = "·" +nbsp = "⍽" +nnbsp = "␣" +tab = "→" +newline = "⏎" +tabpad = "‒" + [keys.normal] "C-l" = [":config-reload", ":redraw"] + +[keys.normal.space.t] +"w" = ":toggle whitespace.render all none" +"W" = ":toggle soft-wrap.enable" diff --git a/helix/languages.toml b/helix/languages.toml index 5198c32..b1cf72a 100644 --- a/helix/languages.toml +++ b/helix/languages.toml @@ -3,12 +3,24 @@ name = "go" auto-format = true formatter = { command = "goimports" } -[language-server.gopls.config] -"ui.diagnostic.staticcheck" = true +[language-server.gopls.config.hints] +assignVariableTypes = false +compositeLiteralFields = false +constantValues = false +functionTypeParameters = false +parameterNames = false +rangeVariableTypes = false [language-server.rust-analyzer.config.check] command = "clippy" +[language-server.rust-analyzer.config.inlayHints] +bindingModeHints.enable = true +parameterHints.enable = false + +[language-server.superhtml] +args = ["lsp", "--syntax-only"] + [language-server.tinymist] command = "tinymist" diff --git a/helix/themes/base.toml b/helix/themes/base.toml new file mode 100644 index 0000000..ceddca9 --- /dev/null +++ b/helix/themes/base.toml @@ -0,0 +1,233 @@ +## Syntax highlighting + +"attribute" = { fg = "Type" } + +"type" = { fg = "Type" } +# "type.builtin" = {} +# "type.parameter" = {} +# "type.enum" = {} +# "type.enum.variant" = {} + +"constructor" = {} + +"constant" = { fg = "Constant" } +# "constant.builtin" = {} +# "constant.builtin.boolean" = {} +# "constant.character" = {} +# "constant.character.escape" = {} +# "constant.numeric" = {} +# "constant.numeric.integer" = {} +# "constant.numeric.float" = {} + +"string" = { fg = "String" } +# "string.regexp" = {} +# "string.special" = {} +# "string.special.path" = {} +# "string.special.url" = {} +# "string.special.symbol" = {} + +"comment" = { fg = "Comment" } +# "comment.line" = {} +# "comment.block" = {} +# "comment.unused" = {} + +# "variable" = {} +# "variable.builtin" = {} +# "variable.parameter" = {} +# "variable.other" = {} +# "variable.other.member" = {} +# "variable.other.member.private" = {} + +"label" = { fg = "Keyword" } + +# "punctuation" = {} +# "punctuation.delimiter" = {} +# "punctuation.bracket" = {} +# "punctuation.special" = {} + +"keyword" = { fg = "Keyword" } +# "keyword.control" = {} +# "keyword.control.conditional" = {} +# "keyword.control.repeat" = {} +# "keyword.control.import" = {} +# "keyword.control.return" = {} +# "keyword.control.exception" = {} +# "keyword.operator" = {} +# "keyword.directive" = {} +# "keyword.function" = {} +# "keyword.storage" = {} +# "keyword.storage.type" = {} +# "keyword.storage.modifier" = {} + +"operator" = { fg = "Keyword" } + +"function" = { fg = "Function" } +# "function.builtin" = {} +# "function.method" = {} +# "function.method.private" = {} +"function.macro" = { fg = "Keyword" } +# "function.special" = {} + +"tag" = { fg = "Keyword" } +# "tag.builtin" = {} + +# "namespace" = {} + +# "special" = {} + +"markup" = {} +"markup.heading" = { modifiers = ["bold"] } +# "markup.heading.marker" = {} +"markup.heading.1" = { fg = "Keyword", modifiers = ["bold"] } +"markup.heading.2" = { fg = "Function" } +# "markup.heading.3" = {} +# "markup.heading.4" = {} +# "markup.heading.5" = {} +# "markup.heading.6" = {} +"markup.list" = { fg = "Type" } +# "markup.list.unnumbered" = {} +# "markup.list.numbered" = {} +# "markup.list.checked" = {} +# "markup.list.unchecked" = {} +"markup.bold" = { modifiers = ["bold"] } +"markup.italic" = { modifiers = ["italic"] } +"markup.strikethrough" = { modifiers = ["crossed_out"] } +"markup.link" = {} +"markup.link.url" = { fg = "String" } +"markup.link.label" = { fg = "Constant" } +"markup.link.text" = { fg = "Constant" } +# "markup.quote" = {} +# "markup.raw" = {} +# "markup.raw.inline" = {} +# "markup.raw.block" = {} + +"diff" = {} +"diff.plus" = { fg = "DiffAdd" } +"diff.minus" = { fg = "DiffDelete" } +"diff.delta" = { fg = "DiffChange" } +"diff.delta.moved" = { fg = "DiffMove" } +"diff.delta.conflict" = { modifiers = ["reversed"] } +# "diff.plus.gutter" = {} +# "diff.minus.gutter" = {} +# "diff.delta.gutter" = {} + +## Interface inherits some styles from "markup" + +# "markup.normal" = {} +# "markup.normal.completion" = {} +# "markup.normal.hover" = {} +# "markup.heading.completion" = {} +# "markup.heading.hover" = {} +# "markup.raw.inline.completion" = {} +# "markup.raw.inline.hover" = {} + +"ui.background" = { bg = "Background" } +# "ui.background.separator" = {} + +"ui.cursor" = { fg = "Background", bg = "CursorSecondary" } +"ui.cursor.match" = { bg = "CursorMatch", modifiers = ["bold"] } +"ui.cursor.primary" = { fg = "Background", bg = "CursorPrimary"} +# "ui.cursor.normal" = {} +# "ui.cursor.insert" = {} +# "ui.cursor.select" = {} +# "ui.cursor.primary.normal" = {} +# "ui.cursor.primary.insert" = {} +# "ui.cursor.primary.select" = {} + +# "ui.debug.breakpoint" = {} +# "ui.debug.active" = {} + +"ui.gutter" = { fg = "TextTertiary" } +"ui.gutter.selected" = { fg = "TextSecondary", bg = "Focused" } + +"ui.linenr" = { fg = "TextLineNumber" } +"ui.linenr.selected" = { fg = "TextPrimary", bg = "Focused", modifiers = ["bold"] } + +"ui.statusline" = { bg = "Border" } +"ui.statusline.inactive" = { bg = "Border", modifiers = ["dim"] } +# "ui.statusline.normal" = {} +# "ui.statusline.insert" = {} +# "ui.statusline.select" = {} +# "ui.statusline.separator" = {} + +# "ui.bufferline" = {} +# "ui.bufferline.active" = {} +# "ui.bufferline.background" = {} + +"ui.popup" = { bg = "Window" } +# "ui.popup.info" = {} + +"ui.picker.header" = { fg = "TextSecondary" } +"ui.picker.header.column" = { fg = "Keyword" } +"ui.picker.header.column.active" = { fg = "Keyword", underline.style = "line" } + +"ui.window" = { fg = "Border" } + +"ui.help" = { bg = "Focused" } + +"ui.text" = { fg = "TextPrimary" } +"ui.text.focus" = { fg = "TextPrimary", bg = "Focused" } +"ui.text.inactive" = { fg = "TextSecondary" } +# "ui.text.info" = { +# "ui.text.directory" = {} + +"ui.virtual.ruler" = { bg = "Ruler" } +"ui.virtual.whitespace" = { fg = "Whitespace"} +"ui.virtual.inlay-hint" = { fg = "Comment" } +"ui.virtual.indent-guide" = { fg = "TextTertiary" } +"ui.virtual.wrap" = { fg = "Whitespace" } +"ui.virtual.jump-label" = { fg = "JumpLabel", bg = "TextTertiary" } +# "ui.virtual.inlay-hint.parameter" = {} +# "ui.virtual.inlay-hint.type" = {} + +"ui.menu" = { bg = "Focused" } +"ui.menu.selected" = { bg = "TextSecondary" } +"ui.menu.scroll" = { bg = "TextSecondary", fg = "TextTertiary" } + +"ui.selection" = { bg = "Selection" } +"ui.selection.primary" = { bg = "Selection" } + +"ui.highlight" = { bg = "Focused" } +# "ui.highlight.frameline" = {} + +"ui.cursorline.primary" = { bg = "Focused" } +"ui.cursorline.secondary" = {} + +"ui.cursorcolumn.primary" = { fg = "White", bg = "Focused" } +"ui.cursorcolumn.secondary" = {} + +## Gutter +"warning" = { fg = "Warning" } +"error" = { fg = "Error" } +"info" = { fg = "Info" } +"hint" = { fg = "Hint" } + +## Editing area +"diagnostic" = { underline.style = "line", underline.color = "Comment" } +"diagnostic.hint" = { underline.style = "line", underline.color = "Hint" } +"diagnostic.info" = { underline.style = "line", underline.color = "Info" } +"diagnostic.warning" = { underline.style = "line", underline.color = "Warning" } +"diagnostic.error" = { underline.style = "line", underline.color = "Error" } +"diagnostic.unnecessary" = { modifiers = ["crossed_out"] } +"diagnostic.deprecated" = { modifiers = ["crossed_out"] } + +"tabstop" = { bg = "TextSecondary", modifiers = ["italic"] } + +[palette] +# default = "" +# black = "" +# red = "" +# green = "" +# yellow = "" +# blue = "" +# magenta = "" +# cyan = "" +# gray = "" +# light-red = "" +# light-green = "" +# light-yellow = "" +# light-blue = "" +# light-magenta = "" +# light-cyan = "" +# light-gray = "" +# white = "" diff --git a/helix/themes/dark.toml b/helix/themes/dark.toml index f39ec63..5de49e6 100644 --- a/helix/themes/dark.toml +++ b/helix/themes/dark.toml @@ -1,6 +1,39 @@ -inherits = "onedark" +inherits = "base" -"comment" = { fg = "light-gray" } +[palette] +Comment = "#afafaf" +Constant = "#af87ff" +Directory = "#007cff" +Function = "#00d7ff" +Keyword = "#5fd75f" +String = "#d7af00" +Type = "#d7d700" -"ui.background" = { bg = "#222222" } -"ui.cursorline.primary" = { bg = "#000000" } +JumpLabel = "#ff87ff" +Ruler = "#111111" +Whitespace = "#4e4e4e" + +Background = "#1d1f21" +Focused = "#000000" +Window = "#000000" +Border = "#303030" + +TextPrimary = "#ffffff" +TextLineNumber = "#a7a7a7" +TextSecondary = "#4e4e4e" +TextTertiary = "#303030" + +DiffAdd = "#44b342" +DiffChange = "#2972e0" +DiffDelete = "#e51029" +DiffMove = "#b479f2" + +Warning = "#de935f" +Error = "#a54242" +Info = "#5f819d" +Hint = "#777777" + +CursorPrimary = "#ffffff" +CursorSecondary = "#afafaf" +CursorMatch = "#303030" +Selection = "#303030" diff --git a/helix/themes/light.toml b/helix/themes/light.toml index de41f19..f41df4a 100644 --- a/helix/themes/light.toml +++ b/helix/themes/light.toml @@ -1,7 +1,39 @@ -inherits = "onelight" +inherits = "base" -"comment" = { fg = "grey" } -"comment.line" = { fg = "grey" } -"comment.line.documentation" = { fg = "grey" } -"comment.block" = { fg = "grey" } -"comment.block.documentation" = { fg = "grey" } +[palette] +Comment = "#666666" +Constant = "#876fff" +Directory = "#0091ea" +Function = "#d75f00" +Keyword = "#880000" +String = "#005f00" +Type = "#8700d7" + +JumpLabel = "#0091ea" +Ruler = "#eeeeee" +Whitespace = "#808080" + +Background = "#ffffff" +Focused = "#eeeeee" +Window = "#eeeeee" +Border = "#e0e0e0" + +TextPrimary = "#303030" +TextLineNumber = "#aaaaaa" +TextSecondary = "#c6c6c6" +TextTertiary = "#e0e0e0" + +DiffAdd = "#005f00" +DiffChange = "#2972e0" +DiffDelete = "#880000" +DiffMove = "#b479f2" + +Warning = "#f06d14" +Error = "#f32840" +Info = "#4e85da" +Hint = "#015700" + +CursorPrimary = "#000000" +CursorSecondary = "#666666" +CursorMatch = "#e0e0e0" +Selection = "#e0e0e0" diff --git a/jj/.gitignore b/jj/.gitignore new file mode 100644 index 0000000..c05e777 --- /dev/null +++ b/jj/.gitignore @@ -0,0 +1 @@ +repos diff --git a/jj/config.toml b/jj/config.toml index 68f67a1..8478eaf 100644 --- a/jj/config.toml +++ b/jj/config.toml @@ -3,3 +3,9 @@ [user] name = "Jeremy Kaplan" email = "code@jdkaplan.dev" + +[snapshot] +auto-track = "none()" + +[git] +colocate=true diff --git a/neovim/init.lua b/neovim/init.lua index 230f3ec..633b019 100644 --- a/neovim/init.lua +++ b/neovim/init.lua @@ -580,7 +580,16 @@ vim.lsp.config("zls", { }, }) +---------------------------------------------------------------------------- +-- teamtype ------------------------------------------------------------------------------- + +vim.pack.add({ "https://github.com/teamtype/teamtype-nvim" }) + +vim.keymap.set("n", "jc", "TeamtypeJumpToCursor") +vim.keymap.set("n", "jf", "TeamtypeFollow") + +---------------------------------------------------------------------------- -- which-key ------------------------------------------------------------------------------- diff --git a/neovim/nvim-pack-lock.json b/neovim/nvim-pack-lock.json index 971671d..aebebbc 100644 --- a/neovim/nvim-pack-lock.json +++ b/neovim/nvim-pack-lock.json @@ -67,6 +67,10 @@ "src": "https://github.com/mrcjkb/rustaceanvim", "version": "9.0.0 - 10.0.0" }, + "teamtype-nvim": { + "rev": "711eade8cd5d7d3efa9ec25ea0a390a954030222", + "src": "https://github.com/teamtype/teamtype-nvim" + }, "telescope-fzf-native.nvim": { "rev": "b25b749b9db64d375d782094e2b9dce53ad53a40", "src": "https://github.com/nvim-telescope/telescope-fzf-native.nvim"