diff --git a/docs/release-notes/release-notes.adoc b/docs/release-notes/release-notes.adoc index 3a408b71..8217fb6a 100644 --- a/docs/release-notes/release-notes.adoc +++ b/docs/release-notes/release-notes.adoc @@ -8,3 +8,4 @@ This section lists the release notes for tagged version of neovim-flake and curr include::rl-0.1.adoc[] include::rl-0.2.adoc[] +include::rl-0.3.adoc[] diff --git a/docs/release-notes/rl-0.3.adoc b/docs/release-notes/rl-0.3.adoc index 26b52c2f..e601e80d 100644 --- a/docs/release-notes/rl-0.3.adoc +++ b/docs/release-notes/rl-0.3.adoc @@ -1,3 +1,35 @@ +[[sec-release-0.3]] +== Release 0.3 + +Release 0.3 had to come out beore I wanted it to due to Neovim 0.9 dropping into nixpkgs-unstable. The treesitter changes +have prompted a treesitter rework, which was followed by reworking the languages system. Most of the changes to those are downstreamed +from the original repository. The feature requests that was originally planned for 0.3 have been moved to 0.4, which +should come out soon. + +[[sec-release-0.3-changelog]] +=== Changelog + +* We have transitioned to flake-parts, from flake-utils to extend the flexibility of this flake. This means the flake structure +is different than usual, but the functionality remains the same. + +* We now provide a home-manager module. Do note that it is still far from perfect, but it works. + +* `nodejs_16` is now bundled with `Copilot.lua` if the user has enabled Copilot assistant. + +* which-key section titles have been fixed. This is to be changed once again in a possible keybind rewrite, but now it should +display the correct titles instad of `+prefix` + +* Most of `presence.nvim`'s options have been made fully configurable through your configuration file. + +* Most of the modules have been refactored to separate `config` and `options` attributes. + +* Darwin has been deprecated as the zig package is marked as broken. We will attempt to use the zig overlay to return Darwin +support. + +* `Fidget.nvim` has been added as a neat visual addition for LSP installations. + +* `diffview.nvim` has been added to provide a convenient diff utility. + * Treesitter grammars are now configurable with <>. Utilizes the nixpkgs `nvim-treesitter` plugin rather than a custom input in order to take advantage of build support of pinned versions. See https://discourse.nixos.org/t/psa-if-you-are-on-unstable-try-out-nvim-treesitter-withallgrammars/23321?u=snowytrees[discourse] for more information. Packages can be found under the `pkgs.vimPlugins.nvim-treesitter.builtGrammars` attribute. Treesitter grammars for supported languages should be enabled within the module. By default no grammars are installed, thus the following grammars which do not have a language section are not included anymore: comment, toml, make, html, css, graphql, json. * A new section has been added for language support: `vim.languages.`. The options <>, <>, etc. will enable the respective section for all languages that have been enabled. @@ -9,9 +41,35 @@ * Removed the plugins document in the docs. Was too unwieldy to keep updated. - * `vim.visual.lspkind` has been moved to <> * Improved handling of completion formatting. When setting <>, can also include optional menu mapping. And can provide your own function with <>. * For <> and <> turning them off should use `null` rather than `""` now. + +* Transparency has been made optional and has been disabled by default. <> option can be used to enable or +disable transparency for your configuration. + +* Fixed deprecated configuration method for Tokyonight, and added new style "moon" + +* Dart language support as well as extended flutter support has been added. Thanks to @FlafyDev for his contributions towards Dart +language support. + +* Elixir language support has been added through `elixir-tools.nvim`. + +* `hop.nvim` and `leap.nvim` have been added for fast navigation. + +* `modes.nvim` has been added to the UI plugins as a minor error highlighter. + +* `smartcollumn.nvim` has been added to dynamically display a colorcolumn when the limit has been exceeded, providing +per-buftype column position and more. + +* `project.nvim` has been added for better project management inside Neovim. + +* More configuration options have been added to `nvim-session-manager`. + +* Editorconfig support has been added to the core functionality, with an enable option. + +* `venn-nvim` has been dropped due to broken keybinds. + + diff --git a/docs/release-notes/rl-0.4.adoc b/docs/release-notes/rl-0.4.adoc new file mode 100644 index 00000000..ddf5f75b --- /dev/null +++ b/docs/release-notes/rl-0.4.adoc @@ -0,0 +1,15 @@ +[[sec-release-0.4]] +== Release 0.4 + +Release notes for release 0.4 + + +[[sec-release-0.4-changelog]] +=== Changelog + + +ttps://github.com/horriblename[horriblename]: + +* Added `clangd` as alternative lsp for C/++. + +* Added `toggleterm` integration for `lazygit`. diff --git a/extra.nix b/extra.nix index 0bcd9241..767d5dd6 100644 --- a/extra.nix +++ b/extra.nix @@ -91,6 +91,7 @@ inputs: let enable = true; name = "catppuccin"; style = "mocha"; + transparent = false; }; vim.autopairs.enable = true; @@ -127,7 +128,7 @@ inputs: let vim.git = { enable = true; gitsigns.enable = true; - gitsigns.codeActions = true; + gitsigns.codeActions = false; # throws an annoying debug message }; vim.minimap = { @@ -151,7 +152,6 @@ inputs: let vim.utility = { colorizer.enable = true; icon-picker.enable = true; - venn-nvim.enable = false; # FIXME throws an error when its commands are ran manually diffview-nvim.enable = true; motion = { hop.enable = true; @@ -167,7 +167,10 @@ inputs: let }; vim.terminal = { - toggleterm.enable = true; + toggleterm = { + enable = true; + lazygit.enable = true; + }; }; vim.ui = { diff --git a/flake.lock b/flake.lock index 30139394..4e4fbde1 100644 --- a/flake.lock +++ b/flake.lock @@ -1355,7 +1355,6 @@ "toggleterm-nvim": "toggleterm-nvim", "tokyonight": "tokyonight", "trouble": "trouble", - "venn-nvim": "venn-nvim", "vim-markdown": "vim-markdown", "vim-repeat": "vim-repeat", "vim-startify": "vim-startify", @@ -1652,22 +1651,6 @@ "type": "github" } }, - "venn-nvim": { - "flake": false, - "locked": { - "lastModified": 1669127905, - "narHash": "sha256-Ks5qUaI0MrhVC2AhVsReVwC/2WArXqIQ36CcCSCyzAk=", - "owner": "jbyuki", - "repo": "venn.nvim", - "rev": "c114563960b8fb1197695d42798d1f3e7190b798", - "type": "github" - }, - "original": { - "owner": "jbyuki", - "repo": "venn.nvim", - "type": "github" - } - }, "vim-markdown": { "flake": false, "locked": { diff --git a/flake.nix b/flake.nix index 18f712b4..e488e894 100644 --- a/flake.nix +++ b/flake.nix @@ -383,11 +383,6 @@ flake = false; }; - venn-nvim = { - url = "github:jbyuki/venn.nvim"; - flake = false; - }; - icon-picker-nvim = { url = "github:ziontee113/icon-picker.nvim"; flake = false; diff --git a/lib/types/plugins.nix b/lib/types/plugins.nix index 0c1d0d33..f99394fe 100644 --- a/lib/types/plugins.nix +++ b/lib/types/plugins.nix @@ -51,7 +51,6 @@ with lib; let "cinnamon-nvim" "cheatsheet-nvim" "colorizer" - "venn-nvim" "cellular-automaton" "presence-nvim" "icon-picker-nvim" diff --git a/modules/basic/config.nix b/modules/basic/config.nix index a1db94b9..435b715c 100644 --- a/modules/basic/config.nix +++ b/modules/basic/config.nix @@ -133,8 +133,8 @@ in { set termguicolors set t_Co=256 ''} - ${optionalString cfg.enableEditorconfig '' - vim.g.editorconfig = false + ${optionalString (!cfg.enableEditorconfig) '' + let g:editorconfig = v:false ''} ''; }; diff --git a/modules/basic/module.nix b/modules/basic/module.nix index 82dd802e..443abeeb 100644 --- a/modules/basic/module.nix +++ b/modules/basic/module.nix @@ -141,7 +141,7 @@ with builtins; { }; enableEditorconfig = mkOption { type = types.bool; - default = false; + default = true; description = "Follow editorconfig rules in current directory"; }; }; diff --git a/modules/languages/clang.nix b/modules/languages/clang.nix index a9d11919..a779dd59 100644 --- a/modules/languages/clang.nix +++ b/modules/languages/clang.nix @@ -16,8 +16,19 @@ with builtins; let lspconfig.ccls.setup{ capabilities = capabilities; on_attach=default_on_attach; - cmd = {"${pkgs.ccls}/bin/ccls"}; - ${optionalString (cfg.lsp.opts != null) "init_options = ${cfg.lsp.cclsOpts}"} + cmd = {"${cfg.lsp.package}/bin/ccls"}; + ${optionalString (cfg.lsp.opts != null) "init_options = ${cfg.lsp.opts}"} + } + ''; + }; + clangd = { + package = pkgs.clang-tools; + lspConfig = '' + lspconfig.clangd.setup{ + capabilities = capabilities; + on_attach=default_on_attach; + cmd = {"${cfg.lsp.package}/bin/clangd"}; + ${optionalString (cfg.lsp.opts != null) "init_options = ${cfg.lsp.opts}"} } ''; }; diff --git a/modules/languages/python.nix b/modules/languages/python.nix index ab80ca67..367391e5 100644 --- a/modules/languages/python.nix +++ b/modules/languages/python.nix @@ -64,7 +64,11 @@ in { type = with types; enum (attrNames servers); default = defaultServer; }; - package = nvim.types.mkGrammarOption pkgs "python"; + package = mkOption { + description = "python LSP server package"; + type = types.package; + default = servers.${cfg.lsp.server}.package; + }; }; format = { diff --git a/modules/languages/ts.nix b/modules/languages/ts.nix index d1c97961..ecb8f026 100644 --- a/modules/languages/ts.nix +++ b/modules/languages/ts.nix @@ -55,7 +55,7 @@ with builtins; let }; in { options.vim.languages.ts = { - enable = mkEnableOption "SQL language support"; + enable = mkEnableOption "Typescript/Javascript language support"; treesitter = { enable = mkOption { diff --git a/modules/languages/zig.nix b/modules/languages/zig.nix index 0ce85db8..02410bed 100644 --- a/modules/languages/zig.nix +++ b/modules/languages/zig.nix @@ -28,7 +28,7 @@ in { package = mkOption { description = "ZLS package"; type = types.package; - default = pkgs.nodePackages.pyright; + default = pkgs.zls; }; zigPackage = mkOption { description = "Zig package used by ZLS"; @@ -37,7 +37,6 @@ in { }; }; }; - config = mkIf cfg.enable (mkMerge [ (mkIf cfg.treesitter.enable { vim.treesitter.enable = true; diff --git a/modules/lsp/null-ls/config.nix b/modules/lsp/null-ls/config.nix index 7f1289ab..1602f248 100644 --- a/modules/lsp/null-ls/config.nix +++ b/modules/lsp/null-ls/config.nix @@ -21,6 +21,7 @@ in { ''; vim.luaConfigRC.null_ls = nvim.dag.entryAfter ["null_ls-setup" "lsp-setup"] '' require('null-ls').setup({ + debug = false, diagnostics_format = "[#{m}] #{s} (#{c})", debounce = 250, default_timeout = 5000, diff --git a/modules/terminal/toggleterm/config.nix b/modules/terminal/toggleterm/config.nix index e60b9b40..6e049a20 100644 --- a/modules/terminal/toggleterm/config.nix +++ b/modules/terminal/toggleterm/config.nix @@ -6,33 +6,64 @@ with lib; with builtins; let cfg = config.vim.terminal.toggleterm; + toggleKey = ""; in { - config = mkIf cfg.enable { - vim.startPlugins = [ - "toggleterm-nvim" - ]; + config = mkMerge [ + ( + mkIf cfg.enable { + vim.startPlugins = [ + "toggleterm-nvim" + ]; + + vim.maps.normal = mkBinding cfg.mappings.open "execute v:count . \"ToggleTerm\"" "Toggle terminal"; - vim.luaConfigRC.toggleterm = nvim.dag.entryAnywhere '' - require("toggleterm").setup({ - open_mapping = null, - direction = '${toString cfg.direction}', - -- TODO: this should probably be turned into a module that uses the lua function if and only if the user has not set it - size = function(term) - if term.direction == "horizontal" then - return 15 - elseif term.direction == "vertical" then - return vim.o.columns * 0.4 - end - end, - winbar = { - enabled = '${toString cfg.enable_winbar}', - name_formatter = function(term) -- term: Terminal - return term.name - end - }, - }) - ''; + vim.luaConfigRC.toggleterm = nvim.dag.entryAnywhere '' + require("toggleterm").setup({ + open_mapping = null, + direction = '${toString cfg.direction}', + -- TODO: this should probably be turned into a module that uses the lua function if and only if the user has not set it + size = function(term) + if term.direction == "horizontal" then + return 15 + elseif term.direction == "vertical" then + return vim.o.columns * 0.4 + end + end, + winbar = { + enabled = '${toString cfg.enable_winbar}', + name_formatter = function(term) -- term: Terminal + return term.name + end + }, + }) + ''; + } + ) + ( + mkIf (cfg.enable && cfg.lazygit.enable) + { + vim.startPlugins = lib.optionals (cfg.lazygit.package != null) [ + cfg.lazygit.package + ]; + vim.luaConfigRC.toggleterm-lazygit = nvim.dag.entryAfter ["toggleterm"] '' + local terminal = require 'toggleterm.terminal' + local lazygit = terminal.Terminal:new({ + cmd = '${ + if (cfg.lazygit.package != null) + then getExe cfg.lazygit.package + else "lazygit" + }', + direction = '${cfg.lazygit.direction}', + hidden = true, + on_open = function(term) + vim.cmd("startinsert!") + vim.keymap.set( 't', [[${toggleKey}]], function() term:toggle() end, {silent = true, noremap = true, buffer = term.bufnr}) + end + }) - vim.maps.normal = mkBinding cfg.mappings.open "execute v:count . \"ToggleTerm\"" "Toggle terminal"; - }; + vim.keymap.set( 'n', [[gg]], function() lazygit:toggle() end, {silent = true, noremap = true}) + ''; + } + ) + ]; } diff --git a/modules/terminal/toggleterm/toggleterm.nix b/modules/terminal/toggleterm/toggleterm.nix index d563e225..347d579d 100644 --- a/modules/terminal/toggleterm/toggleterm.nix +++ b/modules/terminal/toggleterm/toggleterm.nix @@ -1,4 +1,5 @@ { + pkgs, config, lib, ... @@ -24,5 +25,18 @@ with builtins; { default = false; description = "Enable winbar"; }; + lazygit = { + enable = mkEnableOption "Enable LazyGit integration"; + direction = mkOption { + type = types.enum ["horizontal" "vertical" "tab" "float"]; + default = "float"; + description = "Direction of the lazygit window"; + }; + package = mkOption { + type = with types; nullOr package; + default = pkgs.lazygit; + description = "The package that should be used for lazygit. Setting it to null will attempt to use lazygit from your PATH"; + }; + }; }; } diff --git a/modules/theme/supported_themes.nix b/modules/theme/supported_themes.nix index 814b4124..10e0f6ce 100644 --- a/modules/theme/supported_themes.nix +++ b/modules/theme/supported_themes.nix @@ -1,6 +1,9 @@ {lib}: { onedark = { - setup = {style ? "dark"}: '' + setup = { + style ? "dark", + transparent, + }: '' -- OneDark theme require('onedark').setup { style = "${style}" @@ -11,12 +14,13 @@ }; tokyonight = { - setup = {style ? "night"}: '' - -- need to set style before colorscheme to apply - vim.g.tokyonight_style = '${style}' - vim.cmd[[colorscheme tokyonight]] + setup = { + style ? "night", + transparent, + }: '' + vim.cmd[[colorscheme tokyonight-${style}]] ''; - styles = ["day" "night" "storm"]; + styles = ["day" "night" "storm" "moon"]; }; dracula = { @@ -34,7 +38,7 @@ -- Catppuccin theme require('catppuccin').setup { flavour = "${style}", - transparent_background = "${builtins.toString transparent}", + transparent_background = ${lib.boolToString transparent}, integrations = { nvimtree = { enabled = true, diff --git a/modules/theme/theme.nix b/modules/theme/theme.nix index 06a5dd5f..6dcb66df 100644 --- a/modules/theme/theme.nix +++ b/modules/theme/theme.nix @@ -40,6 +40,8 @@ in { config = mkIf cfg.enable { vim.startPlugins = [cfg.name]; vim.luaConfigRC.themeSetup = nvim.dag.entryBefore ["theme"] cfg.extraConfig; - vim.luaConfigRC.theme = supported_themes.${cfg.name}.setup {style = cfg.style;}; + vim.luaConfigRC.theme = supported_themes.${cfg.name}.setup (with cfg; { + inherit style transparent; + }); }; } diff --git a/modules/utility/default.nix b/modules/utility/default.nix index 87fce551..1bd03c64 100644 --- a/modules/utility/default.nix +++ b/modules/utility/default.nix @@ -7,7 +7,6 @@ _: { ./colorizer ./icon-picker ./telescope - ./venn ./diffview ]; } diff --git a/modules/utility/venn/config.nix b/modules/utility/venn/config.nix deleted file mode 100644 index 1bd958db..00000000 --- a/modules/utility/venn/config.nix +++ /dev/null @@ -1,42 +0,0 @@ -{ - config, - lib, - ... -}: -with lib; -with builtins; let - cfg = config.vim.utility.venn-nvim; -in { - config = mkIf (cfg.enable) { - vim.startPlugins = [ - "venn-nvim" - ]; - - # TODO: https://github.com/jbyuki/venn.nvim#using-toggle-command - # add keybindings for drawing diagrams - vim.luaConfigRC.venn-nvim = nvim.dag.entryAnywhere '' - local venn = require('venn') - -- venn.nvim: enable or disable keymappings - function _G.Toggle_venn() - local venn_enabled = vim.inspect(vim.b.venn_enabled) - if venn_enabled == "nil" then - vim.b.venn_enabled = true - vim.cmd[[setlocal ve=all]] - -- draw a line on HJKL keystokes - vim.api.nvim_buf_set_keymap(0, "n", "J", "j:VBox", {noremap = true}) - vim.api.nvim_buf_set_keymap(0, "n", "K", "k:VBox", {noremap = true}) - vim.api.nvim_buf_set_keymap(0, "n", "L", "l:VBox", {noremap = true}) - vim.api.nvim_buf_set_keymap(0, "n", "H", "h:VBox", {noremap = true}) - -- draw a box by pressing "f" with visual selection - vim.api.nvim_buf_set_keymap(0, "v", "f", ":VBox", {noremap = true}) - else - vim.cmd[[setlocal ve=]] - vim.cmd[[mapclear ]] - vim.b.venn_enabled = nil - end - end - -- toggle keymappings for venn using v - vim.api.nvim_set_keymap('n', 'v', ":lua Toggle_venn()", { noremap = true}) - ''; - }; -} diff --git a/modules/utility/venn/default.nix b/modules/utility/venn/default.nix deleted file mode 100644 index de4dff0c..00000000 --- a/modules/utility/venn/default.nix +++ /dev/null @@ -1,6 +0,0 @@ -_: { - imports = [ - ./config.nix - ./venn.nix - ]; -} diff --git a/modules/utility/venn/venn.nix b/modules/utility/venn/venn.nix deleted file mode 100644 index 8885f644..00000000 --- a/modules/utility/venn/venn.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ - config, - lib, - ... -}: -with lib; -with builtins; { - options.vim.utility.venn-nvim = { - enable = mkEnableOption "Enable venn.nvim: draw ASCII diagrams in Neovim"; - }; -}