nvim: add nvim-treesitter-textsubjects
parent
6f28bd821e
commit
2fe2b60fd4
17
flake.lock
17
flake.lock
|
@ -666,6 +666,22 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"nvim-treesitter-textsubjects": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1676144693,
|
||||||
|
"narHash": "sha256-4jb9v0xpO17wp85dzojKUQ6hUdNBx3T2tB4fSWoANus=",
|
||||||
|
"owner": "RRethy",
|
||||||
|
"repo": "nvim-treesitter-textsubjects",
|
||||||
|
"rev": "b913508f503527ff540f7fe2dcf1bf1d1f259887",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "RRethy",
|
||||||
|
"repo": "nvim-treesitter-textsubjects",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"pre-commit-hooks": {
|
"pre-commit-hooks": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-compat": "flake-compat",
|
"flake-compat": "flake-compat",
|
||||||
|
@ -757,6 +773,7 @@
|
||||||
"neovim": "neovim",
|
"neovim": "neovim",
|
||||||
"nil": "nil",
|
"nil": "nil",
|
||||||
"nixpkgs": "nixpkgs_8",
|
"nixpkgs": "nixpkgs_8",
|
||||||
|
"nvim-treesitter-textsubjects": "nvim-treesitter-textsubjects",
|
||||||
"pre-commit-hooks": "pre-commit-hooks_3",
|
"pre-commit-hooks": "pre-commit-hooks_3",
|
||||||
"stable": "stable",
|
"stable": "stable",
|
||||||
"utils": "utils_2"
|
"utils": "utils_2"
|
||||||
|
|
|
@ -56,6 +56,11 @@
|
||||||
hyprland.url = "github:hyprwm/Hyprland";
|
hyprland.url = "github:hyprwm/Hyprland";
|
||||||
hyprpaper.url = "github:hyprwm/hyprpaper";
|
hyprpaper.url = "github:hyprwm/hyprpaper";
|
||||||
hypr-contrib.url = "github:hyprwm/contrib";
|
hypr-contrib.url = "github:hyprwm/contrib";
|
||||||
|
|
||||||
|
nvim-treesitter-textsubjects = {
|
||||||
|
url = "github:RRethy/nvim-treesitter-textsubjects";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs =
|
outputs =
|
||||||
|
|
|
@ -1,12 +1,27 @@
|
||||||
{ config
|
{ config
|
||||||
, lib
|
, lib
|
||||||
, pkgs
|
, pkgs
|
||||||
|
, inputs
|
||||||
, ...
|
, ...
|
||||||
}:
|
}:
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
let
|
let
|
||||||
cfg = config.my.programs.vim;
|
cfg = config.my.programs.vim;
|
||||||
|
|
||||||
|
mkDate = longDate: (lib.concatStringsSep "-" [
|
||||||
|
(builtins.substring 0 4 longDate)
|
||||||
|
(builtins.substring 4 2 longDate)
|
||||||
|
(builtins.substring 6 2 longDate)
|
||||||
|
]);
|
||||||
|
|
||||||
|
mkVersionInput = input: mkDate (input.lastModifiedDate or "19700101") + "_" + (input.shortRev or "dirty");
|
||||||
|
|
||||||
|
nvim-treesitter-textsubjects = pkgs.vimUtils.buildVimPluginFrom2Nix {
|
||||||
|
pname = "nvim-treesitter-textsubjects";
|
||||||
|
version = mkVersionInput inputs.nvim-treesitter-textsubjects;
|
||||||
|
src = inputs.nvim-treesitter-textsubjects;
|
||||||
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.my.programs.vim = {
|
options.my.programs.vim = {
|
||||||
|
@ -46,6 +61,7 @@ in
|
||||||
nvim-cmp
|
nvim-cmp
|
||||||
nvim-lspconfig
|
nvim-lspconfig
|
||||||
nvim-surround
|
nvim-surround
|
||||||
|
nvim-treesitter-textsubjects
|
||||||
nvim-treesitter.withAllGrammars
|
nvim-treesitter.withAllGrammars
|
||||||
nvim-ts-context-commentstring
|
nvim-ts-context-commentstring
|
||||||
nvim-web-devicons # for dashboard-nvim
|
nvim-web-devicons # for dashboard-nvim
|
||||||
|
|
|
@ -322,3 +322,11 @@ require("nvim-treesitter.configs").setup({
|
||||||
})
|
})
|
||||||
|
|
||||||
require("nvim-surround").setup({})
|
require("nvim-surround").setup({})
|
||||||
|
|
||||||
|
require("nvim-treesitter.configs").setup({
|
||||||
|
textsubjects = {
|
||||||
|
enable = true,
|
||||||
|
prev_selection = ",", -- (Optional) keymap to select the previous selection
|
||||||
|
keymaps = { ["."] = "textsubjects-smart" },
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
Loading…
Reference in New Issue