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 00000000..1a53e92f Binary files /dev/null and b/spell/en.utf-8.add.spl differ