This commit is contained in:
vali 2024-05-22 10:43:46 +02:00
commit 6198767e5b
47 changed files with 2430 additions and 108 deletions

View file

@ -0,0 +1,89 @@
{
plugins.alpha = let
nixFlake = [
" "
" "
" "
" "
" "
" "
" "
" "
" "
" "
" "
" "
" git@github.com:elythh "
];
in {
enable = true;
layout = [
{
type = "padding";
val = 4;
}
{
opts = {
hl = "AlphaHeader";
position = "center";
};
type = "text";
val = nixFlake;
}
{
type = "padding";
val = 2;
}
{
type = "group";
val = let
mkButton = shortcut: cmd: val: hl: {
type = "button";
inherit val;
opts = {
inherit hl shortcut;
keymap = [
"n"
shortcut
cmd
{}
];
position = "center";
cursor = 0;
width = 40;
align_shortcut = "right";
hl_shortcut = "Keyword";
};
};
in [
(
mkButton
"f"
"<CMD>lua require('telescope.builtin').find_files({hidden = true})<CR>"
"🔍 Find File"
"Operator"
)
(
mkButton
"q"
"<CMD>qa<CR>"
"💣 Quit Neovim"
"String"
)
];
}
{
type = "padding";
val = 2;
}
{
opts = {
hl = "GruvboxBlue";
position = "center";
};
type = "text";
val = "https://github.com/elythh/nixvim";
}
];
};
}

View file

@ -0,0 +1,20 @@
{pkgs, ...}: {
extraPlugins = with pkgs.vimUtils; [
(buildVimPlugin {
pname = "btw.nvim";
version = "2024-04-36";
src = pkgs.fetchFromGitHub {
owner = "letieu";
repo = "btw.nvim";
rev = "47f6419e90d3383987fd06e8f3e06a4bc032ac83";
hash = "sha256-91DZUfa4FBvXnkcNHdllr82Dr1Ie+MGVD3ibwkqo04c=";
};
})
];
extraConfigLua = ''
require('btw').setup({
text = "I use Neovim (and NixOS, BTW)",
})
'';
}

View file

@ -0,0 +1,175 @@
{
config,
lib,
...
}: let
colors = import ../../colors/${config.theme}.nix {};
in {
plugins = {
bufferline = {
enable = true;
separatorStyle = "thick"; # “slant”, “padded_slant”, “slope”, “padded_slope”, “thick”, “thin”
highlights = lib.mkIf config.colorschemes.base16.enable {
fill = {
fg = colors.base00;
bg = colors.base00;
};
background = {
fg = colors.base03;
bg = colors.base00;
};
bufferSelected = {
fg = colors.base05;
bg = colors.base00;
italic = false;
};
bufferVisible = {
fg = colors.base03;
bg = colors.base00;
};
closeButton = {
fg = colors.base03;
bg = colors.base00;
};
closeButtonVisible = {
fg = colors.base03;
bg = colors.base00;
};
closeButtonSelected = {
fg = colors.base08;
bg = colors.base00;
};
indicatorSelected = {
fg = colors.base00;
bg = colors.base00;
};
modified = {
fg = colors.base03;
bg = colors.base00;
};
modifiedVisible = {
fg = colors.base00;
bg = colors.base00;
};
modifiedSelected = {
fg = colors.base0B;
bg = colors.base00;
};
tabClose = {
fg = colors.base00;
bg = colors.base00;
};
};
};
};
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>`";
# 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>BufferLineCloseOthers<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

@ -0,0 +1,36 @@
{
plugins.noice = {
enable = true;
notify = {
enabled = false;
};
messages = {
enabled = true; # Adds a padding-bottom to neovim statusline when set to false for some reason
};
lsp = {
message = {
enabled = true;
};
progress = {
enabled = false;
view = "mini";
};
};
popupmenu = {
enabled = true;
backend = "nui";
};
format = {
filter = {
pattern = [":%s*%%s*s:%s*" ":%s*%%s*s!%s*" ":%s*%%s*s/%s*" "%s*s:%s*" ":%s*s!%s*" ":%s*s/%s*"];
icon = "";
lang = "regex";
};
replace = {
pattern = [":%s*%%s*s:%w*:%s*" ":%s*%%s*s!%w*!%s*" ":%s*%%s*s/%w*/%s*" "%s*s:%w*:%s*" ":%s*s!%w*!%s*" ":%s*s/%w*/%s*"];
icon = "󱞪";
lang = "regex";
};
};
};
}

View file

@ -0,0 +1,45 @@
{
plugins.notify = {
enable = true;
backgroundColour = "#000000";
fps = 60;
render = "default";
timeout = 1000;
topDown = true;
};
keymaps = [
{
mode = "n";
key = "<leader>un";
action = ''
<cmd>lua require("notify").dismiss({ silent = true, pending = true })<cr>
'';
options = {
desc = "Dismiss All Notifications";
};
}
];
extraConfigLua = ''
local notify = require("notify")
local filtered_message = { "No information available" }
-- Override notify function to filter out messages
---@diagnostic disable-next-line: duplicate-set-field
vim.notify = function(message, level, opts)
local merged_opts = vim.tbl_extend("force", {
on_open = function(win)
local buf = vim.api.nvim_win_get_buf(win)
vim.api.nvim_buf_set_option(buf, "filetype", "markdown")
end,
}, opts or {})
for _, msg in ipairs(filtered_message) do
if message == msg then
return
end
end
return notify(message, level, merged_opts)
end
'';
}

View 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
}
}
}
'';
}