add lazygit and telescope
This commit is contained in:
parent
782db01732
commit
5a0a691361
3 changed files with 237 additions and 0 deletions
|
|
@ -10,5 +10,11 @@
|
||||||
|
|
||||||
# Syntax Highlighting
|
# Syntax Highlighting
|
||||||
./plugins/treesitter/default.nix
|
./plugins/treesitter/default.nix
|
||||||
|
|
||||||
|
# Git
|
||||||
|
./plugins/git/lazygit.nix
|
||||||
|
|
||||||
|
# Utils
|
||||||
|
./plugins/utils/telescope.nix
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
21
config/plugins/git/lazygit.nix
Normal file
21
config/plugins/git/lazygit.nix
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
{ pkgs, ... }: {
|
||||||
|
|
||||||
|
extraPlugins = with pkgs.vimPlugins; [
|
||||||
|
lazygit-nvim
|
||||||
|
];
|
||||||
|
|
||||||
|
extraConfigLua = ''
|
||||||
|
require("telescope").load_extension("lazygit")
|
||||||
|
'';
|
||||||
|
|
||||||
|
keymaps = [
|
||||||
|
{
|
||||||
|
mode = "n";
|
||||||
|
key = "<leader>gg";
|
||||||
|
action = "<cmd>LazyGit<CR>";
|
||||||
|
options = {
|
||||||
|
desc = "LazyGit (root dir)";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
210
config/plugins/utils/telescope.nix
Normal file
210
config/plugins/utils/telescope.nix
Normal file
|
|
@ -0,0 +1,210 @@
|
||||||
|
{
|
||||||
|
plugins.telescope = {
|
||||||
|
enable = true;
|
||||||
|
extensions = {
|
||||||
|
file-browser = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
fzf-native = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
settings = {
|
||||||
|
defaults = {
|
||||||
|
layout_config = {
|
||||||
|
horizontal = {
|
||||||
|
prompt_position = "top";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
sorting_strategy = "ascending";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
keymaps = {
|
||||||
|
"<leader><space>" = {
|
||||||
|
action = "find_files, {}";
|
||||||
|
options = {
|
||||||
|
desc = "Find project files";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
"<leader>/" = {
|
||||||
|
action = "live_grep";
|
||||||
|
options = {
|
||||||
|
desc = "Grep (root dir)";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
"<leader>:" = {
|
||||||
|
action = "command_history, {}";
|
||||||
|
options = {
|
||||||
|
desc = "Command History";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
"<leader>b" = {
|
||||||
|
action = "buffers, {}";
|
||||||
|
options = {
|
||||||
|
desc = "+buffer";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
"<leader>ff" = {
|
||||||
|
action = "find_files, {}";
|
||||||
|
options = {
|
||||||
|
desc = "Find project files";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
"<leader>fr" = {
|
||||||
|
action = "live_grep, {}";
|
||||||
|
options = {
|
||||||
|
desc = "Find text";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
"<leader>fR" = {
|
||||||
|
action = "resume, {}";
|
||||||
|
options = {
|
||||||
|
desc = "Resume";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
"<leader>fg" = {
|
||||||
|
action = "oldfiles, {}";
|
||||||
|
options = {
|
||||||
|
desc = "Recent";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
"<leader>fb" = {
|
||||||
|
action = "buffers, {}";
|
||||||
|
options = {
|
||||||
|
desc = "Buffers";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
"<C-p>" = {
|
||||||
|
action = "git_files, {}";
|
||||||
|
options = {
|
||||||
|
desc = "Search git files";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
"<leader>gc" = {
|
||||||
|
action = "git_commits, {}";
|
||||||
|
options = {
|
||||||
|
desc = "Commits";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
"<leader>gs" = {
|
||||||
|
action = "git_status, {}";
|
||||||
|
options = {
|
||||||
|
desc = "Status";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
"<leader>sa" = {
|
||||||
|
action = "autocommands, {}";
|
||||||
|
options = {
|
||||||
|
desc = "Auto Commands";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
"<leader>sb" = {
|
||||||
|
action = "current_buffer_fuzzy_find, {}";
|
||||||
|
options = {
|
||||||
|
desc = "Buffer";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
"<leader>sc" = {
|
||||||
|
action = "command_history, {}";
|
||||||
|
options = {
|
||||||
|
desc = "Command History";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
"<leader>sC" = {
|
||||||
|
action = "commands, {}";
|
||||||
|
options = {
|
||||||
|
desc = "Commands";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
"<leader>sD" = {
|
||||||
|
action = "diagnostics, {}";
|
||||||
|
options = {
|
||||||
|
desc = "Workspace diagnostics";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
"<leader>sh" = {
|
||||||
|
action = "help_tags, {}";
|
||||||
|
options = {
|
||||||
|
desc = "Help pages";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
"<leader>sH" = {
|
||||||
|
action = "highlights, {}";
|
||||||
|
options = {
|
||||||
|
desc = "Search Highlight Groups";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
"<leader>sk" = {
|
||||||
|
action = "keymaps, {}";
|
||||||
|
options = {
|
||||||
|
desc = "Keymaps";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
"<leader>sM" = {
|
||||||
|
action = "man_pages, {}";
|
||||||
|
options = {
|
||||||
|
desc = "Man pages";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
"<leader>sm" = {
|
||||||
|
action = "marks, {}";
|
||||||
|
options = {
|
||||||
|
desc = "Jump to Mark";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
"<leader>so" = {
|
||||||
|
action = "vim_options, {}";
|
||||||
|
options = {
|
||||||
|
desc = "Options";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
"<leader>sR" = {
|
||||||
|
action = "resume, {}";
|
||||||
|
options = {
|
||||||
|
desc = "Resume";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
"<leader>uC" = {
|
||||||
|
action = "colorscheme, {}";
|
||||||
|
options = {
|
||||||
|
desc = "Colorscheme preview";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
keymaps = [
|
||||||
|
{
|
||||||
|
mode = "n";
|
||||||
|
key = "<leader>sd";
|
||||||
|
action = "<cmd>Telescope diagnostics bufnr=0<cr>";
|
||||||
|
options = {
|
||||||
|
desc = "Document diagnostics";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
{
|
||||||
|
mode = "n";
|
||||||
|
key = "<leader>fe";
|
||||||
|
action = "<cmd>Telescope file_browser<cr>";
|
||||||
|
options = {
|
||||||
|
desc = "File browser";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
{
|
||||||
|
mode = "n";
|
||||||
|
key = "<leader>fE";
|
||||||
|
action = "<cmd>Telescope file_browser path=%:p:h select_buffer=true<cr>";
|
||||||
|
options = {
|
||||||
|
desc = "File browser";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
];
|
||||||
|
extraConfigLua = ''
|
||||||
|
require("telescope").setup{
|
||||||
|
pickers = {
|
||||||
|
colorscheme = {
|
||||||
|
enable_preview = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue