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

View file

@ -5,6 +5,7 @@ let
in {
environment.systemPackages = with pkgs; [
abaddon
alejandra
alsa-utils
android-tools
asciinema

View file

@ -1 +1 @@
_: { imports = [ ./emacs.nix ./helix.nix ./kakoune.nix ./nixvim.nix ]; }
_: { imports = [ ./emacs.nix ./helix.nix ./kakoune.nix ./nixvim ]; }

View file

@ -1,93 +0,0 @@
{ config, lib, ... }:
let cfg = config.modules.editors.nixvim;
in {
options.modules.editors.nixvim.enable = lib.mkEnableOption "nixvim";
config = lib.mkIf cfg.enable {
programs.nixvim = {
enable = true;
colorschemes.gruvbox.enable = true;
options = {
number = true;
relativenumber = true;
shiftwidth = 2;
scrolloff = 8;
};
plugins = {
lightline.enable = true;
lsp = {
enable = true;
servers = {
nixd.enable = true;
lua-ls.enable = true;
};
};
cmp = {
enable = true;
settings = {
sources = [ { name = "nvim_lsp"; } { name = "buffer"; } { name = "path"; } ];
mapping = {
"<CR>" = "cmp.mapping.confirm({ select = true })";
"<Tab>" = {
action = ''
function(fallback)
if cmp.visible() then
cmp.select_next_item()
elseif luasnip.expandable() then
luasnip.expand()
elseif luasnip.expand_or_jumpable() then
luasnip.expand_or_jump()
elseif check_backspace() then
fallback()
else
fallback()
end
end
'';
modes = [ "i" "s" ];
};
};
};
};
telescope = {
enable = true;
extensions = {
fzf-native = {
enable = true;
settings = {
fuzzy = true;
override_file_sorter = true;
override_generic_sorter = true;
case_mode = "smart_case";
};
};
};
};
treesitter.enable = true;
treesitter-context.enable = true;
comment.enable = true;
gitblame.enable = true;
trouble.enable = true;
todo-comments.enable = true;
fugitive.enable = true;
nvim-autopairs.enable = true;
diffview.enable = true;
oil.enable = true;
undotree.enable = true;
fzf-lua.enable = true;
surround.enable = true;
lazygit.enable = true;
# Theming
gitsigns.enable = true;
# barbar.enable = true;
lualine = {
enable = true;
#theme = "palenight";
};
nix.enable = true;
zig.enable = true;
};
};
};
}

View file

@ -0,0 +1,3 @@
_:{
imports = [./nixvim.nix ];
}

View file

@ -0,0 +1,408 @@
{
programs.nixvim = {
globals.mapleader = " ";
keymaps = [
{
mode = "n";
key = "<leader>f";
action = "+find/file";
desc = "Find a file";
}
{
mode = "n";
key = "<leader>s";
action = "+search";
desc = "Search in your file";
}
{
mode = "n";
key = "<leader>q";
action = "+quit/session";
desc = "Quit the current session";
}
{
mode = ["n" "v"];
key = "<leader>g";
action = "+git";
}
{
mode = "n";
key = "<leader>u";
action = "+ui";
}
{
mode = "n";
key = "<leader>w";
action = "+windows";
}
{
mode = "n";
key = "<leader><Tab>";
action = "+tab";
}
{
mode = ["n" "v"];
key = "<leader>d";
action = "+debug";
}
{
mode = ["n" "v"];
key = "<leader>c";
action = "+code";
}
{
mode = ["n" "v"];
key = "<leader>t";
action = "+test";
}
# Tabs
{
mode = "n";
key = "<leader><tab><tab>";
action = "<cmd>tabnew<cr>";
options = {
silent = true;
desc = "New Tab";
};
}
{
mode = "n";
key = "<leader><tab>d";
action = "<cmd>tabclose<cr>";
options = {
silent = true;
desc = "Close tab";
};
}
# Windows
{
mode = "n";
key = "<leader>ww";
action = "<C-W>p";
options = {
silent = true;
desc = "Other window";
};
}
{
mode = "n";
key = "<leader>wd";
action = "<C-W>c";
options = {
silent = true;
desc = "Delete window";
};
}
{
mode = "n";
key = "<leader>w-";
action = "<C-W>s";
options = {
silent = true;
desc = "Split window below";
};
}
{
mode = "n";
key = "<leader>w|";
action = "<C-W>v";
options = {
silent = true;
desc = "Split window right";
};
}
{
mode = "n";
key = "<C-h>";
action = "<C-W>h";
options = {
silent = true;
desc = "Move to window left";
};
}
{
mode = "n";
key = "<C-l>";
action = "<C-W>l";
options = {
silent = true;
desc = "Move to window right";
};
}
{
mode = "n";
key = "<C-k>";
action = "<C-W>k";
options = {
silent = true;
desc = "Move to window over";
};
}
{
mode = "n";
key = "<C-j>";
action = "<C-W>j";
options = {
silent = true;
desc = "Move to window bellow";
};
}
{
mode = "n";
key = "<C-s>";
action = "<cmd>w<cr><esc>";
options = {
silent = true;
desc = "Save file";
};
}
# Quit/Session
{
mode = "n";
key = "<leader>qq";
action = "<cmd>quitall<cr><esc>";
options = {
silent = true;
desc = "Quit all";
};
}
{
mode = "n";
key = "<leader>ul";
action = ":lua ToggleLineNumber()<cr>";
options = {
silent = true;
desc = "Toggle Line Numbers";
};
}
{
mode = "n";
key = "<leader>uL";
action = ":lua ToggleRelativeLineNumber()<cr>";
options = {
silent = true;
desc = "Toggle Relative Line Numbers";
};
}
{
mode = "n";
key = "<leader>uw";
action = ":lua ToggleWrap()<cr>";
options = {
silent = true;
desc = "Toggle Line Wrap";
};
}
{
mode = "v";
key = "J";
action = ":m '>+1<CR>gv=gv";
options = {desc = "Use move command when line is highlighted ";};
}
{
mode = "v";
key = "K";
action = ":m '>-2<CR>gv=gv";
options = {desc = "Use move command when line is highlighted ";};
}
{
mode = "n";
key = "J";
action = "mzJ`z";
options = {
desc = "Allow cursor to stay in the same place after appending to current line ";
};
}
{
mode = "n";
key = "<C-d>";
action = "<C-d>zz";
options = {
desc = "Allow C-d and C-u to keep the cursor in the middle";
};
}
{
mode = "n";
key = "<C-u>";
action = "<C-u>zz";
options = {
desc = "Allow C-d and C-u to keep the cursor in the middle";
};
}
{
mode = "n";
key = "n";
action = "nzzzv";
options = {desc = "Allow search terms to stay in the middle ";};
}
{
mode = "n";
key = "N";
action = "Nzzzv";
options = {desc = "Allow search terms to stay in the middle ";};
}
# Paste stuff without saving the deleted word into the buffer
{
mode = "x";
key = "<leader>p";
action = ''"_dP'';
options = {desc = "Deletes to void register and paste over";};
}
# Copy stuff to system clipboard with <leader> + y or just y to have it just in vim
{
mode = ["n" "v"];
key = "<leader>y";
action = ''"+y'';
options = {desc = "Copy to system clipboard";};
}
{
mode = ["n" "v"];
key = "<leader>Y";
action = ''"+Y'';
options = {desc = "Copy to system clipboard";};
}
# Delete to void register
{
mode = ["n" "v"];
key = "<leader>D";
action = ''"_d'';
options = {desc = "Delete to void register";};
}
# <C-c> instead of pressing esc just because
{
mode = "i";
key = "<C-c>";
action = "<Esc>";
}
{
mode = "n";
key = "<leader>zz";
action = "<CMD> ZenMode | Pencil<CR>";
options = {desc = "Toggle writting mode";};
}
{
mode = "n";
key = "<leader>m";
action = "<CMD> Grapple toggle <CR>";
options = {desc = "Grapple Toggle tag";};
}
{
mode = "n";
key = "<leader>k";
action = "<CMD> Grapple toggle_tags <CR>";
options = {desc = "Grapple Toggle tag";};
}
{
mode = "n";
key = "<leader>K";
action = "<CMD> Grapple toggle_scopes <CR>";
options = {desc = "Grapple Toggle scopes";};
}
{
mode = "n";
key = "<leader>j";
action = "<CMD> Grapple cycle forward <CR>";
options = {desc = "Grapple Cycle forward";};
}
{
mode = "n";
key = "<leader>J";
action = "<CMD> Grapple cycle backward <CR>";
options = {desc = "Grapple Cycle backward";};
}
{
mode = "n";
key = "<leader>1";
action = "<CMD> Grapple select index=1<CR>";
options = {desc = "Grapple Select 1";};
}
{
mode = "n";
key = "<leader>2";
action = "<CMD> Grapple select index=2<CR>";
options = {desc = "Grapple Select 2";};
}
{
mode = "n";
key = "<leader>3";
action = "<CMD> Grapple select index=3<CR>";
options = {desc = "Grapple Select 3";};
}
{
mode = "n";
key = "<leader>4";
action = "<CMD> Grapple select index=4<CR>";
options = {desc = "Grapple Select 4";};
}
];
extraConfigLua = ''
function ToggleLineNumber()
if vim.wo.number then
vim.wo.number = false
else
vim.wo.number = true
vim.wo.relativenumber = false
end
end
function ToggleRelativeLineNumber()
if vim.wo.relativenumber then
vim.wo.relativenumber = false
else
vim.wo.relativenumber = true
vim.wo.number = false
end
end
function ToggleWrap()
vim.wo.wrap = not vim.wo.wrap
end
'';
};
}

View file

@ -0,0 +1,63 @@
{ config, lib, ... }:
let cfg = config.modules.editors.nixvim;
in {
options.modules.editors.nixvim.enable = lib.mkEnableOption "nixvim";
imports = [
#./keys.nix
./settings.nix
./plug/completion/cmp.nix
#./plug/completion/copilot-cmp.nix
#./plug/completion/lspkind.nix
./plug/git/gitlinker.nix
./plug/git/gitsigns.nix
./plug/git/lazygit.nix
./plug/git/worktree.nix
./plug/lsp/conform.nix
./plug/lsp/fidget.nix
./plug/lsp/hlchunk.nix
./plug/lsp/lsp.nix
./plug/lsp/lspsaga.nix
./plug/lsp/none-ls.nix
./plug/lsp/trouble.nix
./plug/snippets/luasnip.nix
./plug/statusline/lualine.nix
#./plug/statusline/staline.nix
#./plug/treesitter/treesitter-context.nix
./plug/treesitter/treesitter-textobjects.nix
./plug/treesitter/treesitter.nix
#./plug/ui/alpha.nix
./plug/ui/btw.nix
./plug/ui/bufferline.nix
./plug/ui/noice.nix
./plug/ui/nvim-notify.nix
./plug/ui/telescope.nix
./plug/utils/comment.nix
./plug/utils/copilot.nix
./plug/utils/flash.nix
./plug/utils/hardtime.nix
#./plug/utils/harpoon.nix
./plug/utils/grapple.nix
./plug/utils/illuminate.nix
./plug/utils/nvim-autopairs.nix
./plug/utils/oil.nix
./plug/utils/undotree.nix
./plug/utils/ufo.nix
./plug/utils/whichkey.nix
];
config = lib.mkIf cfg.enable {
programs.nixvim = {
enable = true;
colorschemes.gruvbox = {
enable = true;
settings.transparent_mode = true;
};
};
};
}

View file

@ -0,0 +1,120 @@
{
programs.nixvim.plugins = {
cmp-emoji = {enable = true;};
cmp = {
enable = true;
settings = {
autoEnableSources = true;
experimental = {ghost_text = true;};
performance = {
debounce = 60;
fetchingTimeout = 200;
maxViewEntries = 30;
};
snippet = {expand = "luasnip";};
formatting = {fields = ["kind" "abbr" "menu"];};
sources = [
{name = "nvim_lsp";}
{name = "emoji";}
{
name = "buffer"; # text within current buffer
option.get_bufnrs.__raw = "vim.api.nvim_list_bufs";
keywordLength = 3;
}
{
name = "path"; # file system paths
keywordLength = 3;
}
{
name = "luasnip"; # snippets
keywordLength = 3;
}
];
window = {
completion = {border = "solid";};
documentation = {border = "solid";};
};
mapping = {
"<Tab>" = "cmp.mapping(cmp.mapping.select_next_item(), {'i', 's'})";
"<C-j>" = "cmp.mapping.select_next_item()";
"<C-k>" = "cmp.mapping.select_prev_item()";
"<C-e>" = "cmp.mapping.abort()";
"<C-b>" = "cmp.mapping.scroll_docs(-4)";
"<C-f>" = "cmp.mapping.scroll_docs(4)";
"<C-Space>" = "cmp.mapping.complete()";
"<CR>" = "cmp.mapping.confirm({ select = true })";
"<S-CR>" = "cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = true })";
};
};
};
cmp-nvim-lsp = {enable = true;}; # lsp
cmp-buffer = {enable = true;};
cmp-path = {enable = true;}; # file system paths
cmp_luasnip = {enable = true;}; # snippets
cmp-cmdline = {enable = false;}; # autocomplete for cmdline
};
extraConfigLua = ''
luasnip = require("luasnip")
kind_icons = {
Text = "󰊄",
Method = "",
Function = "󰡱",
Constructor = "",
Field = "",
Variable = "󱀍",
Class = "",
Interface = "",
Module = "󰕳",
Property = "",
Unit = "",
Value = "",
Enum = "",
Keyword = "",
Snippet = "",
Color = "",
File = "",
Reference = "",
Folder = "",
EnumMember = "",
Constant = "",
Struct = "",
Event = "",
Operator = "",
TypeParameter = "",
}
local cmp = require'cmp'
-- Use buffer source for `/` (if you enabled `native_menu`, this won't work anymore).
cmp.setup.cmdline({'/', "?" }, {
sources = {
{ name = 'buffer' }
}
})
-- Set configuration for specific filetype.
cmp.setup.filetype('gitcommit', {
sources = cmp.config.sources({
{ name = 'cmp_git' }, -- You can specify the `cmp_git` source if you were installed it.
}, {
{ name = 'buffer' },
})
})
-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
cmp.setup.cmdline(':', {
sources = cmp.config.sources({
{ name = 'path' }
}, {
{ name = 'cmdline' }
}),
-- formatting = {
-- format = function(_, vim_item)
-- vim_item.kind = cmdIcons[vim_item.kind] or "FOO"
-- return vim_item
-- end
-- }
}) '';
}

View file

@ -0,0 +1,8 @@
{
programs.nixvim.plugins.gitlinker = {
enable = true;
callbacks = {
"gihub.com" = "get_github_type_url";
};
};
}

View file

@ -0,0 +1,76 @@
{
programs.nixvim.plugins.gitsigns = {
enable = true;
settings = {
trouble = true;
current_line_blame = true;
signs = {
add = {
text = "";
};
change = {
text = "";
};
delete = {
text = "_";
};
topdelete = {
text = "";
};
changedelete = {
text = "~";
};
untracked = {
text = "";
};
};
};
};
keymaps = [
{
mode = ["n" "v"];
key = "<leader>gh";
action = "gitsigns";
options = {
silent = true;
desc = "+hunks";
};
}
{
mode = "n";
key = "<leader>ghb";
action = ":Gitsigns blame_line<CR>";
options = {
silent = true;
desc = "Blame line";
};
}
{
mode = "n";
key = "<leader>ghd";
action = ":Gitsigns diffthis<CR>";
options = {
silent = true;
desc = "Diff This";
};
}
{
mode = "n";
key = "<leader>ghR";
action = ":Gitsigns reset_buffer<CR>";
options = {
silent = true;
desc = "Reset Buffer";
};
}
{
mode = "n";
key = "<leader>ghS";
action = ":Gitsigns stage_buffer<CR>";
options = {
silent = true;
desc = "Stage Buffer";
};
}
];
}

View file

@ -0,0 +1,22 @@
{pkgs, ...}: {
programs.nixvim = {
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)";
};
}
];
};
}

