This commit is contained in:
Hadi
2024-06-17 19:45:21 +02:00
parent 9db5b9231e
commit 4aba4116de
261 changed files with 73 additions and 68 deletions

View File

@@ -0,0 +1,132 @@
{ config, ... }: {
programs.nixvim.highlight = {
AlphaHeaderColor.fg = "#${config.var.theme.colors.accent}";
AlphaTextColor.fg = "#${config.var.theme.colors.fg}";
AlphaShortcutColor.fg = "#${config.var.theme.colors.fgalt}";
};
programs.nixvim.plugins.alpha = {
enable = true;
layout = [
{
type = "padding";
val = 4;
}
{
type = "text";
opts = {
position = "center";
hl = "AlphaHeaderColor";
};
val = [
" "
" "
" "
" "
" "
" "
" "
" "
" "
];
}
{
type = "padding";
val = 4;
}
{
type = "group";
val = [
{
type = "button";
val = "󰭎 Find file";
on_press.__raw = "function() vim.cmd[[Telescope find_files]] end";
opts = {
shortcut = "nf";
position = "center";
cursor = 3;
width = 50;
align_shortcut = "right";
hl_shortcut = "AlphaShortcutColor";
hl = "AlphaTextColor";
};
}
{
type = "button";
val = " New file";
on_press.__raw = "function() vim.cmd[[ene]] end";
opts = {
shortcut = "nn";
position = "center";
cursor = 3;
width = 50;
align_shortcut = "right";
hl_shortcut = "AlphaShortcutColor";
hl = "AlphaTextColor";
};
}
{
type = "button";
val = " NixOs Config";
on_press.__raw = "function() vim.cmd[[e ~/.config/nixos]] end";
opts = {
shortcut = "nc";
position = "center";
cursor = 3;
width = 50;
align_shortcut = "right";
hl_shortcut = "AlphaShortcutColor";
hl = "AlphaTextColor";
};
}
{
type = "button";
val = " Recently used";
on_press.__raw = "function() vim.cmd[[Telescope oldfiles]] end";
opts = {
shortcut = "no";
position = "center";
cursor = 3;
width = 50;
align_shortcut = "right";
hl_shortcut = "AlphaShortcutColor";
hl = "AlphaTextColor";
};
}
{
type = "button";
val = "󰱽 Find text";
on_press.__raw = "function() vim.cmd[[Telescope live_grep]] end";
opts = {
shortcut = "nt";
position = "center";
cursor = 3;
width = 50;
align_shortcut = "right";
hl_shortcut = "AlphaShortcutColor";
hl = "AlphaTextColor";
};
}
{
type = "button";
val = "󰩈 Quit Neovim";
on_press.__raw = "function() vim.cmd[[qa]] end";
opts = {
shortcut = "nq";
position = "center";
cursor = 3;
width = 50;
align_shortcut = "right";
hl_shortcut = "AlphaShortcutColor";
hl = "AlphaTextColor";
};
}
];
}
];
};
}

View File

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

View File

@@ -0,0 +1 @@
{ programs.nixvim.plugins.bufferline = { enable = true; }; }

View File

@@ -0,0 +1,113 @@
{
programs.nixvim.plugins = {
luasnip.enable = true;
cmp-buffer = { enable = true; };
cmp-emoji = { enable = true; };
cmp-nvim-lsp = { enable = true; };
cmp-path = { enable = true; };
cmp_luasnip = { enable = true; };
cmp = {
enable = true;
settings = {
snippet.expand =
"function(args) require('luasnip').lsp_expand(args.body) end";
sources = [
{ name = "nvim_lsp"; }
{ name = "luasnip"; }
{ name = "buffer"; }
{ name = "nvim_lua"; }
{ name = "path"; }
];
formatting = {
fields = [ "abbr" "kind" "menu" ];
format =
# lua
''
function(_, item)
local icons = {
Namespace = "󰌗",
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 = "󰊄",
Table = "",
Object = "󰅩",
Tag = "",
Array = "[]",
Boolean = "",
Number = "",
Null = "󰟢",
String = "󰉿",
Calendar = "",
Watch = "󰥔",
Package = "",
Copilot = "",
Codeium = "",
TabNine = "",
}
local icon = icons[item.kind] or ""
item.kind = string.format("%s %s", icon, item.kind or "")
return item
end
'';
};
window = {
completion = {
winhighlight =
"FloatBorder:CmpBorder,Normal:CmpPmenu,Search:PmenuSel";
scrollbar = true;
sidePadding = 0;
border = [ "" "" "" "" "" "" "" "" ];
};
documentation = {
border = [ "" "" "" "" "" "" "" "" ];
winhighlight =
"FloatBorder:CmpBorder,Normal:CmpPmenu,Search:PmenuSel";
};
};
mapping = {
"<C-n>" = "cmp.mapping.select_next_item()";
"<C-p>" = "cmp.mapping.select_prev_item()";
"<Down>" = "cmp.mapping.select_next_item()";
"<Up>" = "cmp.mapping.select_prev_item()";
"<C-j>" = "cmp.mapping.select_next_item()";
"<C-k>" = "cmp.mapping.select_prev_item()";
"<C-d>" = "cmp.mapping.scroll_docs(-4)";
"<C-f>" = "cmp.mapping.scroll_docs(4)";
"<C-Space>" = "cmp.mapping.complete()";
"<C-e>" = "cmp.mapping.close()";
"<CR>" =
"cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Insert, select = true })";
};
};
};
};
}

