Merge pull request #118 from yavko/overhaul-spell

This commit is contained in:
NotAShelf 2023-08-11 17:16:04 +03:00 committed by GitHub
commit 459a0bf7c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 34 additions and 7 deletions

View File

@ -24,6 +24,8 @@ https://github.com/yavko[yavko]:
* Added Deno Language Server for javascript/typescript
* Added support for multiple languages <<opt-vim.spellChecking.languages>>, and added vim-dirtytalk <<opt-vim.spellChecking.enableProgrammingWordList>>
https://github.com/notashelf[notashelf]:
* Added GitHub Copilot to completion sources.

View File

@ -1491,6 +1491,7 @@
"toggleterm-nvim": "toggleterm-nvim",
"tokyonight": "tokyonight",
"trouble": "trouble",
"vim-dirtytalk": "vim-dirtytalk",
"vim-illuminate": "vim-illuminate",
"vim-markdown": "vim-markdown",
"vim-repeat": "vim-repeat",
@ -1788,6 +1789,22 @@
"type": "github"
}
},
"vim-dirtytalk": {
"flake": false,
"locked": {
"lastModified": 1690722430,
"narHash": "sha256-kjyLwkAk6mqK7u4+zAr+Yh+zbSiukNKtXwb7t39LUco=",
"owner": "psliwka",
"repo": "vim-dirtytalk",
"rev": "a49251dce1852875951d95f7013979ece5caebf0",
"type": "github"
},
"original": {
"owner": "psliwka",
"repo": "vim-dirtytalk",
"type": "github"
}
},
"vim-illuminate": {
"flake": false,
"locked": {

View File

@ -456,6 +456,12 @@
flake = false;
};
# Spellchecking
vim-dirtytalk = {
url = "github:psliwka/vim-dirtytalk";
flake = false;
};
# Terminal
toggleterm-nvim = {
url = "github:akinsho/toggleterm.nvim";

View File

@ -91,6 +91,7 @@ with lib; let
"nvim-navbuddy"
"copilot-cmp"
"lsp-lines"
"vim-dirtytalk"
];
# You can either use the name of the plugin or a package.
pluginType = with types;

View File

@ -8,7 +8,7 @@ with builtins; let
cfg = config.vim;
in {
config = {
vim.startPlugins = ["plenary-nvim"];
vim.startPlugins = ["plenary-nvim"] ++ lib.optionals (cfg.spellChecking.enableProgrammingWordList) ["vim-dirtytalk"];
vim.maps.normal =
mkIf cfg.disableArrows {
@ -140,7 +140,7 @@ in {
''}
${optionalString cfg.spellChecking.enable ''
set spell
set spelllang=${toString cfg.spellChecking.language}
set spelllang=${builtins.concatStringsSep "," cfg.spellChecking.languages}${optionalString cfg.spellChecking.enableProgrammingWordList ",programming"}
''}
${optionalString (cfg.leaderKey != null) ''
let mapleader = "${toString cfg.leaderKey}"

View File

@ -31,11 +31,12 @@ with builtins; {
spellChecking = {
enable = mkEnableOption "neovim's built-in spellchecking";
language = mkOption {
type = types.str;
description = "The language to be used for spellchecking";
default = "en_US";
example = "de";
enableProgrammingWordList = mkEnableOption "vim-dirtytalk, a wordlist for programmers, that includes programming words";
languages = mkOption {
type = with types; listOf str;
description = "The languages to be used for spellchecking";
default = ["en"];
example = ["en" "de"];
};
};