View file

@ -0,0 +1,6 @@
{
programs.nixvim.plugins.git-worktree = {
enable = true;
enableTelescope = true;
};
}

View file

@ -0,0 +1,24 @@
{
programs.nixvim.plugins.conform-nvim = {
enable = true;
formatOnSave = {
lspFallback = true;
timeoutMs = 500;
};
notifyOnError = true;
formattersByFt = {
liquidsoap = ["liquidsoap-prettier"];
html = [["prettierd" "prettier"]];
css = [["prettierd" "prettier"]];
javascript = [["prettierd" "prettier"]];
javascriptreact = [["prettierd" "prettier"]];
typescript = [["prettierd" "prettier"]];
typescriptreact = [["prettierd" "prettier"]];
python = ["black"];
lua = ["stylua"];
nix = ["alejandra"];
markdown = [["prettierd" "prettier"]];
yaml = ["yamllint" "yamlfmt"];
};
};
}

View file

@ -0,0 +1,101 @@
{
programs.nixvim = {
plugins.fidget = {
enable = true;
logger = {
level = "warn"; # “off”, “error”, “warn”, “info”, “debug”, “trace”
floatPrecision = 0.01; # Limit the number of decimals displayed for floats
};
progress = {
pollRate = 0; # How and when to poll for progress messages
suppressOnInsert = true; # Suppress new messages while in insert mode
ignoreDoneAlready = false; # Ignore new tasks that are already complete
ignoreEmptyMessage = false; # Ignore new tasks that don't contain a message
clearOnDetach =
# Clear notification group when LSP server detaches
''
function(client_id)
local client = vim.lsp.get_client_by_id(client_id)
return client and client.name or nil
end
'';
notificationGroup =
# How to get a progress message's notification group key
''
function(msg) return msg.lsp_client.name end
'';
ignore = []; # List of LSP servers to ignore
lsp = {
progressRingbufSize = 0; # Configure the nvim's LSP progress ring buffer size
};
display = {
renderLimit = 16; # How many LSP messages to show at once
doneTtl = 3; # How long a message should persist after completion
doneIcon = ""; # Icon shown when all LSP progress tasks are complete
doneStyle = "Constant"; # Highlight group for completed LSP tasks
progressTtl = "math.huge"; # How long a message should persist when in progress
progressIcon = {
pattern = "dots";
period = 1;
}; # Icon shown when LSP progress tasks are in progress
progressStyle = "WarningMsg"; # Highlight group for in-progress LSP tasks
groupStyle = "Title"; # Highlight group for group name (LSP server name)
iconStyle = "Question"; # Highlight group for group icons
priority = 30; # Ordering priority for LSP notification group
skipHistory = true; # Whether progress notifications should be omitted from history
formatMessage = ''
require ("fidget.progress.display").default_format_message
''; # How to format a progress message
formatAnnote = ''
function (msg) return msg.title end
''; # How to format a progress annotation
formatGroupName = ''
function (group) return tostring (group) end
''; # How to format a progress notification group's name
overrides = {
rust_analyzer = {
name = "rust-analyzer";
};
}; # Override options from the default notification config
};
};
notification = {
pollRate = 10; # How frequently to update and render notifications
filter = "info"; # “off”, “error”, “warn”, “info”, “debug”, “trace”
historySize = 128; # Number of removed messages to retain in history
overrideVimNotify = true;
redirect = ''
function(msg, level, opts)
if opts and opts.on_open then
return require("fidget.integration.nvim-notify").delegate(msg, level, opts)
end
end
'';
configs = {
default = "require('fidget.notification').default_config";
};
window = {
normalHl = "Comment";
winblend = 0;
border = "none"; # none, single, double, rounded, solid, shadow
zindex = 45;
maxWidth = 0;
maxHeight = 0;
xPadding = 1;
yPadding = 0;
align = "bottom";
relative = "editor";
};
view = {
stackUpwards = true; # Display notification items from bottom to top
iconSeparator = " "; # Separator between group name and icon
groupSeparator = "---"; # Separator between notification groups
groupSeparatorHl =
# Highlight group used for group separator
"Comment";
};
};
};
};
}

View file

@ -0,0 +1,13 @@
{pkgs, ...}: {
programs.nixvim.extraPlugins = [
(pkgs.vimUtils.buildVimPlugin {
name = "hlchunk";
src = pkgs.fetchFromGitHub {
owner = "shellRaining";
repo = "hlchunk.nvim";
rev = "882d1bc86d459fa8884398223c841fd09ea61b6b";
hash = "sha256-fvFvV7KAOo7xtOCjhGS5bDUzwd10DndAKs3++dunED8=";
};
})
];
}

View file

@ -0,0 +1,98 @@
{
programs.nixvim = {
plugins = {
lsp-format = {enable = true;};
lsp = {
enable = true;
servers = {
eslint = {enable = true;};
html = {enable = true;};
lua-ls = {enable = true;};
nil_ls = {enable = true;};
marksman = {enable = true;};
pyright = {enable = true;};
gopls = {enable = true;};
terraformls = {enable = true;};
tsserver = {enable = false;};
yamlls = {
enable = true;
};
};
keymaps = {
silent = true;
lspBuf = {
gd = {
action = "definition";
desc = "Goto Definition";
};
gr = {
action = "references";
desc = "Goto References";
};
gD = {
action = "declaration";
desc = "Goto Declaration";
};
gI = {
action = "implementation";
desc = "Goto Implementation";
};
gT = {
action = "type_definition";
desc = "Type Definition";
};
K = {
action = "hover";
desc = "Hover";
};
"<leader>cw" = {
action = "workspace_symbol";
desc = "Workspace Symbol";
};
"<leader>cr" = {
action = "rename";
desc = "Rename";
};
};
diagnostic = {
"<leader>cd" = {
action = "open_float";
desc = "Line Diagnostics";
};
"[d" = {
action = "goto_next";
desc = "Next Diagnostic";
};
"]d" = {
action = "goto_prev";
desc = "Previous Diagnostic";
};
};
};
};
};
extraConfigLua = ''
local _border = "rounded"
vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(
vim.lsp.handlers.hover, {
border = _border
}
)
vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(
vim.lsp.handlers.signature_help, {
border = _border
}
)
vim.diagnostic.config{
float={border=_border}
};
require('lspconfig.ui.windows').default_options = {
border = _border
}
'';
};
}

View file

@ -0,0 +1,188 @@
{
programs.nixvim = {
plugins.lspsaga = {
enable = true;
beacon = {
enable = true;
};
ui = {
border = "rounded"; # One of none, single, double, rounded, solid, shadow
codeAction = "💡"; # Can be any symbol you want 💡
};
hover = {
openCmd = "!floorp"; # Choose your browser
openLink = "gx";
};
diagnostic = {
borderFollow = true;
diagnosticOnlyCurrent = false;
showCodeAction = true;
};
symbolInWinbar = {
enable = true; # Breadcrumbs
};
codeAction = {
extendGitSigns = false;
showServerName = true;
onlyInCursor = true;
numShortcut = true;
keys = {
exec = "<CR>";
quit = ["<Esc>" "q"];
};
};
lightbulb = {
enable = false;
sign = false;
virtualText = true;
};
implement = {
enable = false;
};
rename = {
autoSave = false;
keys = {
exec = "<CR>";
quit = ["<C-k>" "<Esc>"];
select = "x";
};
};
outline = {
autoClose = true;
autoPreview = true;
closeAfterJump = true;
layout = "normal"; # normal or float
winPosition = "right"; # left or right
keys = {
jump = "e";
quit = "q";
toggleOrJump = "o";
};
};
scrollPreview = {
scrollDown = "<C-f>";
scrollUp = "<C-b>";
};
};
keymaps = [
{
mode = "n";
key = "gd";
action = "<cmd>Lspsaga finder def<CR>";
options = {
desc = "Goto Definition";
silent = true;
};
}
{
mode = "n";
key = "gr";
action = "<cmd>Lspsaga finder ref<CR>";
options = {
desc = "Goto References";
silent = true;
};
}
# {
# mode = "n";
# key = "gD";
# action = "<cmd>Lspsaga show_line_diagnostics<CR>";
# options = {
# desc = "Goto Declaration";
# silent = true;
# };
# }
{
mode = "n";
key = "gI";
action = "<cmd>Lspsaga finder imp<CR>";
options = {
desc = "Goto Implementation";
silent = true;
};
}
{
mode = "n";
key = "gT";
action = "<cmd>Lspsaga peek_type_definition<CR>";
options = {
desc = "Type Definition";
silent = true;
};
}
{
mode = "n";
key = "K";
action = "<cmd>Lspsaga hover_doc<CR>";
options = {
desc = "Hover";
silent = true;
};
}
{
mode = "n";
key = "<leader>cw";
action = "<cmd>Lspsaga outline<CR>";
options = {
desc = "Outline";
silent = true;
};
}
{
mode = "n";
key = "<leader>cr";
action = "<cmd>Lspsaga rename<CR>";
options = {
desc = "Rename";
silent = true;
};
}
{
mode = "n";
key = "<leader>ca";
action = "<cmd>Lspsaga code_action<CR>";
options = {
desc = "Code Action";
silent = true;
};
}
{
mode = "n";
key = "<leader>cd";
action = "<cmd>Lspsaga show_line_diagnostics<CR>";
options = {
desc = "Line Diagnostics";
silent = true;
};
}
{
mode = "n";
key = "[d";
action = "<cmd>Lspsaga diagnostic_jump_next<CR>";
options = {
desc = "Next Diagnostic";
silent = true;
};
}
{
mode = "n";
key = "]d";
action = "<cmd>Lspsaga diagnostic_jump_prev<CR>";
options = {
desc = "Previous Diagnostic";
silent = true;
};
}
];
};
}

View file

@ -0,0 +1,50 @@
{
plugins.none-ls = {
enable = true;
enableLspFormat = true;
updateInInsert = false;
sources = {
code_actions = {
gitsigns.enable = true;
statix.enable = true;
};
diagnostics = {
statix.enable = true;
yamllint.enable = true;
};
formatting = {
alejandra.enable = true;
black = {
enable = true;
withArgs = ''
{
extra_args = { "--fast" },
}
'';
};
prettier = {
enable = true;
disableTsServerFormatter = true;
withArgs = ''
{
extra_args = { "--no-semi", "--single-quote" },
}
'';
};
stylua.enable = true;
yamlfmt.enable = true;
};
};
};
keymaps = [
{
mode = ["n" "v"];
key = "<leader>cf";
action = "<cmd>lua vim.lsp.buf.format()<cr>";
options = {
silent = true;
desc = "Format";
};
}
];
}

View file

@ -0,0 +1,5 @@
{
plugins.trouble = {
enable = true;
};
}

View file

@ -0,0 +1,15 @@
{pkgs, ...}: {
plugins.luasnip = {
enable = true;
extraConfig = {
enable_autosnippets = true;
store_selection_keys = "<Tab>";
};
fromVscode = [
{
lazyLoad = true;
paths = "${pkgs.vimPlugins.friendly-snippets}";
}
];
};
}

View file

@ -0,0 +1,113 @@
{
plugins.lualine = {
enable = true;
globalstatus = true;
disabledFiletypes = {
statusline = ["dashboard" "alpha" "starter"];
};
theme = {
normal = {
a = {
bg = "#b4befe";
fg = "#1c1d21";
};
b = {
bg = "nil";
};
c = {
bg = "nil";
};
z = {
bg = "nil";
};
y = {
bg = "nil";
};
};
};
sections = {
lualine_a = [
{
name = "mode";
fmt = "string.lower";
color = {
fg =
"none";
bg =
"none";
};
}
];
lualine_b = [
{
name = "branch";
icon = "";
color = {
fg =
"none";
bg =
"none";
};
}
"diff"
];
lualine_c = [
{
name = "diagnostic";
extraConfig = {
symbols = {
error = " ";
warn = " ";
info = " ";
hint = "󰝶 ";
};
};
color = {
fg =
"none";
bg =
"none";
};
}
];
lualine_x = [
{
name = "filetype";
extraConfig = {
icon_only = true;
};
}
];
lualine_y = [
{
name = "filename";
extraConfig = {
symbols = {
modified = "";
readonly = "";
unnamed = "";
};
};
color = {
fg =
"none";
bg =
"none";
};
separator.left = "";
}
];
lualine_z = [
{
name = "location";
color = {
fg =
"none";
bg =
"none";
};
}
];
};
};
}

View file

@ -0,0 +1,65 @@
{pkgs, ...}: {
extraPlugins = with pkgs.vimUtils; [
(buildVimPlugin {
pname = "staline.nvim";
version = "2024-02-05";
src = pkgs.fetchFromGitHub {
owner = "tamton-aquib";
repo = "staline.nvim";
rev = "a53f869278b8b186a5afd6f21680cd103c381599";
hash = "sha256-GDMKzxFDtQk5LL+rMsxTGTyLv69w5NUd+u19noeO5ws=";
};
})
];
extraConfigLua = ''
require("staline").setup({
sections = {
left = { "-mode", " ", "branch" },
mid = { "lsp_name" },
right = { "file_name", "line_column" },
},
inactive_sections = {
left = { "-mode", " ", "branch" },
mid = { "lsp_name" },
right = { "file_name", "line_column" },
},
defaults = {
left_separator = " ",
right_separator = " ",
branch_symbol = " ",
mod_symbol = "",
line_column = "[%l/%L]",
inactive_color = "#80a6f2", --#303030 is the default
inactive_bgcolor = "none",
},
special_table = {
lazy = { "Plugins", "💤 " },
TelescopePrompt = { "Telescope", " " },
oil = { "Oil", "󰏇 " },
lazygit = { "LazyGit", " " },
},
mode_icons = {
["n"] = "NORMAL",
["no"] = "NORMAL",
["nov"] = "NORMAL",
["noV"] = "NORMAL",
["niI"] = "NORMAL",
["niR"] = "NORMAL",
["niV"] = "NORMAL",
["i"] = "INSERT",
["ic"] = "INSERT",
["ix"] = "INSERT",
["s"] = "INSERT",
["S"] = "INSERT",
["v"] = "VISUAL",
["V"] = "VISUAL",
[""] = "VISUAL",
["r"] = "REPLACE",
["r?"] = "REPLACE",
["R"] = "REPLACE",
["c"] = "COMMAND",
["t"] = "TERMINAL",
},
})
'';
}

View file

@ -0,0 +1,5 @@
{
plugins.treesitter-context = {
enable = true;
};
}

View file

@ -0,0 +1,50 @@
{
plugins.treesitter-textobjects = {
enable = false;
select = {
enable = true;
lookahead = true;
keymaps = {
"aa" = "@parameter.outer";
"ia" = "@parameter.inner";
"af" = "@function.outer";
"if" = "@function.inner";
"ac" = "@class.outer";
"ic" = "@class.inner";
"ii" = "@conditional.inner";
"ai" = "@conditional.outer";
"il" = "@loop.inner";
"al" = "@loop.outer";
"at" = "@comment.outer";
};
};
move = {
enable = true;
gotoNextStart = {
"]m" = "@function.outer";
"]]" = "@class.outer";
};
gotoNextEnd = {
"]M" = "@function.outer";
"][" = "@class.outer";
};
gotoPreviousStart = {
"[m" = "@function.outer";
"[[" = "@class.outer";
};
gotoPreviousEnd = {
"[M" = "@function.outer";
"[]" = "@class.outer";
};
};
swap = {
enable = true;
swapNext = {
"<leader>a" = "@parameters.inner";
};
swapPrevious = {
"<leader>A" = "@parameter.outer";
};
};
};
}

View file

@ -0,0 +1,44 @@
{pkgs, ...}: let
nu-grammar = pkgs.tree-sitter.buildGrammar {
language = "nu";
version = "0.0.0+rev=358c4f5";
src = pkgs.fetchFromGitHub {
owner = "nushell";
repo = "tree-sitter-nu";
rev = "2d0dd587dbfc3363d2af4e4141833e718647a67e";
hash = "sha256-A0Lpsx0VFRYUWetgX3Bn5osCsLQrZzg90unGg9kTnVg=";
};
};
in {
filetype.extension.liq = "liquidsoap";
filetype.extension.nu = "nu";
plugins.treesitter = {
enable = true;
indent = true;
folding = true;
languageRegister.nu = "nu";
languageRegister.liq = "liquidsoap";
nixvimInjections = true;
grammarPackages =
[
nu-grammar
]
++ pkgs.vimPlugins.nvim-treesitter.allGrammars;
};
extraFiles = {
"/queries/nu/highlights.scm" = builtins.readFile "${nu-grammar}/queries/nu/highlights.scm";
"/queries/nu/injections.scm" = builtins.readFile "${nu-grammar}/queries/nu/injections.scm";
};
extraConfigLua = ''
local parser_config = require("nvim-treesitter.parsers").get_parser_configs()
parser_config.liquidsoap = {
filetype = "liquidsoap",
}
parser_config.nu = {
filetype = "nu",
}
'';
}

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

View file

@ -0,0 +1,5 @@
{
plugins.comment = {
enable = true;
};
}

View file

@ -0,0 +1,56 @@
{
pkgs,
lib,
...
}: let
copilotChatRepo = {
owner = "copilotc-nvim";
repo = "CopilotChat.nvim";
rev = "2771f1fa7af502ea4226a88a792f4e4319199906";
hash = "sha256-Q+g81BQVQTY5J2c2ZWB7bjJLuNSdI0PAan+75YJ7mI0=";
};
in {
extraPlugins = with pkgs.vimUtils; [
(buildVimPlugin {
pname = "copilotchat";
version = "2.4.0";
src = pkgs.fetchFromGitHub copilotChatRepo;
meta = {
description = "Chat with GitHub Copilot in Neovim";
homepage = "https://github.com/CopilotC-Nvim/CopilotChat.nvim/";
license = lib.licenses.gpl3;
};
})
];
extraConfigLua = ''
require("CopilotChat").setup { }
'';
keymaps = [
{
mode = "x";
key = "<leader>a";
action = "+copilot";
}
{
mode = "x";
key = "<leader>ae";
action = "<cmd>CopilotChatExplain<cr>";
}
{
mode = "x";
key = "<leader>af";
action = "<cmd>CopilotChatFix<cr>";
}
{
mode = "x";
key = "<leader>ad";
action = "<cmd>CopilotChatDocs<cr>";
}
{
mode = "x";
key = "<leader>ac";
action = "<cmd>CopilotChatCommit<cr>";
}
];
}

View file

@ -0,0 +1,56 @@
{
plugins.flash = {
enable = true;
labels = "asdfghjklqwertyuiopzxcvbnm";
search = {
mode = "fuzzy";
};
jump = {
autojump = true;
};
label = {
uppercase = false;
rainbow = {
enabled = false;
shade = 5;
};
};
};
keymaps = [
{
mode = ["n" "x" "o"];
key = "s";
action = "<cmd>lua require('flash').jump()<cr>";
options = {
desc = "Flash";
};
}
{
mode = ["n" "x" "o"];
key = "S";
action = "<cmd>lua require('flash').treesitter()<cr>";
options = {
desc = "Flash Treesitter";
};
}
{
mode = "o";
key = "r";
action = "<cmd>lua require('flash').remote()<cr>";
options = {
desc = "Remote Flash";
};
}
{
mode = ["x" "o"];
key = "R";
action = "<cmd>lua require('flash').treesitter_search()<cr>";
options = {
desc = "Treesitter Search";
};
}
];
}

View file

@ -0,0 +1,20 @@
{pkgs, ...}: {
extraPlugins = with pkgs.vimUtils; [
(buildVimPlugin {
pname = "grapple.nvim";
version = "1.0";
src = pkgs.fetchFromGitHub {
owner = "cbochs";
repo = "grapple.nvim";
rev = "59d458e378c4884f22b7a68e61c07ed3e41aabf0";
hash = "sha256-4k8BE9i8kG4pL7Fj0xw9cG8sjA0u4jzJ40WSV/lBFhY=";
};
})
];
extraConfigLua = ''
require('grapple').setup({
scope = "git_branch",
})
'';
}

View file

@ -0,0 +1,26 @@
{
plugins.hardtime = {
enable = true;
enabled = true;
disableMouse = true;
disabledFiletypes = ["Oil"];
hint = true;
maxCount = 4;
maxTime = 1000;
restrictionMode = "hint";
restrictedKeys = {
"h" = ["n" "x"];
"j" = ["n" "x"];
"k" = ["n" "x"];
"l" = ["n" "x"];
"-" = ["n" "x"];
"+" = ["n" "x"];
"gj" = ["n" "x"];
"gk" = ["n" "x"];
"<CR>" = ["n" "x"];
"<C-M>" = ["n" "x"];
"<C-N>" = ["n" "x"];
"<C-P>" = ["n" "x"];
};
};
}

View file

@ -0,0 +1,17 @@
{
plugins.harpoon = {
enable = true;
enableTelescope = true;
keymapsSilent = true;
keymaps = {
addFile = "<leader>ha";
toggleQuickMenu = "<C-e>";
navFile = {
"1" = "<leader>hj";
"2" = "<leader>hk";
"3" = "<leader>hl";
"4" = "<leader>hm";
};
};
};
}

View file

@ -0,0 +1,13 @@
{
plugins.illuminate = {
enable = true;
underCursor = false;
filetypesDenylist = [
"Outline"
"TelescopePrompt"
"alpha"
"harpoon"
"reason"
];
};
}

View file

@ -0,0 +1,5 @@
{
plugins.nvim-autopairs = {
enable = true;
};
}

View file

@ -0,0 +1,50 @@
{
plugins.oil = {
enable = true;
settings = {
useDefaultKeymaps = true;
deleteToTrash = true;
float = {
padding = 2;
maxWidth = 0; # ''math.ceil(vim.o.lines * 0.8 - 4)'';
maxHeight = 0; # ''math.ceil(vim.o.columns * 0.8)'';
border = "rounded"; # 'single' | 'double' | 'shadow' | 'curved' | ... other options supported by win open
winOptions = {
winblend = 0;
};
};
preview = {
border = "rounded";
};
keymaps = {
"g?" = "actions.show_help";
"<CR>" = "actions.select";
"<C-\\>" = "actions.select_vsplit";
"<C-enter>" = "actions.select_split"; # this is used to navigate left
"<C-t>" = "actions.select_tab";
"<C-v>" = "actions.preview";
"<C-c>" = "actions.close";
"<C-r>" = "actions.refresh";
"-" = "actions.parent";
"_" = "actions.open_cwd";
"`" = "actions.cd";
"~" = "actions.tcd";
"gs" = "actions.change_sort";
"gx" = "actions.open_external";
"g." = "actions.toggle_hidden";
"q" = "actions.close";
};
};
};
keymaps = [
{
mode = "n";
key = "-";
action = ":Oil<CR>";
options = {
desc = "Open parent directory";
silent = true;
};
}
];
}

