diff --git a/extra.nix b/extra.nix index 2875a1c..c414da9 100644 --- a/extra.nix +++ b/extra.nix @@ -141,6 +141,7 @@ inputs: let icon-picker.enable = true; venn-nvim.enable = false; # FIXME throws an error when its commands are ran manually diffview-nvim.enable = true; + hop.enable = true; }; vim.notes = { @@ -180,7 +181,7 @@ inputs: let presence-nvim = { enable = true; auto_update = true; - image_text = "The One True Text Editor"; + image_text = "The Superior Text Editor"; client_id = "793271441293967371"; main_image = "neovim"; rich_presence = { diff --git a/flake.lock b/flake.lock index abf2f75..336aae8 100644 --- a/flake.lock +++ b/flake.lock @@ -496,6 +496,22 @@ "type": "github" } }, + "hop-nvim": { + "flake": false, + "locked": { + "lastModified": 1667151642, + "narHash": "sha256-UZZlo5n1x8UfM9OP7RHfT3sFRfMpLkBLbEdcSO+SU6E=", + "owner": "phaazon", + "repo": "hop.nvim", + "rev": "90db1b2c61b820e230599a04fedcd2679e64bd07", + "type": "github" + }, + "original": { + "owner": "phaazon", + "repo": "hop.nvim", + "type": "github" + } + }, "icon-picker-nvim": { "flake": false, "locked": { @@ -1262,6 +1278,7 @@ "gesture-nvim": "gesture-nvim", "gitsigns-nvim": "gitsigns-nvim", "glow-nvim": "glow-nvim", + "hop-nvim": "hop-nvim", "icon-picker-nvim": "icon-picker-nvim", "indent-blankline": "indent-blankline", "kommentary": "kommentary", diff --git a/flake.nix b/flake.nix index 8133e14..533988c 100644 --- a/flake.nix +++ b/flake.nix @@ -10,12 +10,11 @@ systems = [ "x86_64-linux" "aarch64-linux" - /* - FIXME: zig compiler - therefore the maximal version - is broken on darwin - see https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/compilers/zig/0.10.nix#L70 - "x86_64-darwin" - "aarch64-darwin" - */ + + # FIXME: zig compiler - therefore the maximal version - is broken on darwin + # see https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/compilers/zig/0.10.nix#L70 + # "x86_64-darwin" + # "aarch64-darwin" ]; imports = [ @@ -397,8 +396,12 @@ flake = false; }; - # Note-taking + hop-nvim = { + url = "github:phaazon/hop.nvim"; + flake = false; + }; + # Note-taking obsidian-nvim = { url = "github:epwalsh/obsidian.nvim"; flake = false; diff --git a/lib/types/plugins.nix b/lib/types/plugins.nix index f9afa32..ca6303f 100644 --- a/lib/types/plugins.nix +++ b/lib/types/plugins.nix @@ -73,6 +73,7 @@ with lib; let "diffview-nvim" "todo-comments" "flutter-tools" + "hop-nvim" ]; # You can either use the name of the plugin or a package. pluginsType = with types; listOf (nullOr (either (enum availablePlugins) package)); diff --git a/modules/utility/default.nix b/modules/utility/default.nix index f2f0e2f..b5a95b2 100644 --- a/modules/utility/default.nix +++ b/modules/utility/default.nix @@ -8,5 +8,6 @@ _: { ./telescope ./venn ./diffview + ./hop ]; } diff --git a/modules/utility/hop/config.nix b/modules/utility/hop/config.nix new file mode 100644 index 0000000..63c9d38 --- /dev/null +++ b/modules/utility/hop/config.nix @@ -0,0 +1,21 @@ +{ + config, + lib, + pkgs, + ... +}: +with lib; let + cfg = config.vim.utility.hop; +in { + config = mkIf cfg.enable { + vim.startPlugins = ["hop-nvim"]; + + vim.nnoremap = { + "h" = " HopPattern"; + }; + + vim.luaConfigRC.hop-nvim = nvim.dag.entryAnywhere '' + require('hop').setup() + ''; + }; +} diff --git a/modules/utility/hop/default.nix b/modules/utility/hop/default.nix new file mode 100644 index 0000000..f4cfb47 --- /dev/null +++ b/modules/utility/hop/default.nix @@ -0,0 +1,6 @@ +_: { + imports = [ + ./hop.nix + ./config.nix + ]; +} diff --git a/modules/utility/hop/hop.nix b/modules/utility/hop/hop.nix new file mode 100644 index 0000000..cc1b777 --- /dev/null +++ b/modules/utility/hop/hop.nix @@ -0,0 +1,16 @@ +{ + config, + lib, + pkgs, + ... +}: +with lib; let + cfg = config.vim.utility.hop; +in { + options.vim.utility.hop = { + enable = mkOption { + type = types.bool; + description = "Enable Hop plugin (easy motion)"; + }; + }; +}