removed unused plugins in home/programs/nvim

This commit is contained in:
serenity-F 2024-12-26 23:15:27 +10:00
parent 814e6b9151
commit 8fcf44d780
12 changed files with 489 additions and 540 deletions

View file

@ -1,21 +1,57 @@
# Nixvim is a NixOS module that installs and configures Neovim
{ inputs, ... }: { { inputs, ... }: {
imports = [ imports = [
inputs.nixvim.homeManagerModules.nixvim
./plugins/cmp.nix inputs.nixvim.homeManagerModules.nixvim # uses the module channel from `flake.nix`
./plugins/dashboard.nix ./keymaps.nix # keybinds
## Neovim plugins
./plugins/utils.nix
./plugins/ui.nix
./plugins/lsp.nix ./plugins/lsp.nix
./plugins/markdown.nix ./plugins/markdown.nix
./plugins/tree.nix
./plugins/ui.nix
./plugins/utils.nix
./plugins/dap.nix
./plugins/telescope.nix ./plugins/telescope.nix
./plugins/zenmode.nix
./options.nix
./keymaps.nix
]; ];
programs.nixvim.enable = true; ## Enables nixvim
programs = {
nixvim = {
enable = true;
globals = { mapleader = " "; };
opts = {
updatetime = 50; # Faster completion
number = true;
relativenumber = true;
autoindent = true;
clipboard = "unnamed,unnamedplus";
expandtab = true;
tabstop = 2;
softtabstop = 2;
shiftwidth = 2;
smartindent = true;
breakindent = true;
ignorecase = true;
incsearch = true;
hlsearch = true;
smartcase = true;
wildmode = "list:longest";
completeopt = [ "menuone" "noselect" "noinsert" ];
signcolumn = "yes";
cursorline = false;
scrolloff = 8;
mouse = "a";
termguicolors = true;
showmode = false;
wrap = false;
swapfile = false;
undofile = true;
conceallevel = 3;
};
};
};
} }

View file

@ -1,38 +0,0 @@
{
programs.nixvim.globals.mapleader = " ";
programs.nixvim.opts = {
updatetime = 50; # Faster completion
number = true;
relativenumber = true;
autoindent = true;
clipboard = "unnamed,unnamedplus";
expandtab = true;
tabstop = 2;
softtabstop = 2;
shiftwidth = 2;
smartindent = true;
breakindent = true;
ignorecase = true;
incsearch = true;
hlsearch = true;
smartcase = true;
wildmode = "list:longest";
completeopt = [ "menuone" "noselect" "noinsert" ];
signcolumn = "yes";
cursorline = false;
scrolloff = 8;
mouse = "a";
termguicolors = true;
showmode = false;
wrap = false;
swapfile = false;
undofile = true;
conceallevel = 3;
};
}

View file

@ -1,6 +0,0 @@
{
plugins = {
bufferline.enable = true;
web-devicons.enable = true;
};
}

View file

@ -1,117 +0,0 @@
{
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";
option.get_bufnrs.__raw = "vim.api.nvim_list_bufs";
}
{ name = "nvim_lua"; }
{ name = "mkdnflow"; }
{ 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 = false;
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

@ -1,28 +0,0 @@
{ pkgs, ... }: {
programs.nixvim.plugins.dap = {
enable = true;
adapters = { };
signs = {
dapBreakpoint = {
text = "●";
texthl = "DapBreakpoint";
};
dapBreakpointCondition = {
text = "●";
texthl = "DapBreakpointCondition";
};
dapLogPoint = {
text = "◆";
texthl = "DapLogPoint";
};
};
extensions = {
dap-go = {
enable = true;
delve.path = "${pkgs.delve}/bin/dlv";
};
dap-ui = { enable = true; };
dap-virtual-text = { enable = true; };
};
};
}

View file

@ -1,155 +0,0 @@
{ config, ... }:
let
accent = "#${config.theme.colors.color14}";
muted = "#${config.theme.colors.secondary-bg}";
foreground = "#${config.theme.colors.primary-fg}";
in {
programs.nixvim.highlight = {
AlphaHeaderColor.fg = accent;
AlphaTextColor.fg = foreground;
AlphaShortcutColor.fg = muted;
};
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[[Neotree /home/serenity/flakes/nixdots/home/common/dotconfig/nvim]] end";
opts = {
shortcut = "nc";
position = "center";
cursor = 3;
width = 50;
align_shortcut = "right";
hl_shortcut = "AlphaShortcutColor";
hl = "AlphaTextColor";
};
}
{
type = "button";
val = " Keybindings";
on_press.__raw =
"function() vim.cmd[[e /home/serenity/flakes/nixdots/home/common/dotconfig/nvim/docs/KEYBINDINGS.md]] 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

@ -1,20 +1,23 @@
{ {
programs.nixvim.plugins = { programs.nixvim.plugins = {
## Misc. LSP related plugins
web-devicons.enable = true;
bufferline.enable = true;
## Language syntax processing
lsp-format.enable = true; lsp-format.enable = true;
lsp = { lsp = {
enable = true; enable = true;
servers = { servers = {
html.enable = true;
cssls.enale = true;
marksman.enable = true;
bashls.enable = true; bashls.enable = true;
clangd.enable = true;
gopls.enable = true;
nixd = { nixd = {
enable = true; enable = true;
extraOptions = { expr = "import <nixpkgs> {}"; }; extraOptions = { expr = "import <nixpkgs> {}"; };
}; };
tailwindcss.enable = true;
html.enable = true;
svelte.enable = true;
marksman.enable = true;
}; };
keymaps.lspBuf = { keymaps.lspBuf = {
"gd" = "definition"; "gd" = "definition";
@ -32,17 +35,128 @@
statix.enable = true; statix.enable = true;
}; };
formatting = { formatting = {
gofmt.enable = true;
goimports.enable = true;
nixfmt.enable = true;
markdownlint.enable = true;
tidy.enable = true; tidy.enable = true;
shellharden.enable = true; markdownlint.enable = true;
shfmt.enable = true; shfmt.enable = true;
golines.enable = true; shellharden.enable = true;
gofumpt.enable = true; nixfmt.enable = true;
}; };
}; };
}; };
## Completion
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";
option.get_bufnrs.__raw = "vim.api.nvim_list_bufs";
}
{ name = "nvim_lua"; }
{ name = "mkdnflow"; }
{ 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 = false;
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

@ -22,10 +22,54 @@ in {
fg = accent; fg = accent;
}; };
}; };
plugins.telescope = { plugins = {
telescope = {
enable = true; enable = true;
extensions.fzf-native = { enable = true; }; extensions.fzf-native = { enable = true; };
settings.defaults = { selection_caret = "❚ "; }; settings.defaults = { selection_caret = "❚ "; };
}; };
## Tree
#treesitter-context.enable = true;
neo-tree.enable = true;
oil = {
enable = true;
settings = {
default_file_explorer = false;
skip_confirm_for_simple_edits = true;
win_options = {
concealcursor = "ncv";
conceallevel = 3;
cursorcolumn = false;
foldcolumn = "0";
list = false;
signcolumn = "no";
spell = false;
wrap = false;
};
float = { padding = 5; };
keymaps = {
"-" = "actions.parent";
"b" = "actions.parent";
"<C-c>" = "actions.close";
"<C-h>" = "actions.select_split";
"<C-l>" = "actions.refresh";
"<C-p>" = "actions.preview";
"<C-s>" = "actions.select_vsplit";
"<C-t>" = "actions.select_tab";
"<CR>" = "actions.select";
_ = "actions.open_cwd";
"`" = "actions.cd";
"g." = "actions.toggle_hidden";
"g?" = "actions.show_help";
"g\\" = "actions.toggle_trash";
gs = "actions.change_sort";
gx = "actions.open_external";
"~" = "actions.tcd";
};
};
};
};
}; };
} }

View file

@ -1,44 +0,0 @@
{
programs.nixvim = {
plugins = {
neo-tree.enable = true;
oil = {
enable = true;
settings = {
default_file_explorer = false;
skip_confirm_for_simple_edits = true;
win_options = {
concealcursor = "ncv";
conceallevel = 3;
cursorcolumn = false;
foldcolumn = "0";
list = false;
signcolumn = "no";
spell = false;
wrap = false;
};
float = { padding = 5; };
keymaps = {
"-" = "actions.parent";
"b" = "actions.parent";
"<C-c>" = "actions.close";
"<C-h>" = "actions.select_split";
"<C-l>" = "actions.refresh";
"<C-p>" = "actions.preview";
"<C-s>" = "actions.select_vsplit";
"<C-t>" = "actions.select_tab";
"<CR>" = "actions.select";
_ = "actions.open_cwd";
"`" = "actions.cd";
"g." = "actions.toggle_hidden";
"g?" = "actions.show_help";
"g\\" = "actions.toggle_trash";
gs = "actions.change_sort";
gx = "actions.open_external";
"~" = "actions.tcd";
};
};
};
};
};
}

View file

