Compare commits

...

4 commits

Author SHA1 Message Date
♥ Minnie ♥ cacb3603a6
Update README.md 2024-08-06 21:06:54 +08:00
♥ Minnie ♥ 72d5468119
Update gitsigns 2024-08-06 21:06:23 +08:00
♥ Minnie ♥ aad30182e6
Update lualine 2024-08-06 16:05:45 +08:00
♥ Minnie ♥ 8ca815550f
Update telescope 2024-08-06 13:11:01 +08:00
6 changed files with 205 additions and 25 deletions

View file

@ -35,4 +35,4 @@ nix run git+https://git.sajenim.dev/jasmine/nvim.nix.git
## References ## References
* [dc-tec/nixvim](https://github.com/dc-tec/nixvim) * [dc-tec/nixvim](https://github.com/dc-tec/nixvim)
* [elythh/nixvim](https://github.com/elythh/nixvim)

View file

@ -4,5 +4,107 @@
plugins.gitsigns = { plugins.gitsigns = {
enable = true; enable = true;
}; };
keymaps = [
{
mode = [ "n" "v" ];
key = "<leader>hs";
action = "<cmd>Gitsigns stage_hunk<cr>";
options = {
silent = true;
desc = "Stage Hunk";
};
}
{
mode = [ "n" "v" ];
key = "<leader>hr";
action = "<cmd>Gitsigns reset_hunk<cr>";
options = {
silent = true;
desc = "Reset Hunk";
};
}
{
mode = "n";
key = "<leader>hS";
action = "<cmd>Gitsigns stage_buffer<cr>";
options = {
silent = true;
desc = "Stage Buffer";
};
}
{
mode = "n";
key = "<leader>hu";
action = "<cmd>Gitsigns undo_stage_hunk<cr>";
options = {
silent = true;
desc = "Undo Staged Hunk";
};
}
{
mode = "n";
key = "<leader>hR";
action = "<cmd>Gitsigns reset_buffer<cr>";
options = {
silent = true;
desc = "Reset Buffer";
};
}
{
mode = "n";
key = "<leader>hp";
action = "<cmd>Gitsigns preview_hunk_inline<cr>";
options = {
silent = true;
desc = "Preview Hunk";
};
}
{
mode = "n";
key = "<leader>hb";
action = "<cmd>Gitsigns blame<cr>";
options = {
silent = true;
desc = "View Blame";
};
}
{
mode = "n";
key = "<leader>tb";
action = "<cmd>Gitsigns toggle_current_line_blame<cr>";
options = {
silent = true;
desc = "Toggle Blame";
};
}
{
mode = "n";
key = "<leader>hd";
action = "<cmd>Gitsigns diffthis<cr>";
options = {
silent = true;
desc = "View Diff";
};
}
{
mode = "n";
key = "<leader>td";
action = "<cmd>Gitsigns toggle_deleted<cr>";
options = {
silent = true;
desc = "Toggle Deleted";
};
}
];
} }

View file

@ -16,7 +16,11 @@
sectionSeparators = { left = ""; right = ""; }; sectionSeparators = { left = ""; right = ""; };
# Display components in tabline # Display components in tabline
tabline.lualine_a = [ { name = "buffers"; } ]; tabline = {
lualine_a = [ { name = "buffers"; } ];
lualine_x = [ { name = "hostname"; } ];
lualine_z = [ { name = "encoding"; } ];
};
# Lualine has sections as shown below # Lualine has sections as shown below
# +-------------------------------------------------+ # +-------------------------------------------------+
@ -24,7 +28,7 @@
# +-------------------------------------------------+ # +-------------------------------------------------+
sections = { sections = {
# Section A # Section A
lualine_a = [ { name = "mode"; icon = ""; } ]; lualine_a = [ { name = "mode"; } ];
# Section B # Section B
lualine_b = [ lualine_b = [
@ -34,34 +38,30 @@
# Git diff status # Git diff status
{ name = "diff"; { name = "diff";
extraConfig.symbols = { extraConfig.symbols = {
added = " "; added = "+";
modified = " "; modified = "~";
removed = " "; removed = "-";
};
}
# Diagnostic count from nvim_lsp
{ name = "diagnostics";
extraConfig = {
sources = [ "nvim_lsp" ];
symbols = {
error = " ";
warn = " ";
info = " ";
hint = "󰝶 ";
};
}; };
} }
]; ];
# Section C # Section C
lualine_c = [ { name = "filename"; extraConfig = { path = 1; }; } ]; lualine_c = [ { name = "filename"; } ];
# Section X # Section X
lualine_x = [ lualine_x = [
{ name = "encoding"; } # Diagnostic count from nvim_lsp
{ name = "fileformat"; } { name = "diagnostics";
{ name = "filetype"; } extraConfig = {
sources = [ "nvim_lsp" ];
symbols = {
error = "error:";
warn = "warning:";
info = "info:";
hint = "hint:";
};
};
}
]; ];
# Section Y # Section Y

View file

@ -0,0 +1,18 @@
{ pkgs, ... }:
{
extraPlugins = [(pkgs.vimUtils.buildVimPlugin {
name = "neoclip";
src = pkgs.fetchFromGitHub {
owner = "AckslD";
repo = "nvim-neoclip.lua";
rev = "709c97f";
hash = "sha256-8ZPmxVM4dzjJxAYUHRMCiAQBxZEGHtsgSCNlCZBRBWo=";
};
})];
extraConfigLua = "require('neoclip').setup({
default_register = {'\"', '+'}
})";
}

View file

@ -0,0 +1,14 @@
{ pkgs, ... }:
{
extraPlugins = [(pkgs.vimUtils.buildVimPlugin {
name = "software-licenses";
src = pkgs.fetchFromGitHub {
owner = "chip";
repo = "telescope-software-licenses.nvim";
rev = "fb5fc33";
hash = "sha256-luyCjkZSm1F6qoRpP5hHRAx4632u6JFuX2s7m2s8y60=";
};
})];
}

View file

@ -1,17 +1,63 @@
{ ... }: { ... }:
{ {
imports = [
./neoclip.nix # Persistent clipboard.
./software-licenses.nix # View common software licenses.
];
plugins.telescope = { plugins.telescope = {
enable = true; enable = true;
# Install some telescope extensions.
extensions = {
# Enable native fuzzy finder.
fzf-native = {
enable = true;
};
};
# Configure our telescope keymaps.
keymaps = { keymaps = {
"<leader>ff" = { "<leader>ff" = {
action = "find_files"; action = "find_files";
options.desc = "Find Files"; options = {
desc = "Find project files";
};
}; };
"<leader>fb" = { "<leader>fb" = {
action = "buffers"; action = "buffers";
options.desc = "Buffers"; options = {
desc = "Find open buffers";
};
};
"<leader>/" = {
action = "live_grep";
options = {
desc = "Grep (root dir)";
};
};
"<leader>:" = {
action = "command_history";
options = {
desc = "Command History";
};
};
"<leader>p" = {
action = "neoclip";
options.desc = "Persistent Clipboard";
};
"<leader>sc" = {
action = "commands";
options = {
desc = "Search Commands";
};
};
"<leader>sl" = {
action = "software-licenses find";
options = {
desc = "Search Software Licenses";
};
}; };
}; };
}; };