feat(nvim): add hmts.nvim

This commit is contained in:
Moritz Böhme 2023-08-11 18:59:52 +02:00
parent 31012a6274
commit 0c591c0435
Signed by: moritz
GPG key ID: 970C6E89EB0547A9
6 changed files with 43 additions and 19 deletions

View file

@ -319,6 +319,22 @@
"type": "github" "type": "github"
} }
}, },
"hmts-nvim": {
"flake": false,
"locked": {
"lastModified": 1691525513,
"narHash": "sha256-il5m+GlNt0FzZjefl1q8ZxWHg0+gQps0vigt+eoIy8A=",
"owner": "calops",
"repo": "hmts.nvim",
"rev": "594dd17c870afb7f6517723c8963f6eb144e3c0d",
"type": "github"
},
"original": {
"owner": "calops",
"repo": "hmts.nvim",
"type": "github"
}
},
"home-manager": { "home-manager": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@ -785,6 +801,7 @@
"arkenfox-userjs": "arkenfox-userjs", "arkenfox-userjs": "arkenfox-userjs",
"asus-touchpad-numpad-driver": "asus-touchpad-numpad-driver", "asus-touchpad-numpad-driver": "asus-touchpad-numpad-driver",
"flake-utils": "flake-utils", "flake-utils": "flake-utils",
"hmts-nvim": "hmts-nvim",
"home-manager": "home-manager_2", "home-manager": "home-manager_2",
"hypr-contrib": "hypr-contrib", "hypr-contrib": "hypr-contrib",
"hyprland": "hyprland", "hyprland": "hyprland",

View file

@ -44,6 +44,9 @@
telekasten-nvim.flake = false; telekasten-nvim.flake = false;
telekasten-nvim.url = "github:renerocksai/telekasten.nvim"; telekasten-nvim.url = "github:renerocksai/telekasten.nvim";
hmts-nvim.flake = false;
hmts-nvim.url = "github:calops/hmts.nvim";
# Hyprland # Hyprland
hypr-contrib.url = "github:hyprwm/contrib"; hypr-contrib.url = "github:hyprwm/contrib";
hyprland.url = "github:hyprwm/Hyprland"; hyprland.url = "github:hyprwm/Hyprland";

View file

@ -50,22 +50,22 @@ in
${exportedVariables} ${exportedVariables}
''; '';
functions = { functions = {
gi = with pkgs; '' gi = ''
set url https://www.gitignore.io/api set url https://www.gitignore.io/api
if test (count $argv) -eq 0 if test (count $argv) -eq 0
set choice ( curl -sL $url/list \ set choice ( curl -sL $url/list \
| string split "," \ | string split "," \
| ${fzf}/bin/fzf -m \ | ${getExe pkgs.fzf} -m \
| string join "," ) | string join "," )
else else
set choice (string join "," $argv[1..]) set choice (string join "," $argv[1..])
end end
if ${gum}/bin/gum confirm "Overwrite current .gitignore?" if ${getExe pkgs.gum} confirm "Overwrite current .gitignore?"
${curl}/bin/curl -sL $url/$choice > .gitignore ${getExe pkgs.curl} -sL $url/$choice > .gitignore
else else
${curl}/bin/curl -sL $url/$choice >> .gitignore ${getExe pkgs.curl} -sL $url/$choice >> .gitignore
end end
''; '';
fish_greeting = ""; fish_greeting = "";

View file

@ -12,14 +12,8 @@ let
id = x: x; id = x: x;
listToString = sep: f: list: ''{ ${concatStringsSep sep (map f list)} }''; listToString = sep: f: list: ''{ ${concatStringsSep sep (map f list)} }'';
listToStringOneLine = listToString ", "; listToStringOneLine = listToString ", ";
listToStringMultiLine = listToString ",\n"; listToStringMultiLine' = listToString ",\n" id;
keybinding = keybinding = { key, cmd, func, mode, desc }:
{ key
, cmd
, func
, mode
, desc
}:
let let
cmdString = cmdString =
if cmd != null if cmd != null
@ -62,7 +56,7 @@ let
++ (optional (priority != null) "priority = ${toString priority}") ++ (optional (priority != null) "priority = ${toString priority}")
); );
lazySpecs = listToStringMultiLine id (map lazySpecFromPlugin cfg.plugins); lazySpecs = listToStringMultiLine id (map lazySpecFromPlugin cfg.plugins);
lazy = '' lazy = /* lua */ ''
require("lazy").setup(${lazySpecs}) require("lazy").setup(${lazySpecs})
''; '';
in in

View file

@ -47,7 +47,7 @@ with builtins;
{ key = "<leader>st"; cmd = "<cmd>TodoTelescope<cr>"; desc = "Todo"; } { key = "<leader>st"; cmd = "<cmd>TodoTelescope<cr>"; desc = "Todo"; }
{ {
key = "[q"; key = "[q";
func = ''function() func = /* lua */ ''function()
if require("trouble").is_open() then if require("trouble").is_open() then
require("trouble").previous({ skip_groups = true, jump = true }) require("trouble").previous({ skip_groups = true, jump = true })
else else
@ -58,7 +58,7 @@ with builtins;
} }
{ {
key = "]q"; key = "]q";
func = ''function() func = /* lua */ ''function()
if require("trouble").is_open() then if require("trouble").is_open() then
require("trouble").next({ skip_groups = true, jump = true }) require("trouble").next({ skip_groups = true, jump = true })
else else
@ -200,7 +200,7 @@ with builtins;
{ {
plugin = comment-nvim; plugin = comment-nvim;
event = [ "BufReadPost" "BufNewFile" ]; event = [ "BufReadPost" "BufNewFile" ];
conf = '' conf = /* lua */ ''
require("Comment").setup() require("Comment").setup()
''; '';
} }
@ -243,14 +243,14 @@ with builtins;
{ {
plugin = nvim-surround; plugin = nvim-surround;
event = [ "BufReadPost" "BufNewFile" ]; event = [ "BufReadPost" "BufNewFile" ];
conf = '' conf = /* lua */ ''
require("nvim-surround").setup({}) require("nvim-surround").setup({})
''; '';
} }
{ {
plugin = nvim-treesitter-context; plugin = nvim-treesitter-context;
event = [ "BufReadPost" "BufNewFile" ]; event = [ "BufReadPost" "BufNewFile" ];
conf = '' conf = /* lua */ ''
require("treesitter-context").setup({}) require("treesitter-context").setup({})
''; '';
} }
@ -258,5 +258,9 @@ with builtins;
plugin = dressing-nvim; plugin = dressing-nvim;
event = [ "VeryLazy" ]; event = [ "VeryLazy" ];
} }
{
plugin = hmts-nvim;
ft = [ "nix" ];
}
]; ];
} }

View file

@ -21,5 +21,11 @@ with lib.my;
version = mkVersionInput inputs.telekasten-nvim; version = mkVersionInput inputs.telekasten-nvim;
src = inputs.telekasten-nvim; src = inputs.telekasten-nvim;
}; };
hmts-nvim = prev.vimUtils.buildVimPluginFrom2Nix {
pname = "hmts-nvim";
version = mkVersionInput inputs.hmts-nvim;
src = inputs.hmts-nvim;
};
}; };
} }