View File

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

View File

@@ -0,0 +1,5 @@
{
programs.nixvim.plugins.copilot-vim = {
enable = true;
};
}

View File

@@ -0,0 +1,6 @@
{
programs.nixvim.plugins.gitsigns = {
enable = true;
settings = { current_line_blame = false; };
};
}

View File

@@ -0,0 +1,71 @@
{
programs.nixvim.keymaps = [
{
key = "<leader>e";
action = "<CMD>Neotree toggle<CR>";
}
{
key = "<space>fm";
action = "<CMD>lua vim.lsp.buf.format()<CR>";
}
{
key = "<leader>ot";
action = "<cmd>lua require('obsidian').util.toggle_checkbox()<cr>";
}
{
key = "<leader>oo";
action = "<cmd>ObsidianQuickSwitch<cr>";
}
{
key = "<leader>on";
action = "<cmd>ObsidianNew<cr>";
}
{
key = "<leader>of";
action = "<cmd>ObsidianSearch<cr>";
}
{
key = "<leader>oi";
action = "<cmd>ObsidianPasteImg<cr>";
}
{
key = "<leader>E";
action = "<cmd>Oil<cr>";
}
{
key = "<leader>t";
action = "<cmd>TroubleToggle<cr>";
}
{
key = "<C-h>";
action = "<cmd>TmuxNavigateLeft<cr>";
}
{
key = "<C-j>";
action = "<cmd>TmuxNavigateDown<cr>";
}
{
key = "<C-k>";
action = "<cmd>TmuxNavigateUp<cr>";
}
{
key = "<C-l>";
action = "<cmd>TmuxNavigateRight<cr>";
}
# Terminal Mappings
{
mode = "t";
key = "<esc>";
action = "<C-\\><C-n>";
}
];
}

View File

@@ -0,0 +1 @@
{ programs.nixvim.plugins.lazygit = { enable = true; }; }

View File

@@ -0,0 +1 @@
{ programs.nixvim.plugins.lualine = { enable = true; }; }

View File

@@ -0,0 +1,24 @@
{
programs.nixvim.plugins = {
lsp-format.enable = true;
lsp = {
enable = true;
servers = {
bashls.enable = true;
clangd.enable = true;
gopls.enable = true;
nixd.enable = true;
tailwindcss.enable = true;
html.enable = true;
svelte.enable = true;
};
keymaps.lspBuf = {
"gd" = "definition";
"gD" = "references";
"gt" = "type_definition";
"gi" = "implementation";
"K" = "hover";
};
};
};
}

View File

@@ -0,0 +1 @@
{ programs.nixvim.plugins.noice = { enable = true; }; }

View File

@@ -0,0 +1,20 @@
{
programs.nixvim.plugins.none-ls = {
enable = true;
sources = {
diagnostics = {
golangci_lint.enable = true;
statix.enable = true;
};
formatting = {
gofmt.enable = true;
goimports.enable = true;
nixfmt.enable = true;
markdownlint.enable = true;
tidy.enable = true;
shellharden.enable = true;
shfmt.enable = true;
};
};
};
}

View File

@@ -0,0 +1,5 @@
{
programs.nixvim.plugins.neo-tree = {
enable = true;
};
}

View File

@@ -0,0 +1,9 @@
{ config, ... }: {
programs.nixvim.plugins.obsidian = {
enable = config.var.obsidian;
settings = {
dir = "~/nextcloud/Notes";
disable_frontmatter = true;
};
};
}

View File

@@ -0,0 +1,6 @@
{
programs.nixvim.plugins.oil = {
enable = true;
settings = { default_file_explorer = false; };
};
}

View File

@@ -0,0 +1,13 @@
{
programs.nixvim.plugins.telescope = {
enable = true;
keymaps = {
"<leader>fg" = "live_grep";
#"<C-p>" = {
# action = "git_files";
# desc = "Telescope Git Files";
#};
};
extensions.fzf-native = { enable = true; };
};
}

View File

@@ -0,0 +1 @@
{ programs.nixvim.plugins.tmux-navigator = { enable = true; }; }

View File

@@ -0,0 +1,9 @@
{
programs.nixvim.plugins.toggleterm = {
enable = true;
settings = {
open_mapping = "[[<c-t>]]";
direction = "horizontal";
};
};
}

View File

@@ -0,0 +1,10 @@
{
programs.nixvim.plugins = {
treesitter = {
enable = true;
nixGrammars = true;
indent = true;
};
treesitter-context.enable = true;
};
}

View File

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

View File

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

View File

@@ -0,0 +1,6 @@
{
programs.nixvim.plugins.wilder = {
enable = true;
modes = [ ":" "/" "?" ];
};
}