Merge remote-tracking branch 'origin/nixos' into nixos
This commit is contained in:
commit
e1e4ba64ac
8 changed files with 101 additions and 46 deletions
|
|
@ -1,7 +1,6 @@
|
|||
{ config
|
||||
, lib
|
||||
, pkgs
|
||||
, inputs
|
||||
, ...
|
||||
}:
|
||||
|
||||
|
|
@ -9,12 +8,18 @@ with lib;
|
|||
let
|
||||
cfg = config.my.programs.nvim;
|
||||
|
||||
mkPlugin = name: {
|
||||
plugin = pkgs.vimPlugins.${name};
|
||||
type = "lua";
|
||||
config = lib.readFile (./plugins + "/${name}.lua");
|
||||
};
|
||||
|
||||
mkPlugin = fileName:
|
||||
let
|
||||
path = ./plugins + "/${fileName}";
|
||||
pluginName = lib.removeSuffix ".lua" fileName;
|
||||
in
|
||||
{
|
||||
plugin = pkgs.vimPlugins.${pluginName};
|
||||
type = "lua";
|
||||
config = lib.readFile path;
|
||||
};
|
||||
pluginFileNames = builtins.attrNames (builtins.readDir ./plugins);
|
||||
pluginsWithConfig = builtins.map mkPlugin pluginFileNames;
|
||||
in
|
||||
{
|
||||
options.my.programs.nvim.enable = mkEnableOption "nvim";
|
||||
|
|
@ -53,29 +58,7 @@ in
|
|||
taplo
|
||||
yamlfmt
|
||||
];
|
||||
plugins = builtins.map mkPlugin [
|
||||
"catppuccin-nvim"
|
||||
"comment-nvim"
|
||||
"copilot-lua"
|
||||
"dashboard-nvim"
|
||||
"formatter-nvim"
|
||||
"gitsigns-nvim"
|
||||
"lualine-nvim"
|
||||
"noice-nvim"
|
||||
"nvim-autopairs"
|
||||
"nvim-lastplace"
|
||||
"nvim-surround"
|
||||
"nvim-tree-lua"
|
||||
"nvim-treesitter-textsubjects"
|
||||
"nvim-ts-context-commentstring"
|
||||
"orgmode"
|
||||
"smartcolumn-nvim"
|
||||
"telescope-fzf-native-nvim"
|
||||
"telescope-nvim"
|
||||
"telescope-zoxide"
|
||||
"which-key-nvim"
|
||||
"todo-comments-nvim"
|
||||
] ++ (with pkgs.vimPlugins; [
|
||||
plugins = with pkgs.vimPlugins; [
|
||||
cmp-nvim-lsp
|
||||
cmp_luasnip
|
||||
copilot-cmp
|
||||
|
|
@ -86,17 +69,18 @@ in
|
|||
lspsaga-nvim-original
|
||||
lualine-lsp-progress
|
||||
luasnip
|
||||
nui-nvim # for noice-nvim
|
||||
nui-nvim
|
||||
nvim-cmp
|
||||
nvim-lspconfig
|
||||
nvim-treesitter.withAllGrammars
|
||||
nvim-ufo
|
||||
nvim-web-devicons # for dashboard-nvim
|
||||
plenary-nvim # for telescope, neogit
|
||||
nvim-web-devicons
|
||||
plenary-nvim
|
||||
popup-nvim
|
||||
promise-async
|
||||
vim-fugitive
|
||||
vim-lion
|
||||
]);
|
||||
] ++ pluginsWithConfig;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
|||
18
modules/programs/nvim/plugins/advanced-git-search-nvim.lua
Normal file
18
modules/programs/nvim/plugins/advanced-git-search-nvim.lua
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
require("telescope").load_extension("advanced_git_search")
|
||||
local advanced_git_search = require("telescope").extensions.advanced_git_search
|
||||
vim.api.nvim_create_user_command(
|
||||
"DiffCommitLine",
|
||||
"lua require('telescope').extensions.advanced_git_search.diff_commit_line()",
|
||||
{ range = true }
|
||||
)
|
||||
require("which-key").register({
|
||||
g = {
|
||||
name = "git",
|
||||
b = { advanced_git_search.diff_branch_file, "diff branch file" },
|
||||
l = { vim.cmd.DiffCommitLine, "diff commit line", mode = "v" },
|
||||
f = { advanced_git_search.diff_commit_file, "diff commit file" },
|
||||
c = { advanced_git_search.search_log_content, "search log content" },
|
||||
C = { advanced_git_search.search_log_content_file, "search log content current file" },
|
||||
r = { advanced_git_search.checkout_reflog, "checkout reflog" },
|
||||
},
|
||||
}, { prefix = "<leader>" })
|
||||
Loading…
Add table
Add a link
Reference in a new issue