From 80a6040b8496f3c3c880fd9bffab074abb22d735 Mon Sep 17 00:00:00 2001 From: DanRoscigno Date: Tue, 6 Jun 2023 14:11:50 -0400 Subject: [PATCH 1/4] add in ltex-ls for grammar and enable spell --- init.lua | 57 +++++++++++ spell/en.utf-8.add | 224 +++++++++++++++++++++++++++++++++++++++++ spell/en.utf-8.add.spl | Bin 0 -> 3699 bytes 3 files changed, 281 insertions(+) create mode 100644 spell/en.utf-8.add create mode 100644 spell/en.utf-8.add.spl diff --git a/init.lua b/init.lua index 32e96ad3..3f2b3c76 100644 --- a/init.lua +++ b/init.lua @@ -72,6 +72,9 @@ require('lazy').setup({ -- Detect tabstop and shiftwidth automatically 'tpope/vim-sleuth', + -- Grammar checking + 'vigoux/ltex-ls.nvim', + -- NOTE: This is where your plugins related to LSP can be installed. -- The configuration is done below. Search for lspconfig to find it below. { @@ -513,6 +516,60 @@ cmp.setup { }, } +-- I want spell checking on in markdown etc. +vim.api.nvim_create_augroup("spellcheck", { clear = true }) +vim.api.nvim_create_autocmd("FileType", { + group = "spellcheck", + pattern = { "gitcommit", "markdown", "mdx" }, + command = "setlocal spell", +}) + +-- configure ltex-ls +require 'ltex-ls'.setup { + on_attach = on_attach, + capabilities = capabilities, + use_spellfile = false, + filetypes = { "latex", "tex", "bib", "markdown", "gitcommit", "text" }, + settings = { + ltex = { + enabled = { "latex", "tex", "bib", "markdown", }, + language = "en", + diagnosticSeverity = "information", + sentenceCacheSize = 2000, + additionalRules = { + enablePickyRules = true, + motherTongue = "en", + }, + disabledRules = { + en = { "EN_QUOTES" } + }, + dictionary = (function() + -- For dictionary, search for files in the runtime to have + -- and include them as externals the format for them is + -- dict/{LANG}.txt + -- + -- Also add dict/default.txt to all of them + local files = {} + for _, file in ipairs(vim.api.nvim_get_runtime_file("dict/*", true)) do + local lang = vim.fn.fnamemodify(file, ":t:r") + local fullpath = vim.fs.normalize(file, ":p") + files[lang] = { ":" .. fullpath } + end + + if files.default then + for lang, _ in pairs(files) do + if lang ~= "default" then + vim.list_extend(files[lang], files.default) + end + end + files.default = nil + end + return files + end)(), + }, + }, +} + -- Confgiure the way that diagnostics look local diagconfig = { diff --git a/spell/en.utf-8.add b/spell/en.utf-8.add new file mode 100644 index 00000000..2eb29d52 --- /dev/null +++ b/spell/en.utf-8.add @@ -0,0 +1,224 @@ +ClickHouse +MaterializedView +S3 +ReplacingMergeTree +CollapsingMergeTree +ReplicatedReplacingMergeTree +ReplicatedAggregatingMergeTree +AggregatingMergeTree +SummingMergeTree +MergeTree +ReplicatedMergeTree +ReplicatedSummingMergeTree +ReplicatedCollapsingMergeTree +ReplicatedVersionedCollapsingMergeTree +VersionedCollapsingMergeTree +MySQL +Postgres +gRPC +PostgreSQL +SQLite +ODBC +JDBC +MongoDB +Redis +RabbitMQ +HDFS +AWS +IAM +Kerberos +LDAP +UDFs +DDL +JOINs +clickhouse +Superset +http +mdx +href +https +apache +img +dataset +ConnectionDetails +SSL +Datasets +datasource +datasets +src +png +md +pypi +OpenCelliD +SQLConsoleDetail +LaGuardia +UMTS +Scatterplot +LTE +sql +TabItem +csv +CSVWithNames +md5sum +UInt8 +DateTime +UInt32 +Float64 +Int16 +UInt64 +UInt16 +Enum8 +ActionsMenu +serverless +deployMethod +groupId +CodeBlock +LowCardinality +parens +Enum16 +STDERR +v22 +lts +INSERTs +Nikonov +Kseniia +Sumarokova +Nikolay +Degterinsky +filesystem +anova +analysisOfVariance +sql +datasource +ClickHouse +Grafana +clickhouse +ZooKeeper +jsonl +clickhouse +BSON +dirs +clickhouse +clickhouse +GCS +dbt +sql +Metabase +chnodes +xyz +Sharding +sharding +SmitaRKulkarni +Milovidov +Alexey +Fuzzer +Andelic +MVCC +fsync +SELECTs +MinIO +OpenLDAP +syslog +WIP +ctrl +Schulze +Tokmakov +DefaultPartitioner +pufit +FFFFFFFHHHHHHH +Trifonov +FriendLey +JSONExtract +JSON +Kruglov +Pavel +Passos +replaceOne +replaceAll +replaceRegexpOne +replaceRegexpAll +Popov +Kolupaev +OOM +Gololobov +Raúl +Marín +loopback +Mikhaylov +subquery +ThreadPool +mutex +Kochetov +Azat +Khuzhin +Vitaly +Baranov +async +Ilya +Golshtein +flynn +KevinyhZou +Yakov +Olkhovskiy +Enum +Decimal256 +IPv4 +Int32 +IPv6 +lizhuoyu5 +Dmitry +Novik +generateRandom +Int128 +Hulboj +alekseygolub +Zhang +ZSTD +CRC32 +alesapin +Murashkina +MikhailBurdukov +macOS +GenerateRandom +multifactor +lemmatize +lemmatization +Kubernetes +Mame +CloudFormation +ARN +ClickHouseAccess +ClickHouseAccessRole +SharedMergeTree +SMT +RMT +Cloudflare +R2 +SMT's +DoS +Deduplication +SharedMergeTree's +config +Jepsen +jepsen +io +DSN +SSLMode +Int64 +ZooKeeper's +ZAB +linearizable +linearizability +interserver +ACLs +Base64 +lw +Hostname +nc +ro +znodes +chnode1 +chnode2 +chnode3 +marsnet +uuid diff --git a/spell/en.utf-8.add.spl b/spell/en.utf-8.add.spl new file mode 100644 index 0000000000000000000000000000000000000000..1a53e92fb2cedf53c8ac2e5702776012e799f05f GIT binary patch literal 3699 zcmZu!&2Jmk7Qgq7lY-bhy$xc~Xch?LC21S+AyCsK4WUV$#=%cQWHFu@+f&bnJL9qA zh)Rw8Pq6NW1ws{zrwA-0p0el~MQ`y`35gYN!=42a{C?+pT7sz6nLGEMd%n-_oV0iL zieVVXtG_F?{KIQr#}C48uOHnX#7UYB^I}wvC&$y1m;GLx;&XCh;*l=2d88wq=@iRE zhj?qH8l~>(9A7={=@HITtazH^9b$)PqziTE42omi4fPafnT~a-J6hr15cfb+rgCPC z;{`mPf;hteOn3DdWI4V(EB43-X>6~}e4O&Shf`noWli-=4J<^<(&y&900G{!k?{(X z^D6~&?u@~1O;*?W{3cuO#~B$&psWrKzZ~ev9 z6rAa4&z{v|oLrO3t9oqI1luF%n1UeTcAb)GK>U)|3BoAhUWUgvg@$LKx(PF^RAH1c zP+X|btT>Pz372w29`ks~54t@Dkha8nRo~$LYz_B@5+NV^&uy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z|DVQ@v^>M97<@@^Lg40oCB!&dYJ2d+U`<<9YLKB kcEE-GL;s_>xX Date: Tue, 6 Jun 2023 14:23:52 -0400 Subject: [PATCH 2/4] add my notes and update spell --- ClickHouse-specific.md | 52 +++++++++++++++++++++++ my-docs-.ignore-file-for-marksman | 19 +++++++++ my-docs-.marksman.toml-file-for-marksman | 9 ++++ spell/en.utf-8.add | 2 + spell/en.utf-8.add.spl | Bin 3699 -> 3723 bytes 5 files changed, 82 insertions(+) create mode 100644 ClickHouse-specific.md create mode 100644 my-docs-.ignore-file-for-marksman create mode 100644 my-docs-.marksman.toml-file-for-marksman diff --git a/ClickHouse-specific.md b/ClickHouse-specific.md new file mode 100644 index 00000000..41547def --- /dev/null +++ b/ClickHouse-specific.md @@ -0,0 +1,52 @@ +## Working with Marksman and multiple repos + +In order to keep the docs close to the source-code at ClickHouse +most of the reference (SQL syntax, etc.) docs are in the repo +where the code is. This gives us heartburn when building the +docs with Docusaurus as the files need to be combined. In the +`.gitignore` file for the docs repo all of the dirs copied over +from the ClickHouse repo are marked to be ignored; this causes the +wonderful Marksman LSP to ignore the reference docs, and marks +any links to the reference docs invalid. + +The Marksman author came up with a great workaround, as `.ignore` gets +processed after `.gitignore`, I negate the ignore in `.ignore` and +the reference docs are now eligible for linking. +``` +# This is to reverse the .gitignore in the ClickHouse-docs repo, as +# the marksman LSP ignores dirs in the .gitignore when checking +# for links for markdown files. This file (.ignore) gets processed +# after .gitignore, so the negation (`!`) of the path fixes the issue +# created by copying the files into the clickhouse-docs directory +# structure + +# place at root dir of the markdown project, for example: +# $GITHUB/clickhouse-docs/.ignore + +!docs/en/development +!docs/en/engines +!docs/en/getting-started +!docs/en/interfaces +!docs/en/operations +!docs/en/sql-reference +docs/ru +docs/zh +docs/_clients +``` + +## Configuring Marksman + +Maybe not needed, but I am not sure. I think that `.mdx` files +may now be considered Markdown, I should check. I don't like table of +contents to be created, so this is disabled. + +``` +# Place at root directory of the markdown project, for example: +# $GITHUB/clickhouse-docs/.marksman.toml +[core] +markdown.file_extensions = ["md", "mdx"] +text_sync = "full" + +[code_action] +toc.enable = false # Enable/disable "Table of Contents" code action +``` diff --git a/my-docs-.ignore-file-for-marksman b/my-docs-.ignore-file-for-marksman new file mode 100644 index 00000000..b458cb10 --- /dev/null +++ b/my-docs-.ignore-file-for-marksman @@ -0,0 +1,19 @@ +# This is to reverse the .gitignore in the ClickHouse-docs repo, as +# the marksman LSP ignores dirs in the .gitignore when checking +# for links for markdown files. This file (.ignore) gets processed +# after .gitignore, so the negation (`!`) of the path fixes the issue +# created by copying the files into the clickhouse-docs directory +# structure + +# place at root dir of the markdown project, for example: +# $GITHUB/clickhouse-docs/.ignore + +!docs/en/development +!docs/en/engines +!docs/en/getting-started +!docs/en/interfaces +!docs/en/operations +!docs/en/sql-reference +docs/ru +docs/zh +docs/_clients diff --git a/my-docs-.marksman.toml-file-for-marksman b/my-docs-.marksman.toml-file-for-marksman new file mode 100644 index 00000000..c62376bc --- /dev/null +++ b/my-docs-.marksman.toml-file-for-marksman @@ -0,0 +1,9 @@ +# place at root dir of the markdown project, for example: +# $GITHUB/clickhouse-docs/.marksman.toml +[core] +markdown.file_extensions = ["md", "mdx"] +text_sync = "full" + +[code_action] +toc.enable = false # Enable/disable "Table of Contents" code action + diff --git a/spell/en.utf-8.add b/spell/en.utf-8.add index 2eb29d52..2ee5fc28 100644 --- a/spell/en.utf-8.add +++ b/spell/en.utf-8.add @@ -222,3 +222,5 @@ chnode2 chnode3 marsnet uuid +Docusaurus +LSP diff --git a/spell/en.utf-8.add.spl b/spell/en.utf-8.add.spl index 1a53e92fb2cedf53c8ac2e5702776012e799f05f..373ccaec0c61e0e56f94778978f7c5f400aa2308 100644 GIT binary patch delta 458 zcmX9)JxIeq6ux)8CJjg@5v5kpVxf!0nxzhc9h450PHuv+2{o8Dp=YtWl{yGIC~t8T z#KBQI2wDgZN?lx>9Cg+~1V{B<9q!}!?)!Q7zQzxe@zr8U29D?Dei_qVui~8JFuxz; z6<{nQp$QT!!Ui2;I6O&2_FxlrK_8H#Si@*Bj9&{Jh=>PJ;NEeOaRU9kwtc%he}f!}(8M+}^g zwIRe_EIabv;PlRxYgFjd)ILST&ndr^dB370WU(O0H$4I!B`qSa0ZKM=4f8E T9M)F-B7tYdB7An=j1%z(;E`!{ delta 371 zcmW-dF-yZh6vy*kFS%wZA}CbbQW13!EYwMaq7F*If|TMQ3Puw&7)@weh=PMSI>}qQ zIw^=0DN?a?^aBW;g?<2CTtozY*Wr%4|NGsK_wFkFl}cdSY&@?ZO^7P-Vt}8WXXKBQ4u; zeM;*|X{k4zfEM)#!y0w;UD&3SF#+dPFiPoRA1nyjeZ(9-x$I!R9w|?j?u@+5*dA9t zsBcU{mvlJ=Wtx>)XwtfzFNoh4v;##~T=39xVILhf6y2ERS2-6=PZ@VqcL%&82oN;A zVDYv@UAX~!l!&h&ep5Mq!PZ_pH~L;hu4`+@JeJR`sgJ-mCC%yah8or3rfmoYxo9c^ aG~<@G%vFf!#vH-e13jC|&~N>i*Ww=?Vp|6Q From c61af0c8e319511440ad757acbe53a9d8f289b62 Mon Sep 17 00:00:00 2001 From: DanRoscigno Date: Thu, 8 Jun 2023 12:26:55 -0400 Subject: [PATCH 3/4] scroll on search --- init.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 3f2b3c76..4cfdb4db 100644 --- a/init.lua +++ b/init.lua @@ -472,7 +472,8 @@ mason_lspconfig.setup_handlers { -- See `:help cmp` local cmp = require 'cmp' local luasnip = require 'luasnip' -require('luasnip.loaders.from_vscode').lazy_load() +--require('luasnip.loaders.from_vscode').lazy_load() +--require("luasnip.loaders.from_vscode").lazy_load({ paths = { "/home/droscigno/.config/nvim/my-cool-snippets/markdown.json" } }) luasnip.config.setup {} cmp.setup { @@ -595,5 +596,10 @@ local diagconfig = { vim.diagnostic.config(diagconfig) +-- I like search results to be closer to the center +-- When searching, scroll text so that there +-- are at least 5 lines above and below result +vim.o.scrolloff = 5 + -- The line beneath this is called `modeline`. See `:help modeline` -- vim: ts=2 sts=2 sw=2 et From 537eb0f5353cf92eeedbd9edee76b977d6ab1bea Mon Sep 17 00:00:00 2001 From: DanRoscigno Date: Thu, 8 Jun 2023 12:27:18 -0400 Subject: [PATCH 4/4] update spell --- spell/en.utf-8.add | 6 ++++++ spell/en.utf-8.add.spl | Bin 3723 -> 3766 bytes 2 files changed, 6 insertions(+) diff --git a/spell/en.utf-8.add b/spell/en.utf-8.add index 2ee5fc28..d4f80892 100644 --- a/spell/en.utf-8.add +++ b/spell/en.utf-8.add @@ -224,3 +224,9 @@ marsnet uuid Docusaurus LSP +wildcard +PSC +gcloud +GCP +hostname +VPC diff --git a/spell/en.utf-8.add.spl b/spell/en.utf-8.add.spl index 373ccaec0c61e0e56f94778978f7c5f400aa2308..5d45d2ee762f59ad1bf27cef427e3b078c4d084c 100644 GIT binary patch delta 381 zcmXX?y-UMT5Pz4KPls*_RU-vK5ye6fm5L%bh+sh!9Fz*Bd1&Zs6Ou;iB%Ph)5QJ_{ zu2K|4TwMwxrGu-3|3h(5FVW$SuycNg}9o!Q?iMuCvh`C&{S++~jVXhrxTm%!Ll zkfaEFh=Hou#Riu~jcT|N_{o={hZE{OykK9QrS!@}(@vcmWr8=RGDVh){z_de>(MtGi?7%r@%ncaEU9&~RzL_5xgbIz>W(`6* zu}VQp_AqNrjdcX|1TEu2koMJXf&iw!;(=9IB4FE79TLA1Ub16AGZs70_&cB_!BhTU U=t3oJD(w&-t#$bBd|8+3FPzw0L;wH) delta 338 zcmX9(Jxc>Y5Z!lspCT!>hzEg?1RH~gh*${=Z(7(U42-xHA&VG$Lpt)AReLn?0mfU=FOdZ?q+tkDoLb*!21)ze7(u+OB+HwG*lSV zsSFGV6x;M8SMWrhev2W!>kFLE8q3HIs)htEXxpr~`4Dv^I7AB&+G7)nf6?u6l#4Vp zJ*(^oJo%+>GhccR;4_{P^N~^KB|Dw4dm`iHc+At>PReW0hLyvJl(mFuy0UU}qafw% zbr^NPuZKv3FsiIz)ab>kA*PbO4u@KHpNXG#dFCV5cq}&Ch!L{8kQFpO#wlj6755bT v@DYvs`Y1&}nD>-8tA!?~qU%eK<