add bufferline

This commit is contained in:
Aditya 2024-03-04 16:06:12 +05:30
parent 65a2dbe9aa
commit 26d8fc3df7
Signed by: aditya
SSH key fingerprint: SHA256:jL1IvWsjjlPtw6HvDIHfXfhO9IkIokNEyIfuFhSdoyU
3 changed files with 109 additions and 1 deletions

View file

@ -0,0 +1,107 @@
{
plugins = {
bufferline = {
enable = true;
separatorStyle = "thick"; # "slant", "padded_slant", "slope", "padded_slope", "thick", "thin"
offsets = [
{
filetype = "neo-tree";
text = "Neo-tree";
highlight = "Directory";
text_align = "left";
}
];
};
};
keymaps = [
{
mode = "n";
key = "<Tab>";
action = "<cmd>BufferLineCycleNext<cr>";
options = {
desc = "Cycle to next buffer";
};
}
{
mode = "n";
key = "<S-Tab>";
action = "<cmd>BufferLineCyclePrev<cr>";
options = {
desc = "Cycle to previous buffer";
};
}
{
mode = "n";
key = "<S-l>";
action = "<cmd>BufferLineCycleNext<cr>";
options = {
desc = "Cycle to next buffer";
};
}
{
mode = "n";
key = "<S-h>";
action = "<cmd>BufferLineCyclePrev<cr>";
options = {
desc = "Cycle to previous buffer";
};
}
{
mode = "n";
key = "<leader>bd";
action = "<cmd>bdelete<cr>";
options = {
desc = "Delete buffer";
};
}
{
mode = "n";
key = "<leader>bb";
action = "<cmd>e #<cr>";
options = {
desc = "Switch to other buffer";
};
}
{
mode = "n";
key = "<leader>br";
action = "<cmd>BufferLineCloseRight<cr>";
options = {
desc = "Delete buffers to the right";
};
}
{
mode = "n";
key = "<leader>bl";
action = "<cmd>BufferLineCloseLeft<cr>";
options = {
desc = "Delete buffers to the left";
};
}
{
mode = "n";
key = "<leader>bo";
action = "<cmd>BufferLneCloseOthers<cr>";
options = {
desc = "Delete other buffers";
};
}
{
mode = "n";
key = "<leader>bp";
action = "<cmd>BufferLineTogglePin<cr>";
options = {
desc = "Toggle pin";
};
}
{
mode = "n";
key = "<leader>bP";
action = "<cmd>BufferLineGroupClose ungrouped<cr>";
options = {
desc = "Delete non-pinned buffers";
};
}
];
}

View file

@ -1,5 +1,6 @@
{
imports = [
./bufferlines/bufferlines.nix
./sets.nix
./dap/dap.nix
./keymaps.nix

View file

@ -97,7 +97,7 @@
cmdheight = 2;
# Showmode
showmode = true; # TODO change to false
showmode = false; # TODO change to false
# Maximum number of items to show in popup menu (0 - use available screen space)
pumheight = 0;