neovim/fw
This commit is contained in:
parent
8d5e0e6566
commit
c4f7a64329
16 changed files with 427 additions and 24 deletions
|
|
@ -3,9 +3,7 @@
|
|||
pkgs,
|
||||
...
|
||||
}: {
|
||||
imports = [
|
||||
./waybar.nix
|
||||
];
|
||||
imports = [./waybar.nix];
|
||||
|
||||
services.mako = {
|
||||
enable = true;
|
||||
|
|
@ -163,9 +161,8 @@
|
|||
];
|
||||
|
||||
monitor = [",preferred,auto,1"];
|
||||
exec = [
|
||||
"${pkgs.swaybg}/bin/swaybg -i ${config.stylix.image} -m fill"
|
||||
];
|
||||
# monitor = [ "HDMI-A-1,1920x1080@144,auto,1" ];
|
||||
exec = ["${pkgs.swaybg}/bin/swaybg -i ${config.stylix.image} -m fill"];
|
||||
exec-once = [
|
||||
# Enables clipboard sync
|
||||
"${pkgs.wl-clipboard}/bin/wl-paste -p | ${pkgs.wl-clipboard}/bin/wl-copy"
|
||||
|
|
|
|||
|
|
@ -23,5 +23,6 @@
|
|||
nicotine-plus
|
||||
anki
|
||||
obsidian
|
||||
vlc
|
||||
];
|
||||
}
|
||||
|
|
|
|||
30
home-manager/modules/neovim/plugins/clangd-extensions.nix
Normal file
30
home-manager/modules/neovim/plugins/clangd-extensions.nix
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
{...}: {
|
||||
programs.nixvim = {
|
||||
plugins = {
|
||||
clangd-extensions = {
|
||||
enable = true;
|
||||
enableOffsetEncodingWorkaround = true;
|
||||
|
||||
ast = {
|
||||
roleIcons = {
|
||||
type = "";
|
||||
declaration = "";
|
||||
expression = "";
|
||||
specifier = "";
|
||||
statement = "";
|
||||
templateArgument = "";
|
||||
};
|
||||
kindIcons = {
|
||||
compound = "";
|
||||
recovery = "";
|
||||
translationUnit = "";
|
||||
packExpansion = "";
|
||||
templateTypeParm = "";
|
||||
templateTemplateParm = "";
|
||||
templateParamObject = "";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
181
home-manager/modules/neovim/plugins/cmp.nix
Normal file
181
home-manager/modules/neovim/plugins/cmp.nix
Normal file
|
|
@ -0,0 +1,181 @@
|
|||
{pkgs, ...}: {
|
||||
programs.nixvim = {
|
||||
extraConfigLuaPre = ''
|
||||
local has_words_before = function()
|
||||
unpack = unpack or table.unpack
|
||||
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
|
||||
return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
|
||||
end
|
||||
'';
|
||||
plugins = {
|
||||
luasnip = {
|
||||
enable = true;
|
||||
fromVscode = [{}];
|
||||
|
||||
settings = {
|
||||
enable_autosnippets = true;
|
||||
store_selection_keys = "<Tab>";
|
||||
};
|
||||
};
|
||||
friendly-snippets = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
lspkind = {
|
||||
enable = true;
|
||||
mode = "symbol_text";
|
||||
cmp = {
|
||||
enable = true;
|
||||
# Custom Theme
|
||||
after = ''
|
||||
function(entry, vim_item, kind)
|
||||
local strings = vim.split(kind.kind, "%s", { trimempty = true })
|
||||
kind.kind = " " .. (strings[1] or "") .. " "
|
||||
kind.menu = " (" .. (strings[2] or "") .. ")"
|
||||
return kind
|
||||
end
|
||||
'';
|
||||
};
|
||||
};
|
||||
cmp-nvim-lsp.enable = true;
|
||||
cmp-nvim-lua.enable = true;
|
||||
cmp_luasnip.enable = true;
|
||||
cmp-path.enable = true;
|
||||
cmp-latex-symbols.enable = true;
|
||||
cmp-buffer.enable = true;
|
||||
cmp = {
|
||||
enable = true;
|
||||
autoEnableSources = true;
|
||||
|
||||
settings = {
|
||||
experimental = {
|
||||
ghost_text = true;
|
||||
};
|
||||
sources = [
|
||||
{
|
||||
name = "nvim_lsp";
|
||||
# priority = 1000;
|
||||
# option = { };
|
||||
}
|
||||
|
||||
{name = "luasnip";}
|
||||
|
||||
{name = "buffer";}
|
||||
|
||||
{name = "path";}
|
||||
];
|
||||
|
||||
mapping = {
|
||||
"<CR>" = "cmp.mapping.confirm({ select = true })";
|
||||
"<Tab>" = ''
|
||||
cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item()
|
||||
elseif require("luasnip").expand_or_locally_jumpable() then
|
||||
require("luasnip").expand_or_jump()
|
||||
elseif has_words_before() then
|
||||
cmp.complete()
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { "i", "s" })
|
||||
'';
|
||||
"<S-Tab>" = ''
|
||||
cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_prev_item()
|
||||
elseif require("luasnip").jumpable(-1) then
|
||||
require("luasnip").jump(-1)
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { "i", "s" })
|
||||
'';
|
||||
"<C-Space>" = "cmp.mapping.complete()";
|
||||
"<C-e>" = "cmp.mapping.abort()";
|
||||
"<Up>" = "cmp.mapping.select_prev_item()";
|
||||
"<Down>" = "cmp.mapping.select_next_item()";
|
||||
"<C-p>" = "cmp.mapping.select_prev_item()";
|
||||
"<C-n>" = "cmp.mapping.select_next_item()";
|
||||
"<C-u>" = "cmp.mapping.scroll_docs(-4)";
|
||||
"<C-d>" = "cmp.mapping.scroll_docs(4)";
|
||||
};
|
||||
window = {
|
||||
documentation.max_height = "math.floor(40 * (40 / vim.o.lines))";
|
||||
completion = {
|
||||
winhighlight = "Normal:Pmenu,FloatBorder:Pmenu,Search:None";
|
||||
col_offset = -3;
|
||||
side_padding = 0;
|
||||
border = "rounded";
|
||||
};
|
||||
documentation = {
|
||||
border = "rounded";
|
||||
};
|
||||
};
|
||||
|
||||
snippet.expand = ''
|
||||
function(args)
|
||||
require('luasnip').lsp_expand(args.body)
|
||||
end
|
||||
'';
|
||||
|
||||
formatting = {
|
||||
fields = [
|
||||
"kind"
|
||||
"abbr"
|
||||
"menu"
|
||||
];
|
||||
};
|
||||
|
||||
menu = {
|
||||
buffer = "";
|
||||
calc = "";
|
||||
cmdline = "";
|
||||
codeium = "";
|
||||
emoji = "";
|
||||
git = "";
|
||||
luasnip = "";
|
||||
neorg = "";
|
||||
nvim_lsp = "";
|
||||
nvim_lua = "";
|
||||
path = "";
|
||||
spell = "";
|
||||
treesitter = "";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
extraPlugins = with pkgs.vimPlugins; [vim-snippets];
|
||||
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 = "",
|
||||
}
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
@ -6,6 +6,8 @@ _: {
|
|||
./catppuccin.nix
|
||||
./comment.nix
|
||||
./conform.nix
|
||||
./clangd-extensions.nix
|
||||
./cmp.nix
|
||||
./diffview.nix
|
||||
./flash.nix
|
||||
./git-conflict.nix
|
||||
|
|
@ -14,6 +16,7 @@ _: {
|
|||
./illuminate.nix
|
||||
./lightbulb.nix
|
||||
./lualine.nix
|
||||
./lean.nix
|
||||
./lsp.nix
|
||||
./mini-bufremove.nix
|
||||
./navic.nix
|
||||
|
|
@ -22,12 +25,14 @@ _: {
|
|||
./notify.nix
|
||||
./precognition.nix
|
||||
./spectre.nix
|
||||
./refactoring.nix
|
||||
./telescope.nix
|
||||
./todo-comments.nix
|
||||
./toggleterm.nix
|
||||
./treesitter.nix
|
||||
./trouble.nix
|
||||
./which-key.nix
|
||||
./undotree.nix
|
||||
./yazi.nix
|
||||
];
|
||||
}
|
||||
|
|
|
|||
9
home-manager/modules/neovim/plugins/lean.nix
Normal file
9
home-manager/modules/neovim/plugins/lean.nix
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
{...}: {
|
||||
programs.nixvim = {
|
||||
plugins.lean = {
|
||||
enable = true;
|
||||
lsp.enable = false;
|
||||
abbreviations.enable = false;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -70,6 +70,10 @@
|
|||
};
|
||||
};
|
||||
};
|
||||
|
||||
pyright.enable = true;
|
||||
hls.enable = true;
|
||||
leanls.enable = true;
|
||||
};
|
||||
};
|
||||
which-key.settings.spec = [
|
||||
|
|
|
|||
100
home-manager/modules/neovim/plugins/refactoring.nix
Normal file
100
home-manager/modules/neovim/plugins/refactoring.nix
Normal file
|
|
@ -0,0 +1,100 @@
|
|||
{...}: {
|
||||
programs.nixvim = {
|
||||
plugins = {
|
||||
refactoring = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
telescope.enabledExtensions = ["refactoring"];
|
||||
|
||||
which-key.settings.spec = [
|
||||
{
|
||||
__unkeyed = "<leader>r";
|
||||
mode = "x";
|
||||
group = " Refactor";
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
keymaps = [
|
||||
{
|
||||
mode = "x";
|
||||
key = "<leader>re";
|
||||
action = ":Refactor extract ";
|
||||
options = {
|
||||
desc = "Extract";
|
||||
silent = true;
|
||||
};
|
||||
}
|
||||
{
|
||||
mode = "x";
|
||||
key = "<leader>rE";
|
||||
action = ":Refactor extract_to_file ";
|
||||
options = {
|
||||
desc = "Extract to file";
|
||||
silent = true;
|
||||
};
|
||||
}
|
||||
{
|
||||
mode = "x";
|
||||
key = "<leader>rv";
|
||||
action = ":Refactor extract_var ";
|
||||
options = {
|
||||
desc = "Extract var";
|
||||
silent = true;
|
||||
};
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>ri";
|
||||
action = ":Refactor inline_var<CR>";
|
||||
options = {
|
||||
desc = "Inline var";
|
||||
silent = true;
|
||||
};
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>rI";
|
||||
action = ":Refactor inline_func<CR>";
|
||||
options = {
|
||||
desc = "Inline Func";
|
||||
silent = true;
|
||||
};
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>rb";
|
||||
action = ":Refactor extract_block<CR>";
|
||||
options = {
|
||||
desc = "Extract block";
|
||||
silent = true;
|
||||
};
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>rB";
|
||||
action = ":Refactor extract_block_to_file<CR>";
|
||||
options = {
|
||||
desc = "Extract block to file";
|
||||
silent = true;
|
||||
};
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>fR";
|
||||
action.__raw =
|
||||
# lua
|
||||
''
|
||||
function()
|
||||
require('telescope').extensions.refactoring.refactors()
|
||||
end
|
||||
'';
|
||||
options = {
|
||||
desc = "Refactoring";
|
||||
silent = true;
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
@ -2,6 +2,13 @@
|
|||
programs.nixvim = {
|
||||
plugins.todo-comments = {
|
||||
enable = true;
|
||||
|
||||
keymaps = {
|
||||
todoTelescope = {
|
||||
key = "<leader>ft";
|
||||
keywords = "TODO,FIX,HACK";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,6 +7,8 @@
|
|||
|
||||
settings = {
|
||||
indent.enable = true;
|
||||
highlight.enable = true;
|
||||
incremental_selection.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
|||
39
home-manager/modules/neovim/plugins/undotree.nix
Normal file
39
home-manager/modules/neovim/plugins/undotree.nix
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
{...}: {
|
||||
programs.nixvim = {
|
||||
plugins.undotree = {
|
||||
enable = true;
|
||||
|
||||
settings = {
|
||||
CursorLine = true;
|
||||
DiffAutoOpen = true;
|
||||
DiffCommand = "diff";
|
||||
DiffpanelHeight = 10;
|
||||
HelpLine = true;
|
||||
HighlightChangedText = true;
|
||||
HighlightChangedWithSign = true;
|
||||
HighlightSyntaxAdd = "DiffAdd";
|
||||
HighlightSyntaxChange = "DiffChange";
|
||||
HighlightSyntaxDel = "DiffDelete";
|
||||
RelativeTimestamp = true;
|
||||
SetFocusWhenToggle = true;
|
||||
ShortIndicators = false;
|
||||
TreeNodeShape = "*";
|
||||
TreeReturnShape = "\\";
|
||||
TreeSplitShape = "/";
|
||||
TreeVertShape = "|";
|
||||
};
|
||||
};
|
||||
|
||||
keymaps = [
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>uu";
|
||||
action = ":UndotreeToggle<CR>";
|
||||
options = {
|
||||
desc = "Undotree toggle";
|
||||
silent = true;
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue