From 76b50832b2d08f1aaa22b8f0f45d723245c7aab5 Mon Sep 17 00:00:00 2001 From: Christian Harke Date: Tue, 12 Sep 2023 22:59:27 +0200 Subject: [PATCH] Drop spacevim for plain neovim --- flake.lock | 26 +---- flake.nix | 8 -- home/users/christian/vim/bootstrap_after.vim | 0 home/users/christian/vim/bootstrap_before.vim | 19 ---- home/users/christian/vim/config.nix | 102 ------------------ home/users/christian/vim/default.nix | 77 +++++++------ lib/nixpkgs.nix | 9 +- 7 files changed, 44 insertions(+), 197 deletions(-) delete mode 100644 home/users/christian/vim/bootstrap_after.vim delete mode 100644 home/users/christian/vim/bootstrap_before.vim delete mode 100644 home/users/christian/vim/config.nix diff --git a/flake.lock b/flake.lock index e37492e9..7cfc6e6e 100644 --- a/flake.lock +++ b/flake.lock @@ -362,31 +362,7 @@ "nixpkgs": "nixpkgs", "nixpkgs-unstable": "nixpkgs-unstable", "nur": "nur", - "pre-commit-hooks": "pre-commit-hooks", - "spacevim": "spacevim" - } - }, - "spacevim": { - "inputs": { - "nixpkgs": [ - "nixpkgs-unstable" - ], - "pre-commit-hooks": [ - "pre-commit-hooks" - ] - }, - "locked": { - "lastModified": 1694480346, - "narHash": "sha256-2SFm7pcoS7zp8h4cJgjsD2St9ceKUZhQXJEv6CLuVaI=", - "owner": "rake5k", - "repo": "spacevim-flake", - "rev": "7a32a6709d708c2da7dc3f1fb94e97872e91a649", - "type": "github" - }, - "original": { - "owner": "rake5k", - "repo": "spacevim-flake", - "type": "github" + "pre-commit-hooks": "pre-commit-hooks" } }, "systems": { diff --git a/flake.nix b/flake.nix index 54673164..9925d387 100644 --- a/flake.nix +++ b/flake.nix @@ -69,14 +69,6 @@ url = "github:Mic92/nix-index-database"; inputs.nixpkgs.follows = "nixpkgs-unstable"; }; - - spacevim = { - url = "github:rake5k/spacevim-flake"; - inputs = { - nixpkgs.follows = "nixpkgs-unstable"; - pre-commit-hooks.follows = "pre-commit-hooks"; - }; - }; }; outputs = { self, nixpkgs, ... } @ inputs: diff --git a/home/users/christian/vim/bootstrap_after.vim b/home/users/christian/vim/bootstrap_after.vim deleted file mode 100644 index e69de29b..00000000 diff --git a/home/users/christian/vim/bootstrap_before.vim b/home/users/christian/vim/bootstrap_before.vim deleted file mode 100644 index e5d8e388..00000000 --- a/home/users/christian/vim/bootstrap_before.vim +++ /dev/null @@ -1,19 +0,0 @@ -set clipboard=unnamedplus - -" -" SPELL CHECK -" - -filetype plugin on - -set spellfile=~/.local/share/nvim/site/spell/shared.utf-8.add,~/.local/share/nvim/site/spell/de.utf-8.add,~/.local/share/nvim/site/spell/en.utf-8.add -autocmd FileType gitcommit setlocal spell spelllang=en_gb -autocmd FileType text setlocal spell spelllang=de_ch,en_gb - -" -" THESAURI -" - -set thesaurus+=~/.local/share/nvim/site/dict/openthesaurus.txt -set thesaurus+=~/.local/share/nvim/site/dict/mthesaur.txt - diff --git a/home/users/christian/vim/config.nix b/home/users/christian/vim/config.nix deleted file mode 100644 index ae0fc16c..00000000 --- a/home/users/christian/vim/config.nix +++ /dev/null @@ -1,102 +0,0 @@ -{ - custom_plugins = [ - { repo = "lilydjwg/colorizer"; } - ]; - layers = [ - { name = "default"; } - # VCS - - { name = "VersionControl"; } - { name = "git"; } - { name = "github"; } - - # Language - - { - name = "autocomplete"; - auto_completion_return_key_behavior = "smart"; - auto_completion_tab_key_behavior = "smart"; - autocomplete_method = "coc"; - } - - { - name = "lsp"; - filetypes = [ - "css" - "docker" - "elm" - "haskell" - "html" - "java" - "javascript" - "json" - "nix" - "python" - "rust" - "sass" - "scss" - "sh" - "typescript" - "vue" - ]; - override_cmd = { - css = [ "vscode-css-language-server" ]; - docker = [ "docker-langserver" ]; - elm = [ "elm-language-server" ]; - haskell = [ "haskell-language-server-wrapper" ]; - html = [ "vscode-html-language-server" ]; - java = [ "jdt-language-server" ]; - json = [ "vscode-json-language-server" ]; - nix = [ "rnix-lsp" ]; - python = [ "pylsp" ]; - rust = [ "rust-analyzer" ]; - sass = [ "vscode-css-language-server" ]; - scss = [ "vscode-css-language-server" ]; - vue = [ "vls" ]; - }; - } - - { name = "lang#c"; } - { name = "lang#dockerfile"; } - { name = "lang#graphql"; } - { name = "lang#haskell"; } - { name = "lang#html"; } - { name = "lang#java"; } - { name = "lang#javascript"; } - { name = "lang#latex"; } - { name = "lang#markdown"; } - { name = "lang#nix"; } - { name = "lang#python"; } - { name = "lang#rust"; } - { name = "lang#toml"; } - { name = "lang#typescript"; } - { name = "lang#vim"; } - { name = "lang#vue"; } - { name = "lang#extra"; } - - # Utilities - - { name = "test"; } - { name = "fzf"; } - { - default_height = 30; - default_position = "top"; - name = "shell"; - } - { name = "sudo"; } - { - enable = true; - name = "colorscheme"; - } - ]; - options = { - buffer_index_type = 4; - colorscheme = "onedark"; - colorscheme_bg = "dark"; - enable_guicolors = true; - enable_statusline_mode = true; - enable_tabline_filetype_icon = true; - statusline_separator = "slant"; - timeoutlen = 500; - }; -} diff --git a/home/users/christian/vim/default.nix b/home/users/christian/vim/default.nix index 36e154e6..19c4e4ac 100644 --- a/home/users/christian/vim/default.nix +++ b/home/users/christian/vim/default.nix @@ -6,20 +6,22 @@ let cfg = config.custom.users.christian.vim; - spacevim = pkgs.custom.spacevim.override { - spacevim_config = import ./config.nix; - bootstrap_before = builtins.readFile ./bootstrap_before.vim; - bootstrap_after = builtins.readFile ./bootstrap_after.vim; - }; - nvim-spell-de-utf8-dictionary = builtins.fetchurl { url = "http://ftp.vim.org/vim/runtime/spell/de.utf-8.spl"; sha256 = "sha256:73c7107ea339856cdbe921deb92a45939c4de6eb9c07261da1b9dd19f683a3d1"; }; + nvim-spell-de-utf8-suggestions = builtins.fetchurl { + url = "http://ftp.vim.org/vim/runtime/spell/de.utf-8.sug"; + sha256 = "sha256:0j592ibsias7prm1r3dsz7la04ss5bmsba6l1kv9xn3353wyrl0k"; + }; nvim-spell-en-utf8-dictionary = builtins.fetchurl { url = "http://ftp.vim.org/vim/runtime/spell/en.utf-8.spl"; sha256 = "sha256:0w1h9lw2c52is553r8yh5qzyc9dbbraa57w9q0r9v8xn974vvjpy"; }; + nvim-spell-en-utf8-suggestions = builtins.fetchurl { + url = "http://ftp.vim.org/vim/runtime/spell/en.utf-8.sug"; + sha256 = "sha256:1v1jr4rsjaxaq8bmvi92c93p4b14x2y1z95zl7bjybaqcmhmwvjv"; + }; in @@ -32,11 +34,6 @@ in config = mkIf cfg.enable { home = { - activation.clearSpaceVimConfigCache = lib.hm.dag.entryAfter [ "writeBoundary" ] '' - $DRY_RUN_CMD rm -f $VERBOSE_ARG \ - ${config.xdg.cacheHome}/SpaceVim/conf/init.json - ''; - file = let inherit (config.lib.file) mkOutOfStoreSymlink; @@ -48,37 +45,16 @@ in in { "${spellConfDir}/de.utf-8.spl".source = nvim-spell-de-utf8-dictionary; + "${spellConfDir}/de.utf-8.sug".source = nvim-spell-de-utf8-suggestions; "${spellConfDir}/en.utf-8.spl".source = nvim-spell-en-utf8-dictionary; + "${spellConfDir}/en.utf-8.sug".source = nvim-spell-en-utf8-suggestions; "${spellDataDir}/shared.utf-8.add".source = mkOutOfStoreSymlink "${nixcfgDictionaryDir}/shared.utf-8.add"; "${spellDataDir}/de.utf-8.add".source = mkOutOfStoreSymlink "${nixcfgDictionaryDir}/de.utf-8.add"; "${spellDataDir}/en.utf-8.add".source = mkOutOfStoreSymlink "${nixcfgDictionaryDir}/en.utf-8.add"; }; - packages = with pkgs; [ - spacevim - - # LSP servers - elmPackages.elm-language-server - haskell-language-server - jdt-language-server - nodePackages.bash-language-server - nodePackages.dockerfile-language-server-nodejs - nodePackages.typescript-language-server - nodePackages.vscode-langservers-extracted - nodePackages.vue-language-server - nodePackages.yaml-language-server - python310Packages.python-lsp-server - rnix-lsp - rust-analyzer - ]; - sessionVariables = { - EDITOR = "spacevim"; - }; - - shellAliases = { - vi = "spacevim"; - vim = "spacevim"; + EDITOR = "vim"; }; }; @@ -86,5 +62,36 @@ in "nvim/site/dict/mthesaur.txt".source = ./data/dict/mthesaur.txt; "nvim/site/dict/openthesaurus.txt".source = ./data/dict/openthesaurus.txt; }; + + programs.neovim = { + enable = true; + extraConfig = '' + set clipboard=unnamedplus + set number relativenumber + + " + " SPELL CHECK + " + + filetype plugin on + + set spellfile=~/.local/share/nvim/site/spell/shared.utf-8.add,~/.local/share/nvim/site/spell/de.utf-8.add,~/.local/share/nvim/site/spell/en.utf-8.add + autocmd FileType gitcommit setlocal spell spelllang=en_gb + autocmd FileType text setlocal spell spelllang=de_ch,en_gb + + " + " THESAURI + " + + set thesaurus+=~/.local/share/nvim/site/dict/openthesaurus.txt + set thesaurus+=~/.local/share/nvim/site/dict/mthesaur.txt + ''; + plugins = with pkgs.vimPlugins; [ + vim-nix + ]; + viAlias = true; + vimAlias = true; + vimdiffAlias = true; + }; }; } diff --git a/lib/nixpkgs.nix b/lib/nixpkgs.nix index 6c92aa59..c0f44e83 100644 --- a/lib/nixpkgs.nix +++ b/lib/nixpkgs.nix @@ -17,17 +17,10 @@ import inputs.nixpkgs { unstable = import inputs.nixpkgs-unstable { inherit config system; }; - - custom = import inputs.nixpkgs { - inherit system; - overlays = [ - inputs.spacevim.overlays.default - ]; - }; in [ (final: prev: { - inherit system unstable custom; + inherit system unstable; inherit (inputs.agenix-cli.packages."${system}") agenix-cli; })