View file

@ -0,0 +1,5 @@
{
plugins.nvim-ufo = {
enable = true;
};
}

View file

@ -0,0 +1,20 @@
{
plugins.undotree = {
enable = true;
settings = {
autoOpenDiff = true;
focusOnToggle = true;
};
};
keymaps = [
{
mode = "n";
key = "<leader>ut";
action = "<cmd>UndotreeToggle<CR>";
options = {
silent = true;
desc = "Undotree";
};
}
];
}

View file

@ -0,0 +1,5 @@
{
plugins.which-key = {
enable = true;
};
}

View file

@ -0,0 +1,88 @@
{
config = {
programs.nixvim.opts = {
# Enable relative line numbers
number = true;
relativenumber = true;
# Set tabs to 2 spaces
tabstop = 2;
softtabstop = 2;
showtabline = 2;
expandtab = true;
# Enable auto indenting and set it to spaces
smartindent = true;
shiftwidth = 2;
# Enable smart indenting (see https://stackoverflow.com/questions/1204149/smart-wrap-in-vim)
breakindent = true;
# Enable incremental searching
hlsearch = true;
incsearch = true;
# Enable text wrap
wrap = true;
# Better splitting
splitbelow = true;
splitright = true;
# Enable mouse mode
mouse = "a"; # Mouse
# Enable ignorecase + smartcase for better searching
ignorecase = true;
smartcase = true; # Don't ignore case with capitals
grepprg = "rg --vimgrep";
grepformat = "%f:%l:%c:%m";
# Decrease updatetime
updatetime = 50; # faster completion (4000ms default)
# Set completeopt to have a better completion experience
completeopt = ["menuone" "noselect" "noinsert"]; # mostly just for cmp
# Enable persistent undo history
swapfile = false;
backup = false;
undofile = true;
# Enable 24-bit colors
termguicolors = true;
# Enable the sign column to prevent the screen from jumping
# signcolumn = "yes";
# Enable cursor line highlight
cursorline = true; # Highlight the line where the cursor is located
# Set fold settings
# These options were reccommended by nvim-ufo
# See: https://github.com/kevinhwang91/nvim-ufo#minimal-configuration
foldcolumn = "0";
foldlevel = 99;
foldlevelstart = 99;
foldenable = true;
# Always keep 8 lines above/below cursor unless at start/end of file
scrolloff = 8;
# Place a column line
# colorcolumn = "80";
# Reduce which-key timeout to 10ms
timeoutlen = 10;
# Set encoding type
encoding = "utf-8";
fileencoding = "utf-8";
# More space in the neovim command line for displaying messages
cmdheight = 0;
# We don't need to see things like INSERT anymore
showmode = false;
};
};
}

View file

@ -1,13 +1,12 @@
{ config, pkgs, lib, inputs, ... }:
with lib;
let
cfg = config.modules.programs.spicetify;
username = config.modules.other.system.username;
spicePkgs = inputs.spicetify-nix.packages.${pkgs.system}.default;
# inherit (inputs.spicetify-nix.packages.${pkgs.system}) spicetify-nix;
in {
options.modules.programs.spicetify.enable = mkEnableOption "spicetify";
config = mkIf cfg.enable {
options.modules.programs.spicetify.enable = lib.mkEnableOption "spicetify";
config = lib.mkIf cfg.enable {
home-manager.users.${username} = {
imports = [ inputs.spicetify-nix.homeManagerModule ];
programs.spicetify = {

View file

@ -1,11 +1,10 @@
{ config, lib, inputs, pkgs, ... }:
with lib;
let
cfg = config.modules.programs.waybar;
inherit (config.modules.other.system) username;
in {
options.modules.programs.waybar.enable = mkEnableOption "waybar";
config = mkIf cfg.enable {
options.modules.programs.waybar.enable = lib.mkEnableOption "waybar";
config = lib.mkIf cfg.enable {
home-manager.users.${username} = {
programs.waybar = {
enable = true;

View file

@ -1,18 +1,17 @@
{ config, pkgs, lib, inputs, ... }:
with lib;
let
cfg = config.modules.wms.wayland.hyprland;
username = config.modules.other.system.username;
inherit (inputs.hyprland.packages.${pkgs.system}) hyprland;
inherit (inputs.anyrun.packages.${pkgs.system}) anyrun;
inherit (inputs.nixpkgs-wayland.packages.${pkgs.system})
foot wl-clipboard swww wlsunset;
foot swww wlsunset;
inherit (inputs.waybar.packages.${pkgs.system}) waybar;
inherit (inputs.split-monitor-workspaces.packages.${pkgs.system})
split-monitor-workspaces;
in {
options.modules.wms.wayland.hyprland.enable = mkEnableOption "hyprland";
config = mkIf cfg.enable {
options.modules.wms.wayland.hyprland.enable = lib.mkEnableOption "hyprland";
config = lib.mkIf cfg.enable {
# xdg Portal
xdg.portal = {

View file

@ -1,12 +1,11 @@
{ config, lib, ... }:
with lib;
let
cfg = config.modules.wms.wayland;
hyprland = config.modules.wms.wayland.hyprland;
in {
options.modules.wms.wayland.enable = mkEnableOption "wayland";
options.modules.wms.wayland.enable = lib.mkEnableOption "wayland";
# options.modules.wms.wayland.hyprland.enable = mkEnableOption "hyprland";
config = mkIf cfg.enable {
config = lib.mkIf cfg.enable {
# lib.mkMerge [
# {
environment.variables = {