@ -1,8 +1,24 @@
{ pkgs, config, ... }: { { config, pkgs, ... }:
let
accent = "#${config.theme.colors.color14}";
muted = "#${config.theme.colors.secondary-bg}";
foreground = "#${config.theme.colors.primary-fg}";
in {
home.packages = with pkgs; [ ctags ]; home.packages = with pkgs; [ ctags ];
programs.nixvim = { programs = {
colorschemes.modus = { nixvim = {
highlight = {
AlphaHeaderColor.fg = accent;
AlphaTextColor.fg = foreground;
AlphaShortcutColor.fg = muted;
};
colorschemes = {
modus = {
enable = true; enable = true;
settings = { settings = {
transparent = true; transparent = true;
@ -29,6 +45,7 @@
}; };
}; };
}; };
};
plugins = { plugins = {
#transparent.enable = true; #transparent.enable = true;
lualine = { lualine = {
@ -70,6 +87,7 @@
enable = true; enable = true;
settings.current_line_blame = false; settings.current_line_blame = false;
}; };
trouble.enable = true; trouble.enable = true;
indent-blankline.enable = true; indent-blankline.enable = true;
colorizer.enable = true; colorizer.enable = true;
@ -77,6 +95,149 @@
enable = true; enable = true;
tagsPackage = pkgs.universal-ctags; tagsPackage = pkgs.universal-ctags;
}; };
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[[Neotree /home/serenity/flakes/nixdots/home/common/dotconfig/nvim]] end";
opts = {
shortcut = "nc";
position = "center";
cursor = 3;
width = 50;
align_shortcut = "right";
hl_shortcut = "AlphaShortcutColor";
hl = "AlphaTextColor";
};
}
{
type = "button";
val = " Keybindings";
on_press.__raw =
"function() vim.cmd[[e /home/serenity/flakes/nixdots/home/common/dotconfig/nvim/docs/KEYBINDINGS.md]] 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

@ -1,10 +1,8 @@
{ config, ... }: { { config, pkgs, ... }: {
programs.nixvim = { programs.nixvim = {
highlightOverride = { highlightOverride = { FloatBorder.fg = "#${config.theme.colors.color15}"; };
FloatBorder.fg = "#${config.theme.colors.color15}";
};
plugins = { plugins = {
copilot-vim.enable = true;
flash.enable = true; flash.enable = true;
image = { image = {
enable = true; enable = true;
@ -13,11 +11,13 @@
onlyRenderImageAtCursor = true; onlyRenderImageAtCursor = true;
}; };
}; };
tmux-navigator.enable = true; tmux-navigator.enable = true;
comment.enable = true; comment.enable = true;
nvim-autopairs.enable = true; nvim-autopairs.enable = true;
friendly-snippets.enable = true; friendly-snippets.enable = true;
todo-comments.enable = true; todo-comments.enable = true;
treesitter = { treesitter = {
enable = true; enable = true;
nixGrammars = true; nixGrammars = true;
@ -26,6 +26,7 @@
highlight.enable = true; highlight.enable = true;
}; };
}; };
harpoon = { harpoon = {
enable = true; enable = true;
enableTelescope = true; enableTelescope = true;
@ -43,7 +44,34 @@
}; };
}; };
}; };
# treesitter-context.enable = true;
dap = {
enable = true;
adapters = { };
signs = {
dapBreakpoint = {
text = "●";
texthl = "DapBreakpoint";
};
dapBreakpointCondition = {
text = "●";
texthl = "DapBreakpointCondition";
};
dapLogPoint = {
text = "◆";
texthl = "DapLogPoint";
};
};
extensions = {
dap-go = {
enable = true;
delve.path = "${pkgs.delve}/bin/dlv";
};
dap-ui = { enable = true; };
dap-virtual-text = { enable = true; };
};
};
}; };
}; };
} }

View file

@ -1,46 +0,0 @@
{
programs.nixvim.plugins = {
zen-mode = {
enable = true;
settings = {
on_close = ''
function()
require("gitsigns.actions").toggle_current_line_blame()
vim.cmd('IBLEnable')
vim.opt.signcolumn = "yes:2"
vim.wo.wrap = false
vim.wo.linebreak = false
require("gitsigns.actions").refresh()
end
'';
on_open = ''
function()
require("gitsigns.actions").toggle_current_line_blame()
vim.cmd('IBLDisable')
vim.opt.relativenumber = false
vim.opt.signcolumn = "no"
vim.wo.wrap = true
vim.wo.linebreak = true
require("gitsigns.actions").refresh()
end
'';
window = {
backdrop = 1;
height = 1;
options = {
signcolumn = "no";
number = false;
relativenumber = false;
cursorline = false;
cursorcolumn = false;
foldcolumn = "0";
list = false;
};
width = 0.8;
};
};
};
};
}