From 825beb7f0c468cc1d44d13959cd57aece04d841f Mon Sep 17 00:00:00 2001 From: Stefan Imhoff Date: Sat, 29 Mar 2025 10:04:16 +0100 Subject: [PATCH] feat: add harper lsp --- .gitignore | 1 + bin/harper-backup | 3 +++ bin/harper-restore | 3 +++ config/harper-ls/dictionary.txt | 1 + config/nvim/lua/plugins/harper.lua | 38 +++++++++++++++++++++++++++++ config/nvim/lua/plugins/mason.lua | 1 + config/nvim/spell/en.utf-8.add | 1 + config/nvim/spell/en.utf-8.add.spl | Bin 1654 -> 1667 bytes config/zed/settings.json | 2 +- 9 files changed, 49 insertions(+), 1 deletion(-) create mode 100755 bin/harper-backup create mode 100755 bin/harper-restore create mode 100644 config/harper-ls/dictionary.txt create mode 100644 config/nvim/lua/plugins/harper.lua diff --git a/.gitignore b/.gitignore index 2a88912..220659e 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,4 @@ config/fish/completions config/fish/conf.d config/fish/fish_variables config/fish/functions/* +file_dictionaries/ diff --git a/bin/harper-backup b/bin/harper-backup new file mode 100755 index 0000000..4cbd301 --- /dev/null +++ b/bin/harper-backup @@ -0,0 +1,3 @@ +#!/bin/bash + +rsync -av "$HOME/Library/Application Support/harper-ls/" ~/.config/harper-ls/ diff --git a/bin/harper-restore b/bin/harper-restore new file mode 100755 index 0000000..1322cf8 --- /dev/null +++ b/bin/harper-restore @@ -0,0 +1,3 @@ +#!/bin/bash + +rsync -av ~/.config/harper-ls/ "$HOME/Library/Application Support/harper-ls/" diff --git a/config/harper-ls/dictionary.txt b/config/harper-ls/dictionary.txt new file mode 100644 index 0000000..0112223 --- /dev/null +++ b/config/harper-ls/dictionary.txt @@ -0,0 +1 @@ +Imhoff diff --git a/config/nvim/lua/plugins/harper.lua b/config/nvim/lua/plugins/harper.lua new file mode 100644 index 0000000..9efe1a6 --- /dev/null +++ b/config/nvim/lua/plugins/harper.lua @@ -0,0 +1,38 @@ +-- Harper - Grammar and spell checker +-- https://writewithharper.com/docs/integrations/neovim +return { + "neovim/nvim-lspconfig", + opts = { + servers = { + harper_ls = { + settings = { + ["harper-ls"] = { + userDictPath = "~/.config/harper-ls/dictionary.txt", + fileDictPath = "~/.config/harper-ls/file_dictionaries", + linters = { + SpellCheck = true, + SpelledNumbers = false, + AnA = true, + SentenceCapitalization = true, + UnclosedQuotes = true, + WrongQuotes = false, + LongSentences = true, + RepeatedWords = true, + Spaces = true, + Matcher = true, + CorrectNumberSuffix = true, + }, + codeActions = { + ForceStable = false, + }, + markdown = { + IgnoreLinkTitle = false, + }, + diagnosticSeverity = "hint", + isolateEnglish = false, + }, + }, + }, + }, + }, +} diff --git a/config/nvim/lua/plugins/mason.lua b/config/nvim/lua/plugins/mason.lua index b922dda..1699683 100644 --- a/config/nvim/lua/plugins/mason.lua +++ b/config/nvim/lua/plugins/mason.lua @@ -19,6 +19,7 @@ return { "gofumpt", "goimports", "gomodifytags", + "harper-ls", "html-lsp", "htmlbeautifier", "impl", diff --git a/config/nvim/spell/en.utf-8.add b/config/nvim/spell/en.utf-8.add index 0c7da30..1336f8f 100755 --- a/config/nvim/spell/en.utf-8.add +++ b/config/nvim/spell/en.utf-8.add @@ -96,3 +96,4 @@ scriptable dapp webpage Xcode +Imhoff diff --git a/config/nvim/spell/en.utf-8.add.spl b/config/nvim/spell/en.utf-8.add.spl index 04c977a3386dca0bfd57aab1c506dead6e24793e..7c7c4e3c7dcff2ab577b835c6968b9b0564df8cf 100755 GIT binary patch delta 166 zcmeyy)6B~k=IL8pkeZWY^q+x&dB#S*`VrV96A}pUzkU(jA=4 zm<2Sd7#IQkj!8bAjdqMW&>HNQXQi$+)TjC{_woT?!IAviT!RD!==IL8pkeZWY^q+x&xql28!+8{EwxT5dhZjC`AAO diff --git a/config/zed/settings.json b/config/zed/settings.json index 55301d6..ee50721 100644 --- a/config/zed/settings.json +++ b/config/zed/settings.json @@ -85,7 +85,6 @@ "basher": true, "catppuccin": true, "catppuccin-icons": true, - "cspell": true, "csv": true, "deno": true, "docker-compose": true, @@ -94,6 +93,7 @@ "fish": true, "git-firefly": true, "graphql": true, + "harper": true, "html": true, "ini": true, "log": true,