From 465f27ac0c5376d1c6b62da6949e3f8bb012caf8 Mon Sep 17 00:00:00 2001 From: Dmitriy Pleshevskiy Date: Sat, 19 Nov 2022 16:38:31 +0300 Subject: [PATCH] update neovim --- flake.lock | 8 ++-- flake.nix | 67 ++++++++++----------------------- plugins/formatter/neoformat.lua | 1 + 3 files changed, 24 insertions(+), 52 deletions(-) diff --git a/flake.lock b/flake.lock index be47ed5..cff69ad 100644 --- a/flake.lock +++ b/flake.lock @@ -206,11 +206,11 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1668806730, - "narHash": "sha256-CfRF/O5ObRBGCQkrUBsNWzKH2OjLNtOOuVk8H2dMoxQ=", + "lastModified": 1668823439, + "narHash": "sha256-/o0SRNf+2yqg+mCUE2UGdsDkD0BCcSPCQYUZKoZxzI0=", "ref": "refs/heads/main", - "rev": "9666618527a63e79ccc1855beeab285cd8480727", - "revCount": 6, + "rev": "520a06d52cbd90aa290eccac28f4f1fefee64b27", + "revCount": 11, "type": "git", "url": "https://git.pleshevski.ru/mynix/nix2lua" }, diff --git a/flake.nix b/flake.nix index d88538f..8eecdc6 100644 --- a/flake.nix +++ b/flake.nix @@ -219,6 +219,7 @@ { inherit neovimPlugins; }; in { + lib = nix2lua.lib; overlays = { default = final: prev: { myneovim = prev.callPackage self (mkNvimPlugins prev // nix2lua.lib); @@ -229,13 +230,12 @@ let pkgs = import nixpkgs { inherit system; }; - neovim = pkgs.callPackage self (mkNvimPlugins pkgs // nix2lua.lib); + minimalNeovim = pkgs.callPackage self (mkNvimPlugins pkgs // nix2lua.lib); - testNeovim = (neovim.override { + recommendedNeovim = (minimalNeovim.override { enableDevIcons = true; enableTabby = true; - enableOrgMode = true; - grammarFileTypes = [ "nix" "lua" "org" ]; + grammarFileTypes = [ "nix" "lua" ]; plugins = with nix2lua.lib; { nvimTree.settings = { @@ -245,39 +245,11 @@ full_name = true; }; }; - lspSaga.settings = { - border_style = "rounded"; - symbol_in_winbar.enable = false; - code_action_lightbulb.enable = false; - code_action_keys = { quit = ""; }; - definition_action_keys = { quit = ""; }; - rename_action_quit = ""; - }; - lspConfig = { - servers = { - nix = { }; - tsserver = { }; - eslint = { }; - denols = { - root_dir = mkLuaRaw "root_pattern(\"deno.json\", \"deno.jsonc\")"; - }; - rust_analyzer = { - settings.rust-analyzer = { - "server.path" = "rust-analyzer"; - "updates.prompt" = false; - "updates.checkOnStartup" = false; - "checkOnSave.enable" = true; - "checkOnSave.command" = "clippy"; - "cargo.autoreload" = true; - }; - }; - }; - }; lualine.settings = { options.ignore_focus = [ "NvimTree" ]; sections = { lualine_a = [ - [ "filename" (mkDictItem "path" 1) ] + [ "filename" (mkNamedField "path" 1) ] ]; lualine_b = [ "branch" "diff" "diagnostics" ]; lualine_c = [ "lsp_progress" ]; @@ -286,27 +258,26 @@ lualine_z = [ "location" "mode" ]; }; }; - orgmode.settings = { - org_agenda_files = [ "~/orgs/**/*" ]; - org_default_notes_file = "~/orgs/refile.org"; - win_split_mode = "tabnew"; - org_hide_leading_stars = true; - }; }; }); + + mkApp = drv: { + type = "app"; + program = "${drv}/bin/nvim"; + }; in { - apps.default = { - type = "app"; - program = "${neovim}/bin/nvim"; - }; - apps.test = { - type = "app"; - program = "${testNeovim}/bin/nvim"; + apps = { + default = mkApp recommendedNeovim; + recommended = mkApp recommendedNeovim; + minimal = mkApp minimalNeovim; }; - packages.default = neovim; - packages.test = testNeovim; + packages = { + default = recommendedNeovim; + recommended = recommendedNeovim; + minimal = minimalNeovim; + }; devShells.default = pkgs.mkShell { packages = [ diff --git a/plugins/formatter/neoformat.lua b/plugins/formatter/neoformat.lua index 62643dd..3881a28 100644 --- a/plugins/formatter/neoformat.lua +++ b/plugins/formatter/neoformat.lua @@ -6,5 +6,6 @@ vim.cmd([[ aug fmt au! au BufWritePre * try | undojoin | Neoformat | catch /E790/ | Neoformat | endtry + au BufWritePre *.tsx,*.ts,*.jsx,*.js EslintFixAll aug END ]])