Initial commit
This commit is contained in:
32
home/editors/nvim/colorschemes.nix
Normal file
32
home/editors/nvim/colorschemes.nix
Normal file
@@ -0,0 +1,32 @@
|
||||
{
|
||||
programs.nixvim = {
|
||||
colorscheme = "catppuccin";
|
||||
|
||||
colorschemes.catppuccin = {
|
||||
enable = true;
|
||||
settings = {
|
||||
flavour = "mocha";
|
||||
transparent_background = true;
|
||||
integrations = {
|
||||
cmp = true;
|
||||
gitsigns = true;
|
||||
mini = {
|
||||
enable = true;
|
||||
indentscope_color = "lavender";
|
||||
};
|
||||
nvimtree = true;
|
||||
treesitter = true;
|
||||
alpha = true;
|
||||
fzf = true;
|
||||
grug_far = true;
|
||||
harpoon = true;
|
||||
markdown = true;
|
||||
noice = true;
|
||||
copilot_vim = true;
|
||||
lsp_trouble = true;
|
||||
which_key = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
47
home/editors/nvim/default.nix
Normal file
47
home/editors/nvim/default.nix
Normal file
@@ -0,0 +1,47 @@
|
||||
{inputs, ...}: {
|
||||
imports = [
|
||||
inputs.nixvim.homeModules.nixvim
|
||||
./plugins
|
||||
./colorschemes.nix
|
||||
];
|
||||
|
||||
programs.nixvim = {
|
||||
enable = true;
|
||||
defaultEditor = true;
|
||||
|
||||
globals.mapleader = " ";
|
||||
clipboard.register = "unnamedplus";
|
||||
luaLoader.enable = true;
|
||||
|
||||
opts = import ./options.nix;
|
||||
keymaps = import ./keymaps.nix;
|
||||
|
||||
extraConfigLua =
|
||||
# lua
|
||||
''
|
||||
-- Disable netrw
|
||||
g.loaded_netrw = 1
|
||||
g.loaded_netrwPlugin = 1
|
||||
|
||||
-- Hide line numbers in terminal mode
|
||||
vim.cmd [[ autocmd TermOpen * setlocal nonumber norelativenumber ]]
|
||||
|
||||
-- Disable arrow keys
|
||||
-- vim.cmd [[ :map <Up> <Nop> ]]
|
||||
-- vim.cmd [[ :map <Left> <Nop> ]]
|
||||
-- vim.cmd [[ :map <Right> <Nop> ]]
|
||||
-- vim.cmd [[ :map <Down> <Nop> ]]
|
||||
|
||||
-- Enable diagnostics virtual text
|
||||
vim.diagnostic.config({ virtual_text = true })
|
||||
|
||||
-- Add filetypes
|
||||
vim.filetype.add({
|
||||
pattern = {
|
||||
[".*%.arb"] = "json",
|
||||
["%.sqruff"] = "toml",
|
||||
},
|
||||
})
|
||||
'';
|
||||
};
|
||||
}
|
||||
43
home/editors/nvim/keymaps.nix
Normal file
43
home/editors/nvim/keymaps.nix
Normal file
@@ -0,0 +1,43 @@
|
||||
let
|
||||
toggle = key: action: {
|
||||
key = "\\${key}";
|
||||
options.desc = "Toggle ${action}";
|
||||
action = "<cmd>setlocal ${action}!<cr>";
|
||||
};
|
||||
window-jump = key: {
|
||||
key = "<c-${key}>";
|
||||
action = "<c-w>${key}";
|
||||
};
|
||||
in
|
||||
[
|
||||
{
|
||||
key = "<S-u>";
|
||||
options.desc = "Redo";
|
||||
action = "<C-r>";
|
||||
}
|
||||
|
||||
{
|
||||
key = "<c-c>";
|
||||
options.desc = "Comment line";
|
||||
action = "<cmd>normal gcc<cr>";
|
||||
}
|
||||
|
||||
(toggle "w" "wrap")
|
||||
(toggle "n" "number")
|
||||
(toggle "r" "relativenumber")
|
||||
(toggle "i" "ignorecase")
|
||||
(toggle "c" "cursorline")
|
||||
(toggle "C" "cursorcolumn")
|
||||
|
||||
{
|
||||
key = "<s-h>";
|
||||
options.desc = "Previous buffer";
|
||||
action = "<cmd>bprevious<cr>";
|
||||
}
|
||||
{
|
||||
key = "<s-l>";
|
||||
options.desc = "Next Buffer";
|
||||
action = "<cmd>bnext<cr>";
|
||||
}
|
||||
]
|
||||
++ map window-jump ["h" "j" "k" "l"]
|
||||
38
home/editors/nvim/options.nix
Normal file
38
home/editors/nvim/options.nix
Normal file
@@ -0,0 +1,38 @@
|
||||
{
|
||||
# General
|
||||
undofile = true;
|
||||
backup = false;
|
||||
writebackup = false;
|
||||
mouse = "a";
|
||||
|
||||
# Appearance
|
||||
breakindent = true;
|
||||
cursorline = false;
|
||||
linebreak = true;
|
||||
number = true;
|
||||
relativenumber = true;
|
||||
|
||||
# Editing
|
||||
ignorecase = true;
|
||||
incsearch = true;
|
||||
infercase = true;
|
||||
smartcase = true;
|
||||
smartindent = true;
|
||||
|
||||
hidden = true;
|
||||
title = true;
|
||||
tabstop = 2;
|
||||
scrolloff = 8;
|
||||
shiftwidth = 2;
|
||||
numberwidth = 4;
|
||||
showcmd = true;
|
||||
hlsearch = true;
|
||||
swapfile = false;
|
||||
expandtab = true;
|
||||
updatetime = 100;
|
||||
timeoutlen = 1000;
|
||||
sidescrolloff = 8;
|
||||
termguicolors = true;
|
||||
splitkeep = "screen";
|
||||
fileencoding = "utf-8";
|
||||
}
|
||||
56
home/editors/nvim/plugins/builds.nix
Normal file
56
home/editors/nvim/plugins/builds.nix
Normal file
@@ -0,0 +1,56 @@
|
||||
pkgs: let
|
||||
build = {
|
||||
version,
|
||||
owner,
|
||||
name,
|
||||
rev,
|
||||
hash,
|
||||
}:
|
||||
pkgs.vimUtils.buildVimPlugin {
|
||||
pname = name;
|
||||
inherit version;
|
||||
src = pkgs.fetchFromGitHub {
|
||||
repo = name;
|
||||
inherit owner rev;
|
||||
sha256 = hash;
|
||||
};
|
||||
};
|
||||
in {
|
||||
# INFO: Last update: 18. Aug. 2025 | Sort latest -> oldest
|
||||
|
||||
# https://github.com/SCJangra/table-nvim
|
||||
table-nvim = build {
|
||||
version = "27-09-2024";
|
||||
owner = "SCJangra";
|
||||
name = "table-nvim";
|
||||
rev = "c044fd37169eb10376962b0d0cec5f94d58ca626";
|
||||
hash = "1ygn4bvnpbd49gcgbkh0cdj3p75jsmwi87hby78w0fd22205pvmi";
|
||||
};
|
||||
|
||||
# https://github.com/michaelrommel/nvim-silicon
|
||||
silicon = build {
|
||||
version = "09-01-2025";
|
||||
owner = "michaelrommel";
|
||||
name = "nvim-silicon";
|
||||
rev = "7f66bda8f60c97a5bf4b37e5b8acb0e829ae3c32";
|
||||
hash = "1zk6lgghvdcys20cqvh2g1kjf661q1w97niq5nx1zz4yppy2f9jy";
|
||||
};
|
||||
|
||||
# https://github.com/b0o/incline.nvim
|
||||
incline = build {
|
||||
version = "05-06-2025";
|
||||
owner = "b0o";
|
||||
name = "incline.nvim";
|
||||
rev = "0fd2d5a27504dba7fdc507a53275f22c081fe640";
|
||||
hash = "19x35z2sj3hl3icrxzbs67xhxgq9d237vhgzqrz8ppdc74p8wgaz";
|
||||
};
|
||||
|
||||
# https://github.com/Aasim-A/scrollEOF.nvim
|
||||
scrollEOF = build {
|
||||
version = "31-05-2025";
|
||||
owner = "Aasim-A";
|
||||
name = "scrollEOF.nvim";
|
||||
rev = "2575109749b4bf3a0bf979a17947b3c1e8c5137e";
|
||||
hash = "1s66v9n0arg81wgw1z8iv9s304j78cd506z522avpc88d3ji4yl4";
|
||||
};
|
||||
}
|
||||
257
home/editors/nvim/plugins/cmp/cmp.nix
Normal file
257
home/editors/nvim/plugins/cmp/cmp.nix
Normal file
@@ -0,0 +1,257 @@
|
||||
{lib, ...}: {
|
||||
plugins = {
|
||||
cmp = {
|
||||
enable = true;
|
||||
autoEnableSources = true;
|
||||
settings = {
|
||||
experimental.ghost_text = true;
|
||||
mapping.__raw = ''
|
||||
cmp.mapping.preset.insert({
|
||||
["<C-j>"] = cmp.mapping.scroll_docs(4),
|
||||
["<C-k>"] = cmp.mapping.scroll_docs(-4),
|
||||
["<CR>"] = cmp.mapping.confirm({
|
||||
behavior = cmp.ConfirmBehavior.Replace,
|
||||
select = true
|
||||
}),
|
||||
["<Tab>"] = cmp.mapping(function(fallback)
|
||||
local luasnip = require("luasnip")
|
||||
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item()
|
||||
elseif luasnip.locally_jumpable(1) then
|
||||
luasnip.jump(1)
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { "i", "s" }),
|
||||
["<S-Tab>"] = cmp.mapping(function(fallback)
|
||||
local luasnip = require("luasnip")
|
||||
|
||||
if cmp.visible() then
|
||||
cmp.select_prev_item()
|
||||
elseif luasnip.locally_jumpable(-1) then
|
||||
luasnip.jump(-1)
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { "i", "s" }),
|
||||
})
|
||||
'';
|
||||
|
||||
window = {
|
||||
completion = {
|
||||
winhighlight = "Normal:Pmenu,FloatBorder:Pmenu,Search:None";
|
||||
col_offset = -3;
|
||||
side_padding = 0;
|
||||
};
|
||||
documentation = {
|
||||
winhighlight = "Normal:Pmenu,FloatBorder:Pmenu,Search:None";
|
||||
col_offset = -3;
|
||||
side_padding = 0;
|
||||
};
|
||||
};
|
||||
|
||||
snippet.expand =
|
||||
# lua
|
||||
''
|
||||
function(args)
|
||||
require'luasnip'.lsp_expand(args.body)
|
||||
end
|
||||
'';
|
||||
|
||||
formatting = {
|
||||
# expandable_indicator = true;
|
||||
fields = ["kind" "abbr" "menu"];
|
||||
|
||||
format =
|
||||
lib.mkForce
|
||||
# lua
|
||||
''
|
||||
function(entry, vim_item)
|
||||
local kind = require("lspkind").cmp_format({ mode = "symbol_text", maxwidth = 50 })(entry, vim_item)
|
||||
local strings = vim.split(kind.kind, "%s", { trimempty = true })
|
||||
kind.kind = " " .. (strings[1] or "") .. " "
|
||||
kind.menu = " (" .. (strings[2] or "") .. ")"
|
||||
return kind
|
||||
end
|
||||
'';
|
||||
};
|
||||
|
||||
completion.completeopt = "menu,menuone,preview,noinsert";
|
||||
|
||||
sources = [
|
||||
{name = "nvim_lsp";}
|
||||
{name = "buffer";}
|
||||
{name = "path";}
|
||||
{name = "luasnip";}
|
||||
];
|
||||
};
|
||||
|
||||
cmdline = {
|
||||
"/" = {
|
||||
mapping.__raw = "cmp.mapping.preset.cmdline()";
|
||||
sources = [{name = "buffer";}];
|
||||
};
|
||||
":" = {
|
||||
mapping.__raw = "cmp.mapping.preset.cmdline()";
|
||||
sources = [
|
||||
{
|
||||
name = "path";
|
||||
}
|
||||
{
|
||||
name = "cmdline";
|
||||
option.ignore_cmds = ["Man" "!"];
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
cmp-nvim-lsp.enable = true;
|
||||
cmp-buffer.enable = true;
|
||||
cmp-path.enable = true;
|
||||
cmp-cmdline.enable = true;
|
||||
cmp_luasnip.enable = true;
|
||||
};
|
||||
|
||||
# TODO: fix (https://github.com/hrsh7th/nvim-cmp/wiki/Menu-Appearance#how-to-get-types-on-the-left-and-offset-the-menu)
|
||||
highlight = {
|
||||
PmenuSel = {
|
||||
bg = "#282C34";
|
||||
fg = "NONE";
|
||||
};
|
||||
Pmenu = {
|
||||
fg = "#C5CDD9";
|
||||
bg = "#22252A";
|
||||
};
|
||||
|
||||
CmpItemAbbrDeprecated = {
|
||||
fg = "#7E8294";
|
||||
bg = "NONE";
|
||||
strikethrough = true;
|
||||
};
|
||||
CmpItemAbbrMatch = {
|
||||
fg = "#82AAFF";
|
||||
bg = "NONE";
|
||||
bold = true;
|
||||
};
|
||||
CmpItemAbbrMatchFuzzy = {
|
||||
fg = "#82AAFF";
|
||||
bg = "NONE";
|
||||
bold = true;
|
||||
};
|
||||
CmpItemMenu = {
|
||||
fg = "#C792EA";
|
||||
bg = "NONE";
|
||||
italic = true;
|
||||
};
|
||||
|
||||
CmpItemKindField = {
|
||||
fg = "#EED8DA";
|
||||
bg = "#B5585F";
|
||||
};
|
||||
CmpItemKindProperty = {
|
||||
fg = "#EED8DA";
|
||||
bg = "#B5585F";
|
||||
};
|
||||
CmpItemKindEvent = {
|
||||
fg = "#EED8DA";
|
||||
bg = "#B5585F";
|
||||
};
|
||||
|
||||
CmpItemKindText = {
|
||||
fg = "#C3E88D";
|
||||
bg = "#9FBD73";
|
||||
};
|
||||
CmpItemKindEnum = {
|
||||
fg = "#C3E88D";
|
||||
bg = "#9FBD73";
|
||||
};
|
||||
CmpItemKindKeyword = {
|
||||
fg = "#C3E88D";
|
||||
bg = "#9FBD73";
|
||||
};
|
||||
|
||||
CmpItemKindConstant = {
|
||||
fg = "#FFE082";
|
||||
bg = "#D4BB6C";
|
||||
};
|
||||
CmpItemKindConstructor = {
|
||||
fg = "#FFE082";
|
||||
bg = "#D4BB6C";
|
||||
};
|
||||
CmpItemKindReference = {
|
||||
fg = "#FFE082";
|
||||
bg = "#D4BB6C";
|
||||
};
|
||||
|
||||
CmpItemKindFunction = {
|
||||
fg = "#EADFF0";
|
||||
bg = "#A377BF";
|
||||
};
|
||||
CmpItemKindStruct = {
|
||||
fg = "#EADFF0";
|
||||
bg = "#A377BF";
|
||||
};
|
||||
CmpItemKindClass = {
|
||||
fg = "#EADFF0";
|
||||
bg = "#A377BF";
|
||||
};
|
||||
CmpItemKindModule = {
|
||||
fg = "#EADFF0";
|
||||
bg = "#A377BF";
|
||||
};
|
||||
CmpItemKindOperator = {
|
||||
fg = "#EADFF0";
|
||||
bg = "#A377BF";
|
||||
};
|
||||
|
||||
CmpItemKindVariable = {
|
||||
fg = "#C5CDD9";
|
||||
bg = "#7E8294";
|
||||
};
|
||||
CmpItemKindFile = {
|
||||
fg = "#C5CDD9";
|
||||
bg = "#7E8294";
|
||||
};
|
||||
|
||||
CmpItemKindUnit = {
|
||||
fg = "#F5EBD9";
|
||||
bg = "#D4A959";
|
||||
};
|
||||
CmpItemKindSnippet = {
|
||||
fg = "#F5EBD9";
|
||||
bg = "#D4A959";
|
||||
};
|
||||
CmpItemKindFolder = {
|
||||
fg = "#F5EBD9";
|
||||
bg = "#D4A959";
|
||||
};
|
||||
|
||||
CmpItemKindMethod = {
|
||||
fg = "#DDE5F5";
|
||||
bg = "#6C8ED4";
|
||||
};
|
||||
CmpItemKindValue = {
|
||||
fg = "#DDE5F5";
|
||||
bg = "#6C8ED4";
|
||||
};
|
||||
CmpItemKindEnumMember = {
|
||||
fg = "#DDE5F5";
|
||||
bg = "#6C8ED4";
|
||||
};
|
||||
|
||||
CmpItemKindInterface = {
|
||||
fg = "#D8EEEB";
|
||||
bg = "#58B5A8";
|
||||
};
|
||||
CmpItemKindColor = {
|
||||
fg = "#D8EEEB";
|
||||
bg = "#58B5A8";
|
||||
};
|
||||
CmpItemKindTypeParameter = {
|
||||
fg = "#D8EEEB";
|
||||
bg = "#58B5A8";
|
||||
};
|
||||
};
|
||||
}
|
||||
33
home/editors/nvim/plugins/cmp/copilot.nix
Normal file
33
home/editors/nvim/plugins/cmp/copilot.nix
Normal file
@@ -0,0 +1,33 @@
|
||||
{
|
||||
enable = true;
|
||||
|
||||
settings = {
|
||||
panel.enabled = false;
|
||||
|
||||
suggestion = {
|
||||
autoTrigger = true;
|
||||
keymap = {
|
||||
accept = "<M-l>";
|
||||
next = "<M-]>";
|
||||
prev = "<M-[>";
|
||||
dismiss = "<C-]>";
|
||||
};
|
||||
};
|
||||
|
||||
filetypes = {
|
||||
yaml = true;
|
||||
markdown = true;
|
||||
|
||||
javascript = true;
|
||||
typescript = true;
|
||||
|
||||
help = false;
|
||||
gitcommit = false;
|
||||
gitrebase = false;
|
||||
hgcommit = false;
|
||||
svn = false;
|
||||
cvs = false;
|
||||
"." = false;
|
||||
};
|
||||
};
|
||||
}
|
||||
10
home/editors/nvim/plugins/cmp/default.nix
Normal file
10
home/editors/nvim/plugins/cmp/default.nix
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
imports = [
|
||||
./cmp.nix
|
||||
];
|
||||
|
||||
plugins = {
|
||||
emmet.enable = true;
|
||||
# copilot-lua = import ./copilot.nix;
|
||||
};
|
||||
}
|
||||
10
home/editors/nvim/plugins/decoration/config.lua
Normal file
10
home/editors/nvim/plugins/decoration/config.lua
Normal file
@@ -0,0 +1,10 @@
|
||||
require("incline").setup {}
|
||||
|
||||
-- vim_current_word
|
||||
vim.cmd [[
|
||||
hi CurrentWord guifg=#cba6f7
|
||||
let g:vim_current_word#hightlight_twins = 0
|
||||
let g:vim_current_word#excluded_filetypes = ["minifiles", "netrw", "alpha"]
|
||||
]]
|
||||
|
||||
local g = vim.g
|
||||
17
home/editors/nvim/plugins/decoration/default.nix
Normal file
17
home/editors/nvim/plugins/decoration/default.nix
Normal file
@@ -0,0 +1,17 @@
|
||||
{pkgs, ...}: {
|
||||
extraPlugins = let
|
||||
builds = import ../builds.nix pkgs;
|
||||
in
|
||||
with builds;
|
||||
with pkgs.vimPlugins; [
|
||||
incline
|
||||
scrollEOF
|
||||
|
||||
vim-hexokinase
|
||||
vim_current_word
|
||||
];
|
||||
|
||||
plugins.noice.enable = true;
|
||||
|
||||
extraConfigLua = builtins.readFile ./config.lua;
|
||||
}
|
||||
26
home/editors/nvim/plugins/default.nix
Normal file
26
home/editors/nvim/plugins/default.nix
Normal file
@@ -0,0 +1,26 @@
|
||||
{pkgs, ...}: {
|
||||
imports = [
|
||||
./lsp
|
||||
];
|
||||
|
||||
programs.nixvim = {
|
||||
# TODO: make these hm level
|
||||
imports = [
|
||||
./cmp
|
||||
./decoration
|
||||
./editing
|
||||
./formatting
|
||||
./git
|
||||
./lang
|
||||
./snippet
|
||||
./treesitter
|
||||
./utils
|
||||
];
|
||||
|
||||
plugins.mini.enable = true;
|
||||
plugins.web-devicons.enable = true;
|
||||
|
||||
|
||||
extraPlugins = with pkgs.vimPlugins; [plenary-nvim dressing-nvim];
|
||||
};
|
||||
}
|
||||
38
home/editors/nvim/plugins/editing/default.nix
Normal file
38
home/editors/nvim/plugins/editing/default.nix
Normal file
@@ -0,0 +1,38 @@
|
||||
{
|
||||
plugins = {
|
||||
nvim-autopairs = {
|
||||
enable = true;
|
||||
settings = {
|
||||
mapBs = false;
|
||||
checkTs = true;
|
||||
tsConfig = {
|
||||
lua = ["string" "source"];
|
||||
javascript = ["string" "template_string"];
|
||||
};
|
||||
disabledFiletypes = ["minifiles"];
|
||||
};
|
||||
};
|
||||
|
||||
mini = {
|
||||
modules = {
|
||||
move = {};
|
||||
splitjoin = {};
|
||||
# surround = {};
|
||||
trailspace = {};
|
||||
};
|
||||
};
|
||||
|
||||
rainbow-delimiters.enable = true;
|
||||
twilight.enable = true;
|
||||
zen-mode.enable = true;
|
||||
|
||||
nvim-tree = {
|
||||
enable = true;
|
||||
settings = {
|
||||
renderer = {
|
||||
group_empty = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
128
home/editors/nvim/plugins/formatting/conform.nix
Normal file
128
home/editors/nvim/plugins/formatting/conform.nix
Normal file
@@ -0,0 +1,128 @@
|
||||
{pkgs, ...}: {
|
||||
extraPackages = with pkgs; [
|
||||
shfmt
|
||||
shellcheck
|
||||
stylua
|
||||
alejandra
|
||||
|
||||
prettier
|
||||
prettierd
|
||||
|
||||
sqruff
|
||||
|
||||
yamlfmt
|
||||
|
||||
black
|
||||
|
||||
go
|
||||
gotools
|
||||
google-java-format
|
||||
ktlint
|
||||
rustfmt
|
||||
clang-tools
|
||||
cmake-format
|
||||
|
||||
kdePackages.qtdeclarative # qmlformat
|
||||
];
|
||||
|
||||
plugins.conform-nvim = {
|
||||
enable = true;
|
||||
|
||||
settings = {
|
||||
notifyOnError = true;
|
||||
|
||||
formatters_by_ft = let
|
||||
prettier = {
|
||||
__unkeyed-1 = "prettierd";
|
||||
__unkeyed-2 = "prettier";
|
||||
timeout_ms = 2000;
|
||||
stop_after_first = true;
|
||||
};
|
||||
in {
|
||||
sh = ["shellcheck" "shfmt"];
|
||||
lua = ["stylua"];
|
||||
nix = ["alejandra"];
|
||||
|
||||
html = prettier;
|
||||
css = prettier;
|
||||
javascript = prettier;
|
||||
typescript = prettier;
|
||||
javascriptreact = prettier;
|
||||
typescriptreact = prettier;
|
||||
|
||||
sql = ["sqruff"];
|
||||
|
||||
json = prettier;
|
||||
yaml = ["yamlfmt"];
|
||||
|
||||
python = ["black"];
|
||||
|
||||
go = ["goimports" "gofmt"];
|
||||
java = ["google-java-format"];
|
||||
kotlin = ["ktlint"];
|
||||
rust = ["rustfmt"];
|
||||
c = ["clang_format"];
|
||||
cmake = ["cmake_format"];
|
||||
cpp = ["clang_format"];
|
||||
|
||||
qml = ["qmlformat"];
|
||||
qmljs = ["qmlformat"];
|
||||
|
||||
"_" = ["trim_whitespace" "trim_newlines"];
|
||||
};
|
||||
|
||||
formatters = {
|
||||
prettier = {
|
||||
command = "prettier";
|
||||
prepend_args = ["-w"];
|
||||
};
|
||||
prettierd = {
|
||||
command = "prettierd";
|
||||
prepend_args = ["-w"];
|
||||
};
|
||||
};
|
||||
|
||||
format_on_save =
|
||||
# lua
|
||||
''
|
||||
function(bufnr)
|
||||
if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then
|
||||
return
|
||||
end
|
||||
|
||||
if vim.g.slow_format_filetypes[vim.bo[bufnr].filetype] then
|
||||
return
|
||||
end
|
||||
|
||||
local function on_format(err)
|
||||
if err and err:match("timeout$") then
|
||||
slow_format_filetypes[vim.bo[bufnr].filetype] = true
|
||||
end
|
||||
end
|
||||
|
||||
return { timeout_ms = 200, lsp_fallback = true }, on_format
|
||||
end
|
||||
'';
|
||||
|
||||
format_after_save =
|
||||
# lua
|
||||
''
|
||||
function (bufnr)
|
||||
if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then
|
||||
return
|
||||
end
|
||||
|
||||
if not vim.g.slow_format_filetypes[vim.bo[bufnr].filetype] then
|
||||
return
|
||||
end
|
||||
|
||||
return { lsp_fallback = true }
|
||||
end
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
extraConfigLua = ''
|
||||
vim.g.slow_format_filetypes = {};
|
||||
'';
|
||||
}
|
||||
32
home/editors/nvim/plugins/formatting/default.nix
Normal file
32
home/editors/nvim/plugins/formatting/default.nix
Normal file
@@ -0,0 +1,32 @@
|
||||
{
|
||||
imports = [./conform.nix];
|
||||
|
||||
plugins.mini = {
|
||||
modules = {
|
||||
align = {};
|
||||
indentscope = {
|
||||
symbol = "▏";
|
||||
draw.delay = 0;
|
||||
options.try_as_border = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
extraConfigLua =
|
||||
# lua
|
||||
''
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
desc = "Disable indentscope for certain filetypes",
|
||||
pattern = {
|
||||
"alpha",
|
||||
"help",
|
||||
"NvimTree",
|
||||
"toggleterm",
|
||||
"Trouble",
|
||||
},
|
||||
callback = function()
|
||||
vim.b.miniindentscope_disable = true
|
||||
end,
|
||||
})
|
||||
'';
|
||||
}
|
||||
14
home/editors/nvim/plugins/git/default.nix
Normal file
14
home/editors/nvim/plugins/git/default.nix
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
plugins = {
|
||||
fugitive.enable = true;
|
||||
diffview.enable = true;
|
||||
gitmessenger = {
|
||||
enable = true;
|
||||
settings = {
|
||||
include_diff = "current";
|
||||
no_default_mappings = true;
|
||||
};
|
||||
};
|
||||
gitsigns = import ./gitsigns.nix;
|
||||
};
|
||||
}
|
||||
23
home/editors/nvim/plugins/git/gitsigns.nix
Normal file
23
home/editors/nvim/plugins/git/gitsigns.nix
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
enable = true;
|
||||
|
||||
settings = {
|
||||
numhl = true;
|
||||
current_line_blame = true;
|
||||
signs = {
|
||||
add.text = "▎";
|
||||
change.text = "▎";
|
||||
delete.text = "";
|
||||
topdelete.text = "";
|
||||
changedelete.text = "▎";
|
||||
untracked.text = "▎";
|
||||
};
|
||||
signs_staged = {
|
||||
add.text = "▎";
|
||||
change.text = "▎";
|
||||
delete.text = "";
|
||||
topdelete.text = "";
|
||||
changedelete.text = "▎";
|
||||
};
|
||||
};
|
||||
}
|
||||
8
home/editors/nvim/plugins/lang/default.nix
Normal file
8
home/editors/nvim/plugins/lang/default.nix
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
imports = [
|
||||
./docs
|
||||
./flutter.nix
|
||||
./tailwind.nix
|
||||
./rust.nix
|
||||
];
|
||||
}
|
||||
6
home/editors/nvim/plugins/lang/docs/default.nix
Normal file
6
home/editors/nvim/plugins/lang/docs/default.nix
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
imports = [
|
||||
./latex.nix
|
||||
./markdown.nix
|
||||
];
|
||||
}
|
||||
22
home/editors/nvim/plugins/lang/docs/latex.nix
Normal file
22
home/editors/nvim/plugins/lang/docs/latex.nix
Normal file
@@ -0,0 +1,22 @@
|
||||
{pkgs, ...}: {
|
||||
extraPackages = with pkgs; [sioyek tectonic];
|
||||
|
||||
plugins.vimtex.enable = true;
|
||||
|
||||
extraConfigLua = ''
|
||||
vim.g["vimtex_view_method"] = "sioyek"
|
||||
vim.g["vimtex_quickfix_mode"] = 0 -- supress error reporting on save and build
|
||||
vim.g["vimtex_mappings_enable"] = 0 -- ignore mappings
|
||||
vim.g["vimtex_indent_enabled"] = 0 -- auto indent
|
||||
vim.g["tex_flavor"] = "latex" -- how to read tex files
|
||||
vim.g["tex_indent_items"] = 0 -- turn off enumerate indent
|
||||
vim.g["tex_indent_brace"] = 0 -- turn off brace indent
|
||||
vim.g["vimtex_compiler_method"] = "tectonic" -- tex compiler
|
||||
vim.g["vimtex_log_ignore"] = ({ -- Error supression:
|
||||
"Underfull",
|
||||
"Overfull",
|
||||
"specifier changed to",
|
||||
"Token not allowed in a PDF string",
|
||||
})
|
||||
'';
|
||||
}
|
||||
23
home/editors/nvim/plugins/lang/docs/markdown.nix
Normal file
23
home/editors/nvim/plugins/lang/docs/markdown.nix
Normal file
@@ -0,0 +1,23 @@
|
||||
{pkgs, ...}: {
|
||||
plugins = {
|
||||
markdown-preview = {
|
||||
enable = true;
|
||||
settings = {
|
||||
auto_close = 0;
|
||||
browser = "firefox";
|
||||
page_title = "Markdown Preview";
|
||||
};
|
||||
};
|
||||
|
||||
render-markdown = {
|
||||
enable = true;
|
||||
settings = {
|
||||
pipe_table.border = ["╭" "┬" "╮" "├" "┼" "┤" "╰" "┴" "╯" "│" "─"];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
extraPlugins = let
|
||||
builds = import ../../builds.nix pkgs;
|
||||
in [builds.table-nvim];
|
||||
}
|
||||
3
home/editors/nvim/plugins/lang/flutter.nix
Normal file
3
home/editors/nvim/plugins/lang/flutter.nix
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
plugins.flutter-tools.enable = true;
|
||||
}
|
||||
23
home/editors/nvim/plugins/lang/rust.nix
Normal file
23
home/editors/nvim/plugins/lang/rust.nix
Normal file
@@ -0,0 +1,23 @@
|
||||
{pkgs, ...}: {
|
||||
plugins = {
|
||||
crates.enable = true;
|
||||
|
||||
rustaceanvim = {
|
||||
enable = false;
|
||||
settings = {
|
||||
server.cmd = ["rust-analyzer"];
|
||||
dap.adapter.__raw = let
|
||||
codelldb = pkgs.vscode-extensions.vadimcn.vscode-lldb;
|
||||
extensionPath = "${codelldb}/share/vscode/extensions/vadimcn.vscode-lldb";
|
||||
codelldbPath = "${extensionPath}/adapter/codelldb";
|
||||
liblldbPath = "${extensionPath}/lldb/lib/liblldb.so";
|
||||
in ''
|
||||
require("rustaceanvim.config").get_codelldb_adapter(
|
||||
"${codelldbPath}",
|
||||
"${liblldbPath}"
|
||||
)
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
3
home/editors/nvim/plugins/lang/tailwind.nix
Normal file
3
home/editors/nvim/plugins/lang/tailwind.nix
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
plugins.tailwind-tools.enable = true;
|
||||
}
|
||||
31
home/editors/nvim/plugins/lsp/default.nix
Normal file
31
home/editors/nvim/plugins/lsp/default.nix
Normal file
@@ -0,0 +1,31 @@
|
||||
{
|
||||
imports = [./servers.nix ./lint.nix];
|
||||
|
||||
programs.nixvim = {
|
||||
plugins = {
|
||||
lspkind = import ./lspkind.nix;
|
||||
lspconfig.enable = true;
|
||||
trouble.enable = true;
|
||||
};
|
||||
|
||||
keymaps = let
|
||||
trouble-lsp = key: action: {
|
||||
mode = "";
|
||||
inherit key;
|
||||
options.desc = action;
|
||||
action = "<cmd>Trouble lsp_${action}<cr>";
|
||||
};
|
||||
in [
|
||||
{
|
||||
mode = "";
|
||||
key = "K";
|
||||
options.desc = "Hover";
|
||||
action = "<cmd>Lspsaga hover_doc<cr>";
|
||||
}
|
||||
|
||||
(trouble-lsp "gd" "definitions")
|
||||
(trouble-lsp "gr" "references")
|
||||
(trouble-lsp "gi" "implementations")
|
||||
];
|
||||
};
|
||||
}
|
||||
93
home/editors/nvim/plugins/lsp/kotlin-lsp.nix
Normal file
93
home/editors/nvim/plugins/lsp/kotlin-lsp.nix
Normal file
@@ -0,0 +1,93 @@
|
||||
{
|
||||
stdenv,
|
||||
lib,
|
||||
fetchzip,
|
||||
makeWrapper,
|
||||
unzip,
|
||||
jdk17_headless,
|
||||
}:
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "kotlin-lsp";
|
||||
version = "0.253.10629";
|
||||
|
||||
src = fetchzip {
|
||||
url = "https://download-cdn.jetbrains.com/kotlin-lsp/${version}/kotlin-${version}.zip";
|
||||
hash = "sha256-LCLGo3Q8/4TYI7z50UdXAbtPNgzFYtmUY/kzo2JCln0=";
|
||||
stripRoot = false;
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
makeWrapper
|
||||
unzip
|
||||
];
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
mkdir -p $out/bin $out/libexec/kotlin-lsp
|
||||
cp -r $src/* $out/libexec/kotlin-lsp/
|
||||
|
||||
makeWrapper ${jdk17_headless}/bin/java $out/bin/kotlin-lsp \
|
||||
--add-flags "--add-opens java.base/java.io=ALL-UNNAMED" \
|
||||
--add-flags "--add-opens java.base/java.lang=ALL-UNNAMED" \
|
||||
--add-flags "--add-opens java.base/java.lang.ref=ALL-UNNAMED" \
|
||||
--add-flags "--add-opens java.base/java.lang.reflect=ALL-UNNAMED" \
|
||||
--add-flags "--add-opens java.base/java.net=ALL-UNNAMED" \
|
||||
--add-flags "--add-opens java.base/java.nio=ALL-UNNAMED" \
|
||||
--add-flags "--add-opens java.base/java.nio.charset=ALL-UNNAMED" \
|
||||
--add-flags "--add-opens java.base/java.text=ALL-UNNAMED" \
|
||||
--add-flags "--add-opens java.base/java.time=ALL-UNNAMED" \
|
||||
--add-flags "--add-opens java.base/java.util=ALL-UNNAMED" \
|
||||
--add-flags "--add-opens java.base/java.util.concurrent=ALL-UNNAMED" \
|
||||
--add-flags "--add-opens java.base/java.util.concurrent.atomic=ALL-UNNAMED" \
|
||||
--add-flags "--add-opens java.base/java.util.concurrent.locks=ALL-UNNAMED" \
|
||||
--add-flags "--add-opens java.base/jdk.internal.vm=ALL-UNNAMED" \
|
||||
--add-flags "--add-opens java.base/sun.net.dns=ALL-UNNAMED" \
|
||||
--add-flags "--add-opens java.base/sun.nio.ch=ALL-UNNAMED" \
|
||||
--add-flags "--add-opens java.base/sun.nio.fs=ALL-UNNAMED" \
|
||||
--add-flags "--add-opens java.base/sun.security.ssl=ALL-UNNAMED" \
|
||||
--add-flags "--add-opens java.base/sun.security.util=ALL-UNNAMED" \
|
||||
--add-flags "--add-opens java.desktop/com.apple.eawt=ALL-UNNAMED" \
|
||||
--add-flags "--add-opens java.desktop/com.apple.eawt.event=ALL-UNNAMED" \
|
||||
--add-flags "--add-opens java.desktop/com.apple.laf=ALL-UNNAMED" \
|
||||
--add-flags "--add-opens java.desktop/com.sun.java.swing=ALL-UNNAMED" \
|
||||
--add-flags "--add-opens java.desktop/com.sun.java.swing.plaf.gtk=ALL-UNNAMED" \
|
||||
--add-flags "--add-opens java.desktop/java.awt=ALL-UNNAMED" \
|
||||
--add-flags "--add-opens java.desktop/java.awt.dnd.peer=ALL-UNNAMED" \
|
||||
--add-flags "--add-opens java.desktop/java.awt.event=ALL-UNNAMED" \
|
||||
--add-flags "--add-opens java.desktop/java.awt.font=ALL-UNNAMED" \
|
||||
--add-flags "--add-opens java.desktop/java.awt.image=ALL-UNNAMED" \
|
||||
--add-flags "--add-opens java.desktop/java.awt.peer=ALL-UNNAMED" \
|
||||
--add-flags "--add-opens java.desktop/javax.swing=ALL-UNNAMED" \
|
||||
--add-flags "--add-opens java.desktop/javax.swing.plaf.basic=ALL-UNNAMED" \
|
||||
--add-flags "--add-opens java.desktop/javax.swing.text=ALL-UNNAMED" \
|
||||
--add-flags "--add-opens java.desktop/javax.swing.text.html=ALL-UNNAMED" \
|
||||
--add-flags "--add-opens java.desktop/sun.awt=ALL-UNNAMED" \
|
||||
--add-flags "--add-opens java.desktop/sun.awt.X11=ALL-UNNAMED" \
|
||||
--add-flags "--add-opens java.desktop/sun.awt.datatransfer=ALL-UNNAMED" \
|
||||
--add-flags "--add-opens java.desktop/sun.awt.image=ALL-UNNAMED" \
|
||||
--add-flags "--add-opens java.desktop/sun.awt.windows=ALL-UNNAMED" \
|
||||
--add-flags "--add-opens java.desktop/sun.font=ALL-UNNAMED" \
|
||||
--add-flags "--add-opens java.desktop/sun.java2d=ALL-UNNAMED" \
|
||||
--add-flags "--add-opens java.desktop/sun.lwawt=ALL-UNNAMED" \
|
||||
--add-flags "--add-opens java.desktop/sun.lwawt.macosx=ALL-UNNAMED" \
|
||||
--add-flags "--add-opens java.desktop/sun.swing=ALL-UNNAMED" \
|
||||
--add-flags "--add-opens java.management/sun.management=ALL-UNNAMED" \
|
||||
--add-flags "--add-opens jdk.attach/sun.tools.attach=ALL-UNNAMED" \
|
||||
--add-flags "--add-opens jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED" \
|
||||
--add-flags "--add-opens jdk.internal.jvmstat/sun.jvmstat.monitor=ALL-UNNAMED" \
|
||||
--add-flags "--add-opens jdk.jdi/com.sun.tools.jdi=ALL-UNNAMED" \
|
||||
--add-flags "--enable-native-access=ALL-UNNAMED" \
|
||||
--add-flags "-Djdk.lang.Process.launchMechanism=FORK" \
|
||||
--add-flags "-cp \"$out/libexec/kotlin-lsp/lib/*\" com.jetbrains.ls.kotlinLsp.KotlinLspServerKt"
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
meta = {
|
||||
description = "Kotlin Language Server (Standalone Binary)";
|
||||
homepage = "https://github.com/Kotlin/kotlin-lsp";
|
||||
license = lib.licenses.asl20;
|
||||
platforms = lib.platforms.linux ++ lib.platforms.darwin;
|
||||
};
|
||||
}
|
||||
56
home/editors/nvim/plugins/lsp/lint.nix
Normal file
56
home/editors/nvim/plugins/lsp/lint.nix
Normal file
@@ -0,0 +1,56 @@
|
||||
{pkgs, ...}: {
|
||||
programs.nixvim = {
|
||||
extraPackages = with pkgs; [
|
||||
statix
|
||||
selene
|
||||
|
||||
eslint_d
|
||||
stylelint
|
||||
|
||||
yamllint
|
||||
sqlfluff
|
||||
|
||||
markdownlint-cli2
|
||||
|
||||
ruff
|
||||
rubocop
|
||||
checkstyle
|
||||
golangci-lint
|
||||
python312Packages.flake8
|
||||
|
||||
clippy
|
||||
cppcheck
|
||||
cmake-lint
|
||||
];
|
||||
|
||||
plugins.lint = {
|
||||
enable = true;
|
||||
lintersByFt = {
|
||||
bash = ["bash"];
|
||||
nix = ["statix"];
|
||||
lua = ["selene"];
|
||||
|
||||
css = ["stylelint"];
|
||||
javascript = ["eslint_d"];
|
||||
javascriptreact = ["eslint_d"];
|
||||
typescript = ["eslint_d"];
|
||||
typescriptreact = ["eslint_d"];
|
||||
|
||||
sql = ["sqlfluff"];
|
||||
|
||||
yaml = ["yamllint"];
|
||||
|
||||
markdown = ["markdownlint-cli2"];
|
||||
|
||||
python = ["ruff"];
|
||||
ruby = ["rubocop"];
|
||||
go = ["golangcilint"];
|
||||
java = ["checkstyle"];
|
||||
|
||||
rust = ["clippy"];
|
||||
cpp = ["cppcheck"];
|
||||
cmake = ["cmakelint"];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
53
home/editors/nvim/plugins/lsp/lspkind.nix
Normal file
53
home/editors/nvim/plugins/lsp/lspkind.nix
Normal file
@@ -0,0 +1,53 @@
|
||||
{
|
||||
enable = true;
|
||||
settings = {
|
||||
preset = "colorful";
|
||||
|
||||
symbolMap = {
|
||||
Copilot = "";
|
||||
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 = "";
|
||||
};
|
||||
|
||||
extraOptions = {
|
||||
maxwidth = 50;
|
||||
mode = "symbol";
|
||||
ellipsisChar = "...";
|
||||
menu = {
|
||||
path = "[Path]";
|
||||
cmdline = "[CMD]";
|
||||
nvim_lsp = "[LSP]";
|
||||
buffer = "[Buffer]";
|
||||
luasnip = "[Snippet]";
|
||||
};
|
||||
|
||||
show_labelDetails = true;
|
||||
before.__raw = ''
|
||||
require'tailwind-tools.cmp'.lspkind_format
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
123
home/editors/nvim/plugins/lsp/servers.nix
Normal file
123
home/editors/nvim/plugins/lsp/servers.nix
Normal file
@@ -0,0 +1,123 @@
|
||||
{pkgs, ...}: {
|
||||
programs.nixvim = {
|
||||
extraPlugins = with pkgs.vimPlugins; [SchemaStore-nvim];
|
||||
|
||||
extraPackages = let
|
||||
kotlin-lsp = pkgs.callPackage ./kotlin-lsp.nix {};
|
||||
in [kotlin-lsp];
|
||||
|
||||
plugins = {
|
||||
jdtls.enable = true;
|
||||
};
|
||||
|
||||
lsp.servers = {
|
||||
"*".config = {
|
||||
root_markers = [
|
||||
".git"
|
||||
"flake.nix"
|
||||
];
|
||||
};
|
||||
|
||||
bashls.enable = true;
|
||||
nixd.enable = true;
|
||||
lua_ls = {
|
||||
enable = true;
|
||||
config.on_init.__raw =
|
||||
# lua
|
||||
''
|
||||
function(client)
|
||||
if client.workspace_folders then
|
||||
local path = client.workspace_folders[1].name
|
||||
if
|
||||
path ~= vim.fn.stdpath('config')
|
||||
and (vim.uv.fs_stat(path .. '/.luarc.json') or vim.uv.fs_stat(path .. '/.luarc.jsonc'))
|
||||
then
|
||||
return
|
||||
end
|
||||
end
|
||||
client.config.settings.Lua = vim.tbl_deep_extend('force', client.config.settings.Lua, {
|
||||
runtime = {
|
||||
version = 'LuaJIT',
|
||||
path = {
|
||||
'lua/?.lua',
|
||||
'lua/?/init.lua',
|
||||
},
|
||||
},
|
||||
workspace = {
|
||||
checkThirdParty = false,
|
||||
library = {
|
||||
vim.env.VIMRUNTIME
|
||||
}
|
||||
}
|
||||
})
|
||||
end
|
||||
'';
|
||||
};
|
||||
|
||||
typos_lsp = {
|
||||
enable = true;
|
||||
config.init_options.diagnosticSeverity = "Hint";
|
||||
};
|
||||
|
||||
html.enable = true;
|
||||
ts_ls.enable = true;
|
||||
cssls.enable = true;
|
||||
eslint.enable = true;
|
||||
tailwindcss.enable = true;
|
||||
|
||||
taplo.enable = true;
|
||||
jsonls = {
|
||||
enable = true;
|
||||
config.json = {
|
||||
schemas.__raw = "require('schemastore').json.schemas()";
|
||||
validate.enable = true;
|
||||
};
|
||||
};
|
||||
yamlls = {
|
||||
enable = true;
|
||||
config.yaml = {
|
||||
schemaStore = {
|
||||
enable = false;
|
||||
url = "";
|
||||
};
|
||||
schemas.__raw = "require('schemastore').yaml.schemas()";
|
||||
};
|
||||
};
|
||||
|
||||
texlab.enable = true;
|
||||
marksman.enable = true;
|
||||
|
||||
sqruff = {
|
||||
enable = true;
|
||||
config.sqruff.indentation = {
|
||||
indent_unit = "space";
|
||||
tab_space_size = 2;
|
||||
};
|
||||
};
|
||||
graphql.enable = true;
|
||||
|
||||
dockerls.enable = true;
|
||||
docker_compose_language_service.enable = true;
|
||||
|
||||
gopls.enable = true;
|
||||
dartls.enable = true;
|
||||
pylyzer.enable = true;
|
||||
solargraph.enable = true;
|
||||
|
||||
jdtls.enable = true;
|
||||
kotlin_lsp.enable = true;
|
||||
|
||||
# also see lang/rust.nix
|
||||
rust_analyzer = {
|
||||
enable = true;
|
||||
packageFallback = true;
|
||||
};
|
||||
clangd.enable = true;
|
||||
cmake.enable = true;
|
||||
|
||||
glslls.enable = true;
|
||||
|
||||
qmlls.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
84
home/editors/nvim/plugins/snippet/default.nix
Normal file
84
home/editors/nvim/plugins/snippet/default.nix
Normal file
@@ -0,0 +1,84 @@
|
||||
{pkgs, ...}: {
|
||||
plugins.luasnip = {
|
||||
enable = true;
|
||||
settings = {
|
||||
enable_autosnippets = true;
|
||||
store_selection_keys = "<Tab>";
|
||||
};
|
||||
fromVscode = [
|
||||
{
|
||||
lazyLoad = true;
|
||||
paths = pkgs.vimPlugins.friendly-snippets;
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
extraConfigLua = let
|
||||
snippets = {
|
||||
nix = import ./nix;
|
||||
};
|
||||
|
||||
escape = text: pkgs.lib.generators.toLua {} text;
|
||||
escapeLines = text: pkgs.lib.generators.toLua {} (pkgs.lib.strings.splitString "\n" text);
|
||||
|
||||
escapeLua = pkgs.lib.escape ["\\" "\"" "\n"];
|
||||
|
||||
generateSnippetBody = {
|
||||
template,
|
||||
placeholders ? {},
|
||||
delimiters ? "<>",
|
||||
...
|
||||
}:
|
||||
if placeholders == {}
|
||||
then "t(${escapeLines template})"
|
||||
else let
|
||||
templateStr = escape template;
|
||||
|
||||
generatePlaceholderEntry = index: defaultValue: let
|
||||
node =
|
||||
if defaultValue == null
|
||||
then "i(${index})"
|
||||
else "i(${index}, \"${escapeLua defaultValue}\")";
|
||||
in "[${index}] = ${node}";
|
||||
|
||||
placeholderEntries = pkgs.lib.attrsets.mapAttrsToList generatePlaceholderEntry placeholders;
|
||||
placeholderTable = "{ ${pkgs.lib.strings.concatStringsSep ", " placeholderEntries} }";
|
||||
delimitersTable = "{ delimiters = \"${escapeLua delimiters}\" }";
|
||||
in "fmt(${templateStr}, ${placeholderTable}, ${delimitersTable})";
|
||||
|
||||
generateLanguageSnippets = langSnippets: let
|
||||
snippetEntries =
|
||||
pkgs.lib.attrsets.mapAttrsToList (
|
||||
name: definition: let
|
||||
snippetName = escapeLua name;
|
||||
snippetBody = generateSnippetBody definition;
|
||||
in " s(\"${snippetName}\", ${snippetBody})"
|
||||
)
|
||||
langSnippets;
|
||||
in
|
||||
pkgs.lib.strings.concatStringsSep ",\n" snippetEntries;
|
||||
|
||||
buildLuasnipConfig = snippets: let
|
||||
languageBlocks =
|
||||
pkgs.lib.attrsets.mapAttrsToList (
|
||||
langName: langSnippets: ''
|
||||
ls.add_snippets("${langName}", {
|
||||
${generateLanguageSnippets langSnippets}
|
||||
})
|
||||
''
|
||||
)
|
||||
snippets;
|
||||
|
||||
allLanguageBlocks = pkgs.lib.strings.concatStringsSep "\n\n" languageBlocks;
|
||||
in ''
|
||||
local ls = require("luasnip")
|
||||
local s = ls.snippet
|
||||
local i = ls.insert_node
|
||||
local t = ls.text_node
|
||||
local fmt = require("luasnip.extras.fmt").fmt
|
||||
|
||||
${allLanguageBlocks}
|
||||
'';
|
||||
in
|
||||
buildLuasnipConfig snippets;
|
||||
}
|
||||
84
home/editors/nvim/plugins/snippet/nix/ags.flake.nix
Normal file
84
home/editors/nvim/plugins/snippet/nix/ags.flake.nix
Normal file
@@ -0,0 +1,84 @@
|
||||
{
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
|
||||
ags = {
|
||||
url = "github:aylur/ags";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
};
|
||||
|
||||
outputs = {
|
||||
self,
|
||||
nixpkgs,
|
||||
flake-utils,
|
||||
ags,
|
||||
}:
|
||||
flake-utils.lib.eachDefaultSystem (system: let
|
||||
pkgs = import nixpkgs {inherit system;};
|
||||
|
||||
name = "<1>";
|
||||
version = "<2>";
|
||||
entry = "<3>";
|
||||
|
||||
watchScript = pkgs.writeShellScriptBin "watch" ''
|
||||
set -euo pipefail
|
||||
|
||||
export FILES=$(find . -not \( -path "./node_modules*" -o -path "./@girs*" \) -type f -name "*.ts*")
|
||||
echo "$FILES" | ${pkgs.lib.getExe pkgs.entr} -crs 'echo "Change detected, restarting..." && ags run ./main.tsx'
|
||||
'';
|
||||
|
||||
astalPackages = with ags.packages.${system}; [
|
||||
io
|
||||
astal4
|
||||
<0>
|
||||
];
|
||||
|
||||
buildInputs = with pkgs; [
|
||||
gjs
|
||||
watchScript
|
||||
];
|
||||
|
||||
extraPackages = with pkgs; [
|
||||
libadwaita
|
||||
libsoup_3
|
||||
];
|
||||
in {
|
||||
packages.default = pkgs.stdenv.mkDerivation {
|
||||
inherit name version;
|
||||
src = ./.;
|
||||
|
||||
nativeBuildInputs = with pkgs; [
|
||||
wrapGAppsHook3
|
||||
gobject-introspection
|
||||
ags.packages.${system}.default
|
||||
];
|
||||
|
||||
buildInputs =
|
||||
astalPackages
|
||||
++ buildInputs
|
||||
++ extraPackages;
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/bin $out/share
|
||||
cp -r * $out/share
|
||||
ags bundle ${entry} $out/bin/${name} -d "SRC='$out/share'"
|
||||
'';
|
||||
};
|
||||
|
||||
apps.default = flake-utils.lib.mkApp {
|
||||
drv = self.packages.${system}.default;
|
||||
};
|
||||
|
||||
devShells.default = pkgs.mkShell {
|
||||
buildInputs =
|
||||
[
|
||||
(ags.packages.${system}.default.override {
|
||||
extraPackages = astalPackages ++ extraPackages;
|
||||
})
|
||||
]
|
||||
++ buildInputs;
|
||||
};
|
||||
});
|
||||
}
|
||||
116
home/editors/nvim/plugins/snippet/nix/bevy.flake.nix
Normal file
116
home/editors/nvim/plugins/snippet/nix/bevy.flake.nix
Normal file
@@ -0,0 +1,116 @@
|
||||
{
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
fenix = {
|
||||
url = "github:nix-community/fenix";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
crane.url = "github:ipetkov/crane";
|
||||
};
|
||||
|
||||
outputs = {
|
||||
nixpkgs,
|
||||
fenix,
|
||||
crane,
|
||||
flake-utils,
|
||||
...
|
||||
}:
|
||||
flake-utils.lib.eachDefaultSystem (system: let
|
||||
pkgs = import nixpkgs {inherit system;};
|
||||
|
||||
pname = "<1>";
|
||||
version = "<2>";
|
||||
|
||||
rust-toolchain = with fenix.packages.${system};
|
||||
combine [
|
||||
stable.rustc
|
||||
stable.cargo
|
||||
stable.rust-src
|
||||
stable.rust-analyzer
|
||||
];
|
||||
|
||||
bevyDeps = with pkgs; [
|
||||
pkg-config
|
||||
# Audio
|
||||
alsa-lib
|
||||
# Vulkan
|
||||
vulkan-loader
|
||||
vulkan-tools
|
||||
libudev-zero
|
||||
# X11
|
||||
xorg.libX11
|
||||
xorg.libXcursor
|
||||
xorg.libXi
|
||||
xorg.libXrandr
|
||||
# Wayland
|
||||
wayland
|
||||
libxkbcommon
|
||||
# linker
|
||||
lld
|
||||
];
|
||||
runtimeLibs = pkgs.lib.makeLibraryPath bevyDeps;
|
||||
|
||||
craneLib = (crane.mkLib pkgs).overrideToolchain rust-toolchain;
|
||||
|
||||
cargoArtifacts = craneLib.buildDepsOnly {
|
||||
pname = "${pname}-deps";
|
||||
src = craneLib.cleanCargoSource (craneLib.path ./.);
|
||||
nativeBuildInputs = with pkgs; [pkg-config];
|
||||
buildInputs = bevyDeps;
|
||||
};
|
||||
in {
|
||||
packages.default = craneLib.buildPackage {
|
||||
inherit pname version;
|
||||
src = craneLib.cleanCargoSource (craneLib.path ./.);
|
||||
inherit cargoArtifacts;
|
||||
|
||||
nativeBuildInputs = with pkgs; [
|
||||
pkg-config
|
||||
rust-toolchain
|
||||
lld
|
||||
makeWrapper
|
||||
];
|
||||
|
||||
buildInputs = bevyDeps;
|
||||
|
||||
CARGO_PROFILE_RELEASE_LTO = "thin";
|
||||
CARGO_PROFILE_RELEASE_CODEGEN_UNITS = 1;
|
||||
CARGO_PROFILE_RELEASE_STRIP = true;
|
||||
RUSTFLAGS = "-C link-arg=-fuse-ld=lld";
|
||||
|
||||
postInstall = ''
|
||||
wrapProgram "$out/bin/${pname}" \
|
||||
--prefix LD_LIBRARY_PATH : ${runtimeLibs}
|
||||
'';
|
||||
|
||||
meta = with pkgs.lib; {
|
||||
description = "<3>";
|
||||
license = licenses.mit;
|
||||
};
|
||||
};
|
||||
|
||||
devShells.default = pkgs.mkShell {
|
||||
nativeBuildInputs = with pkgs; [
|
||||
pkg-config
|
||||
lld
|
||||
];
|
||||
|
||||
packages = with pkgs;
|
||||
[
|
||||
rust-toolchain
|
||||
cargo-watch
|
||||
cargo-edit
|
||||
cargo-tarpaulin
|
||||
]
|
||||
++ bevyDeps;
|
||||
|
||||
shellHook = ''
|
||||
export RUST_SRC_PATH=${fenix.packages.${system}.stable.rust-src}/lib/rustlib/src/rust/library
|
||||
export LD_LIBRARY_PATH=${runtimeLibs}:$LD_LIBRARY_PATH
|
||||
'';
|
||||
};
|
||||
|
||||
formatter = pkgs.nixpkgs-fmt;
|
||||
});
|
||||
}
|
||||
44
home/editors/nvim/plugins/snippet/nix/default.nix
Normal file
44
home/editors/nvim/plugins/snippet/nix/default.nix
Normal file
@@ -0,0 +1,44 @@
|
||||
{
|
||||
flake = {
|
||||
template = builtins.readFile ./flake.nix;
|
||||
placeholders = {
|
||||
"0" = null;
|
||||
};
|
||||
};
|
||||
flaketauri.template = builtins.readFile ./tauri.flake.nix;
|
||||
flakeflutter.template = builtins.readFile ./flutter.flake.nix;
|
||||
flakeags = {
|
||||
template = builtins.readFile ./ags.flake.nix;
|
||||
placeholders = {
|
||||
"1" = "project-name";
|
||||
"2" = "0.1.0";
|
||||
"3" = "main.tsx";
|
||||
"0" = null;
|
||||
};
|
||||
};
|
||||
flakerust = {
|
||||
template = builtins.readFile ./rust.flake.nix;
|
||||
placeholders = {
|
||||
"1" = "rust-app";
|
||||
"2" = "0.1.0";
|
||||
"3" = "A Rust application";
|
||||
"0" = null;
|
||||
};
|
||||
};
|
||||
flakebevy = {
|
||||
template = builtins.readFile ./bevy.flake.nix;
|
||||
placeholders = {
|
||||
"1" = "bevy-app";
|
||||
"2" = "0.1.0";
|
||||
"3" = "A Bevy application";
|
||||
};
|
||||
};
|
||||
flakemaven = {
|
||||
template = builtins.readFile ./maven.flake.nix;
|
||||
placeholders."0" = "25";
|
||||
};
|
||||
flakegradle = {
|
||||
template = builtins.readFile ./gradle.flake.nix;
|
||||
placeholders."0" = "25";
|
||||
};
|
||||
}
|
||||
17
home/editors/nvim/plugins/snippet/nix/flake.nix
Normal file
17
home/editors/nvim/plugins/snippet/nix/flake.nix
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
};
|
||||
|
||||
outputs = {
|
||||
nixpkgs,
|
||||
flake-utils,
|
||||
...
|
||||
}:
|
||||
flake-utils.lib.eachDefaultSystem (system: let
|
||||
pkgs = import nixpkgs {inherit system;};
|
||||
in {
|
||||
<0>
|
||||
});
|
||||
}
|
||||
46
home/editors/nvim/plugins/snippet/nix/flutter.flake.nix
Normal file
46
home/editors/nvim/plugins/snippet/nix/flutter.flake.nix
Normal file
@@ -0,0 +1,46 @@
|
||||
{
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
};
|
||||
|
||||
outputs = {
|
||||
nixpkgs,
|
||||
flake-utils,
|
||||
...
|
||||
}:
|
||||
flake-utils.lib.eachDefaultSystem (system: let
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
config = {
|
||||
allowUnfree = true;
|
||||
android_sdk.accept_license = true;
|
||||
};
|
||||
};
|
||||
|
||||
buildToolsVersion = "35.0.0";
|
||||
androidComposition = pkgs.androidenv.composeAndroidPackages {
|
||||
buildToolsVersions = [buildToolsVersion "28.0.3"];
|
||||
platformVersions = ["36" "28"];
|
||||
abiVersions = ["armeabi-v7a" "arm64-v8a"];
|
||||
includeNDK = true;
|
||||
ndkVersions = ["27.0.12077973"];
|
||||
cmakeVersions = ["3.22.1"];
|
||||
};
|
||||
androidSdk = androidComposition.androidsdk;
|
||||
jdk = pkgs.jdk17;
|
||||
in {
|
||||
devShells.default = pkgs.mkShell rec {
|
||||
buildImports = with pkgs; [
|
||||
flutter
|
||||
androidSdk
|
||||
jdk
|
||||
];
|
||||
|
||||
ANDROID_SDK_ROOT = "${androidSdk}/libexec/android-sdk";
|
||||
ANDROID_NDK_ROOT = "${ANDROID_SDK_ROOT}/ndk-bundle";
|
||||
|
||||
GRADLE_OPTS = "-Dorg.gradle.project.android.aapt2FromMavenOverride=${ANDROID_SDK_ROOT}/build-tools/${buildToolsVersion}/aapt2";
|
||||
};
|
||||
});
|
||||
}
|
||||
22
home/editors/nvim/plugins/snippet/nix/gradle.flake.nix
Normal file
22
home/editors/nvim/plugins/snippet/nix/gradle.flake.nix
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
};
|
||||
|
||||
outputs = {
|
||||
nixpkgs,
|
||||
flake-utils,
|
||||
...
|
||||
}:
|
||||
flake-utils.lib.eachDefaultSystem (system: let
|
||||
pkgs = import nixpkgs {inherit system;};
|
||||
jdk = pkgs.jdk <0>;
|
||||
in {
|
||||
devShells.default = pkgs.mkShell {
|
||||
buildInputs = [pkgs.gradle jdk];
|
||||
JAVA_HOME = jdk.home;
|
||||
GRADLE_OPTS = "-Dorg.gradle.java.installations.auto-download=false -Dorg.gradle.java.installations.fromEnv=true";
|
||||
};
|
||||
});
|
||||
}
|
||||
21
home/editors/nvim/plugins/snippet/nix/maven.flake.nix
Normal file
21
home/editors/nvim/plugins/snippet/nix/maven.flake.nix
Normal file
@@ -0,0 +1,21 @@
|
||||
{
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
};
|
||||
|
||||
outputs = {
|
||||
nixpkgs,
|
||||
flake-utils,
|
||||
...
|
||||
}:
|
||||
flake-utils.lib.eachDefaultSystem (system: let
|
||||
pkgs = import nixpkgs {inherit system;};
|
||||
jdk = pkgs.jdk<0>;
|
||||
in {
|
||||
devShells.default = pkgs.mkShell {
|
||||
nativeBuildInputs = [pkgs.maven jdk];
|
||||
JAVA_HOME = jdk.home;
|
||||
};
|
||||
});
|
||||
}
|
||||
39
home/editors/nvim/plugins/snippet/nix/npm.flake.nix
Normal file
39
home/editors/nvim/plugins/snippet/nix/npm.flake.nix
Normal file
@@ -0,0 +1,39 @@
|
||||
{
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
};
|
||||
|
||||
outputs = {
|
||||
nixpkgs,
|
||||
flake-utils,
|
||||
...
|
||||
}:
|
||||
flake-utils.lib.eachDefaultSystem (system: let
|
||||
pkgs = import nixpkgs {inherit system;};
|
||||
|
||||
name = "npm-app";
|
||||
version = "0.1.0";
|
||||
|
||||
buildInputs = with pkgs; [
|
||||
nodejs
|
||||
];
|
||||
in {
|
||||
packages.default = pkgs.buildNpmPackage {
|
||||
inherit name version buildInputs;
|
||||
|
||||
npmDeps = pkgs.importNpmLock {
|
||||
npmRoot = ./.;
|
||||
};
|
||||
inherit (pkgs.importNpmLock) npmConfigHook;
|
||||
|
||||
installPhase = ''
|
||||
# ...
|
||||
'';
|
||||
};
|
||||
|
||||
devShells.default = pkgs.mkShell {
|
||||
packages = buildInputs;
|
||||
};
|
||||
});
|
||||
}
|
||||
81
home/editors/nvim/plugins/snippet/nix/rust.flake.nix
Normal file
81
home/editors/nvim/plugins/snippet/nix/rust.flake.nix
Normal file
@@ -0,0 +1,81 @@
|
||||
{
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
fenix = {
|
||||
url = "github:nix-community/fenix";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
crane.url = "github:ipetkov/crane";
|
||||
};
|
||||
|
||||
outputs = {
|
||||
nixpkgs,
|
||||
fenix,
|
||||
crane,
|
||||
flake-utils,
|
||||
...
|
||||
}:
|
||||
flake-utils.lib.eachDefaultSystem (system: let
|
||||
pkgs = import nixpkgs {inherit system;};
|
||||
|
||||
pname = "<1>";
|
||||
version = "<2>";
|
||||
|
||||
rust-toolchain = with fenix.packages.${system};
|
||||
combine [
|
||||
stable.rustc
|
||||
stable.cargo
|
||||
stable.rust-src
|
||||
stable.rust-analyzer
|
||||
];
|
||||
|
||||
craneLib = (crane.mkLib pkgs).overrideToolchain rust-toolchain;
|
||||
|
||||
cargoArtifacts = craneLib.buildDepsOnly {
|
||||
pname = "${pname}-deps";
|
||||
src = craneLib.cleanCargoSource (craneLib.path ./.);
|
||||
};
|
||||
in {
|
||||
packages.default = craneLib.buildPackage {
|
||||
inherit pname version;
|
||||
src = craneLib.cleanCargoSource (craneLib.path ./.);
|
||||
inherit cargoArtifacts;
|
||||
|
||||
nativeBuildInputs = [rust-toolchain pkgs.lld];
|
||||
buildInputs = with pkgs;
|
||||
[
|
||||
<0>
|
||||
]
|
||||
++ lib.optionals stdenv.isDarwin [
|
||||
darwin.apple_sdk.frameworks.Security
|
||||
];
|
||||
|
||||
RUSTFLAGS = "-C link-arg=-fuse-ld=lld";
|
||||
|
||||
meta = with pkgs.lib; {
|
||||
description = "<3>";
|
||||
license = licenses.mit;
|
||||
};
|
||||
};
|
||||
|
||||
devShells.default = pkgs.mkShell {
|
||||
nativeBuildInputs = with pkgs; [
|
||||
lld
|
||||
];
|
||||
|
||||
buildInputs = with pkgs; [
|
||||
rust-toolchain
|
||||
cargo-watch
|
||||
cargo-edit
|
||||
cargo-tarpaulin
|
||||
];
|
||||
|
||||
shellHook = ''
|
||||
export RUST_SRC_PATH=${fenix.packages.${system}.stable.rust-src}/lib/rustlib/src/rust/library
|
||||
'';
|
||||
};
|
||||
|
||||
formatter = pkgs.nixpkgs-fmt;
|
||||
});
|
||||
}
|
||||
51
home/editors/nvim/plugins/snippet/nix/tauri.flake.nix
Normal file
51
home/editors/nvim/plugins/snippet/nix/tauri.flake.nix
Normal file
@@ -0,0 +1,51 @@
|
||||
{
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||
rust-overlay.url = "github:oxalica/rust-overlay";
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
};
|
||||
|
||||
outputs = {
|
||||
nixpkgs,
|
||||
rust-overlay,
|
||||
flake-utils,
|
||||
...
|
||||
}:
|
||||
flake-utils.lib.eachDefaultSystem (system: let
|
||||
overlays = [(import rust-overlay)];
|
||||
pkgs = import nixpkgs {inherit system overlays;};
|
||||
|
||||
rustToolchain = pkgs.rust-bin.stable.latest.default.override {
|
||||
extensions = ["rust-src"];
|
||||
};
|
||||
|
||||
linuxDeps = with pkgs; [
|
||||
webkitgtk_4_1
|
||||
gtk3
|
||||
cairo
|
||||
gdk-pixbuf
|
||||
glib
|
||||
dbus
|
||||
openssl
|
||||
pkg-config
|
||||
librsvg
|
||||
];
|
||||
in {
|
||||
devShells.default = pkgs.mkShell {
|
||||
buildInputs = with pkgs;
|
||||
[
|
||||
rustToolchain
|
||||
rust-analyzer
|
||||
|
||||
nodejs
|
||||
cargo-tauri
|
||||
]
|
||||
++ linuxDeps;
|
||||
|
||||
shellHook = ''
|
||||
export WEBKIT_DISABLE_COMPOSITING_MODE=1
|
||||
export LD_LIBRARY_PATH="${pkgs.lib.makeLibraryPath linuxDeps}"
|
||||
'';
|
||||
};
|
||||
});
|
||||
}
|
||||
14
home/editors/nvim/plugins/treesitter/default.nix
Normal file
14
home/editors/nvim/plugins/treesitter/default.nix
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
plugins = {
|
||||
treesitter = {
|
||||
enable = true;
|
||||
folding = false;
|
||||
nixGrammars = true;
|
||||
nixvimInjections = true;
|
||||
settings = import ./settings.nix;
|
||||
};
|
||||
|
||||
ts-autotag.enable = true;
|
||||
treesitter-textobjects = import ./textobjects.nix;
|
||||
};
|
||||
}
|
||||
83
home/editors/nvim/plugins/treesitter/settings.nix
Normal file
83
home/editors/nvim/plugins/treesitter/settings.nix
Normal file
@@ -0,0 +1,83 @@
|
||||
{
|
||||
indent.enable = true;
|
||||
highlight.enable = true;
|
||||
|
||||
ensureInstalled = [
|
||||
"bash"
|
||||
"lua"
|
||||
"nix"
|
||||
|
||||
"c"
|
||||
"cpp"
|
||||
"make"
|
||||
"cmake"
|
||||
|
||||
"rust"
|
||||
|
||||
"dockerfile"
|
||||
|
||||
"go"
|
||||
"gomod"
|
||||
"gosum"
|
||||
|
||||
"css"
|
||||
"html"
|
||||
"templ"
|
||||
|
||||
"tsx"
|
||||
"astro"
|
||||
"javascript"
|
||||
"typescript"
|
||||
|
||||
"xml"
|
||||
"json"
|
||||
"yaml"
|
||||
"toml"
|
||||
|
||||
"sql"
|
||||
"http"
|
||||
"graphql"
|
||||
|
||||
"python"
|
||||
"requirements"
|
||||
|
||||
"regex"
|
||||
"comment"
|
||||
|
||||
"latex"
|
||||
"markdown"
|
||||
"markdown_inline"
|
||||
|
||||
"diff"
|
||||
"gitignore"
|
||||
"git_config"
|
||||
"gitattributes"
|
||||
|
||||
"dart"
|
||||
"java"
|
||||
|
||||
"hyprlang"
|
||||
];
|
||||
|
||||
refactor = {
|
||||
highlight_definitions.enable = true;
|
||||
highlight_current_scope = true;
|
||||
};
|
||||
endwise.enable = true;
|
||||
matchup = {
|
||||
enable = true;
|
||||
include_match_words = true;
|
||||
};
|
||||
|
||||
incremental_selection = {
|
||||
enable = true;
|
||||
keymaps = {
|
||||
init_selection = "<C-Space>";
|
||||
node_incremental = "v";
|
||||
scope_incremental = false;
|
||||
node_decremental = "V";
|
||||
};
|
||||
};
|
||||
|
||||
playground.enable = true;
|
||||
}
|
||||
47
home/editors/nvim/plugins/treesitter/textobjects.nix
Normal file
47
home/editors/nvim/plugins/treesitter/textobjects.nix
Normal file
@@ -0,0 +1,47 @@
|
||||
{
|
||||
enable = true;
|
||||
|
||||
settings = {
|
||||
select = {
|
||||
enable = true;
|
||||
lookahead = true;
|
||||
keymaps = {
|
||||
"af" = "@function.outer";
|
||||
"if" = "@function.inner";
|
||||
"ac" = "@class.outer";
|
||||
"ic" = "@class.inner";
|
||||
"a," = "@parameter.outer";
|
||||
"i," = "@parameter.inner";
|
||||
};
|
||||
};
|
||||
|
||||
move = {
|
||||
enable = true;
|
||||
setJumps = true;
|
||||
gotoNextStart = {
|
||||
"]f" = "@function.outer";
|
||||
"]c" = "@class.outer";
|
||||
"]," = "@parameter.inner";
|
||||
};
|
||||
gotoNextEnd = {
|
||||
"]F" = "@function.outer";
|
||||
"]C" = "@function.outer";
|
||||
};
|
||||
gotoPreviousStart = {
|
||||
"[f" = "@function.outer";
|
||||
"[c" = "@class.outer";
|
||||
"[," = "@parameter.inner";
|
||||
};
|
||||
gotoPreviousEnd = {
|
||||
"[F" = "@function.outer";
|
||||
"[C" = "@class.outer";
|
||||
};
|
||||
};
|
||||
|
||||
swap = {
|
||||
enable = true;
|
||||
swapNext = {">," = "@parameter.inner";};
|
||||
swapPrevious = {"<," = "@parameter.inner";};
|
||||
};
|
||||
};
|
||||
}
|
||||
61
home/editors/nvim/plugins/utils/alpha/default.nix
Normal file
61
home/editors/nvim/plugins/utils/alpha/default.nix
Normal file
@@ -0,0 +1,61 @@
|
||||
let
|
||||
themes = import ./themes.nix;
|
||||
theme = themes.dg_baby;
|
||||
in {
|
||||
plugins.alpha = {
|
||||
enable = true;
|
||||
settings = {
|
||||
layout = [
|
||||
{
|
||||
type = "padding";
|
||||
val = 2;
|
||||
}
|
||||
{
|
||||
type = "text";
|
||||
val = theme.image;
|
||||
opts = {
|
||||
position = "center";
|
||||
hl = "Type";
|
||||
};
|
||||
}
|
||||
{
|
||||
type = "padding";
|
||||
val = 2;
|
||||
}
|
||||
{
|
||||
type = "group";
|
||||
val = let
|
||||
button = shortcut: val: {
|
||||
type = "button";
|
||||
inherit val;
|
||||
opts = {
|
||||
position = "center";
|
||||
inherit shortcut;
|
||||
cursor = 3;
|
||||
width = 50;
|
||||
align_shortcut = "right";
|
||||
hl_shortcut = "Keyword";
|
||||
};
|
||||
};
|
||||
in [
|
||||
(button " ff" " Find file")
|
||||
(button " fo" " Recently opened files")
|
||||
(button " fl" " Live-Grep")
|
||||
];
|
||||
}
|
||||
{
|
||||
type = "padding";
|
||||
val = 2;
|
||||
}
|
||||
{
|
||||
type = "text";
|
||||
val = theme.quote;
|
||||
opts = {
|
||||
position = "center";
|
||||
hl = "Keyword";
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
53
home/editors/nvim/plugins/utils/alpha/themes.nix
Normal file
53
home/editors/nvim/plugins/utils/alpha/themes.nix
Normal file
@@ -0,0 +1,53 @@
|
||||
{
|
||||
rei = {
|
||||
quote = "「私は人形じゃない。」";
|
||||
image = [
|
||||
"⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿"
|
||||
"⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠋⣠⣶⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿"
|
||||
"⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣡⣾⣿⣿⣿⣿⣿⢿⣿⣿⣿⣿⣿⣿⣟⠻⣿⣿⣿⣿⣿⣿⣿⣿"
|
||||
"⣿⣿⣿⣿⣿⣿⣿⣿⡿⢫⣷⣿⣿⣿⣿⣿⣿⣿⣾⣯⣿⡿⢧⡚⢷⣌⣽⣿⣿⣿⣿⣿⣶⡌⣿⣿⣿⣿⣿⣿"
|
||||
"⣿⣿⣿⣿⣿⣿⣿⣿⠇⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣮⣇⣘⠿⢹⣿⣿⣿⣿⣿⣻⢿⣿⣿⣿⣿⣿"
|
||||
"⣿⣿⣿⣿⣿⣿⣿⣿⠀⢸⣿⣿⡇⣿⣿⣿⣿⣿⣿⣿⣿⡟⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⣻⣿⣿⣿⣿"
|
||||
"⣿⣿⣿⣿⣿⣿⣿⡇⠀⣬⠏⣿⡇⢻⣿⣿⣿⣿⣿⣿⣿⣷⣼⣿⣿⣸⣿⣿⣿⣿⣿⣿⣿⣿⣿⢻⣿⣿⣿⣿"
|
||||
"⣿⣿⣿⣿⣿⣿⣿⠀⠈⠁⠀⣿⡇⠘⡟⣿⣿⣿⣿⣿⣿⣿⣿⡏⠿⣿⣟⣿⣿⣿⣿⣿⣿⣿⣿⣇⣿⣿⣿⣿"
|
||||
"⣿⣿⣿⣿⣿⣿⡏⠀⠀⠐⠀⢻⣇⠀⠀⠹⣿⣿⣿⣿⣿⣿⣩⡶⠼⠟⠻⠞⣿⡈⠻⣟⢻⣿⣿⣿⣿⣿⣿⣿"
|
||||
"⣿⣿⣿⣿⣿⣿⡇⠀⠀⠀⠀⠀⢿⠀⡆⠀⠘⢿⢻⡿⣿⣧⣷⢣⣶⡃⢀⣾⡆⡋⣧⠙⢿⣿⣿⣟⣿⣿⣿⣿"
|
||||
"⣿⣿⣿⣿⣿⣿⡿⠀⠀⠀⠀⠀⠀⠀⡥⠂⡐⠀⠁⠑⣾⣿⣿⣾⣿⣿⣿⡿⣷⣷⣿⣧⣾⣿⣿⣿⣿⣿⣿⣿"
|
||||
"⣿⣿⡿⣿⣍⡴⠆⠀⠀⠀⠀⠀⠀⠀⠀⣼⣄⣀⣷⡄⣙⢿⣿⣿⣿⣿⣯⣶⣿⣿⢟⣾⣿⣿⢡⣿⣿⣿⣿⣿"
|
||||
"⣿⡏⣾⣿⣿⣿⣷⣦⠀⠀⠀⢀⡀⠀⠀⠠⣭⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠟⣡⣾⣿⣿⢏⣾⣿⣿⣿⣿⣿"
|
||||
"⣿⣿⣿⣿⣿⣿⣿⣿⡴⠀⠀⠀⠀⠀⠠⠀⠰⣿⣿⣿⣷⣿⠿⠿⣿⣿⣭⡶⣫⠔⢻⢿⢇⣾⣿⣿⣿⣿⣿⣿"
|
||||
"⣿⣿⣿⡿⢫⣽⠟⣋⠀⠀⠀⠀⣶⣦⠀⠀⠀⠈⠻⣿⣿⣿⣾⣿⣿⣿⣿⡿⣣⣿⣿⢸⣾⣿⣿⣿⣿⣿⣿⣿"
|
||||
"⡿⠛⣹⣶⣶⣶⣾⣿⣷⣦⣤⣤⣀⣀⠀⠀⠀⠀⠀⠀⠉⠛⠻⢿⣿⡿⠫⠾⠿⠋⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿"
|
||||
"⢀⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣀⡆⣠⢀⣴⣏⡀⠀⠀⠀⠉⠀⠀⢀⣠⣰⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿"
|
||||
"⠿⠛⠛⠛⠛⠛⠛⠻⢿⣿⣿⣿⣿⣯⣟⠷⢷⣿⡿⠋⠀⠀⠀⠀⣵⡀⢠⡿⠋⢻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿"
|
||||
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠉⠛⢿⣿⣿⠂⠀⠀⠀⠀⠀⢀⣽⣿⣿⣿⣿⣿⣿⣿⣍⠛⠿⣿⣿⣿⣿⣿⣿"
|
||||
];
|
||||
};
|
||||
|
||||
dg_baby = {
|
||||
quote = "Official Drain © Licensed Product";
|
||||
image = [
|
||||
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀"
|
||||
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⡤⣄⠀⠀⠀⢸⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀"
|
||||
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⣄⡀⠀⠀⠀⠀⠀⢀⡞⠀⠈⠛⢶⡶⢎⡹⠶⠶⠒⠀⠀⠀⠀⠀⠀"
|
||||
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢠⠀⠀⠀⢀⡼⠁⠀⠳⢄⣀⡤⠴⠚⠉⠀⠀⠀⠀⠀⠙⢮⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀"
|
||||
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⠀⠀⢀⡞⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠛⣄⠀⠀⠀⠀⠀⠀⠀⠀"
|
||||
"⠀⠀⠀⠀⠀⠀⠀⣀⣀⣀⣠⠞⢦⣀⣾⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⣆⠀⠀⠀⠀⠀⠀⠀"
|
||||
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⢳⠋⣸⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⡆⠀⠀⠀⠀⠀⠀"
|
||||
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⠀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢰⡇⠀⠀⢹⠀⠀⠀⠀⠀⠀"
|
||||
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢰⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣸⣇⠀⠀⢸⠀⠀⠀⠀⠀⠀"
|
||||
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠉⠛⠛⢣⡼⠛⠋⡟⠁⠀⠀⠀⠀⠀"
|
||||
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢳⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⡇⠀⡼⠁⠀⠀⠀⠀⠀⠀"
|
||||
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⡀⠀⠀⠹⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢃⡼⠁⠀⢨⡇⠀⠀⠀⠀"
|
||||
"⠀⠀⠀⠀⠀⠀⠀⠀⡀⣀⣰⣇⣀⡖⠒⠚⠿⣦⣤⣀⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣄⣠⣶⠯⢄⠉⠉⠱⡎⠉⠁⠀⠀"
|
||||
"⠀⠀⠀⠀⣿⠀⠀⡴⠚⠛⠻⣏⡁⠳⣄⡀⠀⣀⠽⢚⣽⣏⣹⡋⢩⡙⢻⠛⣿⠛⣿⠀⠀⢀⡴⠁⠀⠀⠃⠀⠀⠀⠀"
|
||||
"⢀⣀⣀⣤⠿⣤⣰⣇⠀⠀⠀⠃⠙⡦⢞⣒⣚⣓⠶⣯⡽⠿⠛⠿⢿⣷⡞⠒⠺⡾⣩⣗⣶⠿⠒⠒⠒⠦⡄⠀⠀⠀⠀"
|
||||
"⠀⠀⠀⠀⢿⠀⠘⡇⠀⠀⠀⠀⡞⣰⢯⡄⠈⠙⠻⣦⣖⡭⠭⣍⠳⡌⢿⡆⠀⣷⠟⠉⠀⠀⠀⠀⠀⠀⢹⡀⠀⠀⠀"
|
||||
"⠀⠀⠀⠀⠘⠀⠀⢳⠀⠀⠀⠀⡇⢧⢸⠀⢸⡆⠀⡾⠁⡰⡄⠈⡇⡽⢸⣕⡞⠁⠉⠀⠀⠀⠀⠀⠀⠀⢸⠳⡇⠀⠀"
|
||||
"⠀⠀⠀⠀⠀⠀⠀⠈⢧⠀⠀⠀⠹⣌⢾⡀⠘⠃⣀⣅⠀⠓⠃⠀⠿⠁⠳⣿⠀⠀⠀⠀⠀⠀⠀⠀⣀⣠⣏⡸⢧⣀⣀"
|
||||
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠳⣄⡀⠀⠈⠳⣍⠻⣍⢡⣞⠁⠘⠃⣀⣾⠶⠾⣟⠀⠀⠀⠀⠀⠀⠀⠀⣰⠋⠉⠱⡎⠉⠉"
|
||||
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣙⣲⣤⣴⣚⣑⣮⡓⣚⣥⣶⣛⠉⠁⣀⣴⣻⡀⠀⠀⠀⠀⢀⣠⠞⠁⠀⠀⠀⡇⠀⠀"
|
||||
"⠀⠀⠀⠀⠀⠀⠀⠀⠈⠙⠛⠛⠛⠛⠛⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠲⠶⠒⠚⠛⠛⠉⠀⠀⠀⠀⠀⠀⠀"
|
||||
];
|
||||
};
|
||||
}
|
||||
45
home/editors/nvim/plugins/utils/debugging.nix
Normal file
45
home/editors/nvim/plugins/utils/debugging.nix
Normal file
@@ -0,0 +1,45 @@
|
||||
{
|
||||
plugins.neotest.enable = true;
|
||||
extraConfigLua =
|
||||
# lua
|
||||
''
|
||||
-- require("neotest").setup({
|
||||
-- adapters = {
|
||||
-- require("rustaceanvim.neotest")
|
||||
-- },
|
||||
-- })
|
||||
'';
|
||||
|
||||
plugins.dap = {
|
||||
enable = true;
|
||||
|
||||
signs = {
|
||||
dapBreakpoint = {
|
||||
text = "";
|
||||
texthl = "DiagnosticError";
|
||||
numhl = "DapBreakpoint";
|
||||
};
|
||||
dapBreakpointCondition = {
|
||||
text = "";
|
||||
texthl = "DiagnosticWarn";
|
||||
numhl = "DiagnosticWarn";
|
||||
};
|
||||
dapLogPoint = {
|
||||
text = "";
|
||||
texthl = "Comment";
|
||||
numhl = "Comment";
|
||||
};
|
||||
dapStopped = {
|
||||
text = "";
|
||||
texthl = "IncSearch";
|
||||
linehl = "CursorLine";
|
||||
numhl = "IncSearch";
|
||||
};
|
||||
dapBreakpointRejected = {
|
||||
text = "";
|
||||
texthl = "DiagnosticError";
|
||||
numhl = "DiagnosticError";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
33
home/editors/nvim/plugins/utils/default.nix
Normal file
33
home/editors/nvim/plugins/utils/default.nix
Normal file
@@ -0,0 +1,33 @@
|
||||
{
|
||||
imports = [
|
||||
./alpha
|
||||
./lualine
|
||||
./toggleterm.nix
|
||||
./which-key
|
||||
./fzf-lua.nix
|
||||
./grug-far.nix
|
||||
./presence.nix
|
||||
./silicon.nix
|
||||
./todo-comments.nix
|
||||
./debugging.nix
|
||||
];
|
||||
|
||||
plugins = {
|
||||
nix-develop = {
|
||||
enable = true;
|
||||
ignoredVariables = {
|
||||
SHELL = false;
|
||||
};
|
||||
};
|
||||
wakatime.enable = true;
|
||||
};
|
||||
|
||||
extraConfigLua =
|
||||
#lua
|
||||
''
|
||||
vim.api.nvim_create_autocmd("VimEnter", {
|
||||
desc = "Automatically enter Nix devshell",
|
||||
command = "NixDevelop",
|
||||
})
|
||||
'';
|
||||
}
|
||||
12
home/editors/nvim/plugins/utils/fzf-lua.nix
Normal file
12
home/editors/nvim/plugins/utils/fzf-lua.nix
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
plugins.fzf-lua = {
|
||||
enable = true;
|
||||
settings = {
|
||||
winopts = {};
|
||||
files = {
|
||||
git_icons = true;
|
||||
file_icons = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
3
home/editors/nvim/plugins/utils/grug-far.nix
Normal file
3
home/editors/nvim/plugins/utils/grug-far.nix
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
plugins.grug-far.enable = true;
|
||||
}
|
||||
14
home/editors/nvim/plugins/utils/lualine/colors.nix
Normal file
14
home/editors/nvim/plugins/utils/lualine/colors.nix
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
bg = "#1e1e2e";
|
||||
fg = "#cdd6f4";
|
||||
yellow = "#f9e2af";
|
||||
cyan = "#89dceb";
|
||||
green = "#a6e3a1";
|
||||
orange = "#fab387";
|
||||
violet = "#b4befe";
|
||||
blue = "#89b4fa";
|
||||
red = "#f38ba8";
|
||||
magenta = "#cba6f7";
|
||||
grey = "#585b70";
|
||||
pink = "#f5c2e7";
|
||||
}
|
||||
78
home/editors/nvim/plugins/utils/lualine/default.nix
Normal file
78
home/editors/nvim/plugins/utils/lualine/default.nix
Normal file
@@ -0,0 +1,78 @@
|
||||
{
|
||||
extraConfigLua = builtins.readFile ./hide_statusbar.lua;
|
||||
|
||||
plugins.lualine = let
|
||||
colors = import ./colors.nix;
|
||||
in {
|
||||
enable = true;
|
||||
settings = {
|
||||
options = {
|
||||
section_separators = "";
|
||||
component_separators = "";
|
||||
theme = {
|
||||
normal.c = {
|
||||
bg = "";
|
||||
inherit (colors) fg;
|
||||
};
|
||||
inactive.c = {
|
||||
bg = "";
|
||||
inherit (colors) fg;
|
||||
};
|
||||
};
|
||||
|
||||
refresh.events = [
|
||||
"WinEnter"
|
||||
"BufEnter"
|
||||
"BufWritePost"
|
||||
"SessionLoadPost"
|
||||
"FileChangedShellPost"
|
||||
"VimResized"
|
||||
"Filetype"
|
||||
"CursorMoved"
|
||||
"CursorMovedI"
|
||||
"ModeChanged"
|
||||
"RecordingEnter"
|
||||
"RecordingLeave"
|
||||
];
|
||||
};
|
||||
|
||||
# to be visible, change laststatus option value at options.nix
|
||||
sections = {
|
||||
# these are to remove the defaults
|
||||
lualine_a = [{}];
|
||||
lualine_b = [{}];
|
||||
lualine_c = [{}];
|
||||
lualine_x = [{}];
|
||||
lualine_y = [{}];
|
||||
lualine_z = [{}];
|
||||
};
|
||||
|
||||
inactive_sections = {
|
||||
# these are to remove the defaults
|
||||
lualine_a = [{}];
|
||||
lualine_b = [{}];
|
||||
lualine_c = [{}];
|
||||
lualine_x = [{}];
|
||||
lualine_y = [{}];
|
||||
lualine_z = [{}];
|
||||
};
|
||||
|
||||
tabline = import ./tabline.nix;
|
||||
};
|
||||
};
|
||||
|
||||
keymaps = let
|
||||
buffers = bind: let
|
||||
num =
|
||||
if (bind == 0)
|
||||
then 10
|
||||
else bind;
|
||||
in {
|
||||
key = "<M-${toString bind}>";
|
||||
mode = ["n" "i" "v" "s" "t" "o"];
|
||||
options.desc = "Buffer ${toString num}";
|
||||
action = "<cmd>LualineBuffersJump ${toString num}<cr>";
|
||||
};
|
||||
in
|
||||
map buffers [1 2 3 4 5 6 7 8 9 10];
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
vim.api.nvim_create_autocmd('WinEnter', {
|
||||
once = true,
|
||||
command = [[ set laststatus=0 ]],
|
||||
})
|
||||
48
home/editors/nvim/plugins/utils/lualine/section-left.nix
Normal file
48
home/editors/nvim/plugins/utils/lualine/section-left.nix
Normal file
@@ -0,0 +1,48 @@
|
||||
colors: get-mode-color: [
|
||||
{
|
||||
__unkeyed-1 = "mode";
|
||||
color.__raw = get-mode-color;
|
||||
}
|
||||
|
||||
{
|
||||
__unkeyed-1.__raw = ''
|
||||
function()
|
||||
local reg_rec = vim.fn.reg_recording()
|
||||
if reg_rec ~= "" then
|
||||
return " rec (" .. reg_rec .. ")"
|
||||
else
|
||||
return ""
|
||||
end
|
||||
end
|
||||
'';
|
||||
color = {
|
||||
fg = colors.red;
|
||||
gui = "bold";
|
||||
};
|
||||
}
|
||||
|
||||
{
|
||||
icon = "";
|
||||
__unkeyed-1 = "branch";
|
||||
color = {
|
||||
fg = colors.violet;
|
||||
gui = "bold";
|
||||
};
|
||||
}
|
||||
|
||||
{
|
||||
mode = 2;
|
||||
__unkeyed-1 = "buffers";
|
||||
symbols = {
|
||||
modified = "";
|
||||
alternate_file = "";
|
||||
};
|
||||
buffers_color = {
|
||||
inactive.fg = colors.grey;
|
||||
active = {
|
||||
fg = colors.magenta;
|
||||
gui = "bold";
|
||||
};
|
||||
};
|
||||
}
|
||||
]
|
||||
64
home/editors/nvim/plugins/utils/lualine/section-right.nix
Normal file
64
home/editors/nvim/plugins/utils/lualine/section-right.nix
Normal file
@@ -0,0 +1,64 @@
|
||||
colors: get-mode-color: [
|
||||
{
|
||||
path = 1;
|
||||
shorting_target = 150;
|
||||
color.fg = colors.grey;
|
||||
__unkeyed-1 = "filename";
|
||||
disabled_buftypes = ["terminal"];
|
||||
}
|
||||
|
||||
{
|
||||
sources = ["nvim_lsp"];
|
||||
__unkeyed-1 = "diagnostics";
|
||||
diagnostics_color = {
|
||||
color_error.fg = colors.red;
|
||||
color_warn.fg = colors.yellow;
|
||||
color_info.fg = colors.blue;
|
||||
color_hint.fg = colors.cyan;
|
||||
};
|
||||
symbols = {
|
||||
error = " ";
|
||||
warn = " ";
|
||||
info = " ";
|
||||
};
|
||||
}
|
||||
{
|
||||
__unkeyed-1 = "lsp_status";
|
||||
icon = "lsp:";
|
||||
disabled_buftypes = ["terminal"];
|
||||
color = {
|
||||
fg = colors.magenta;
|
||||
gui = "bold";
|
||||
};
|
||||
ignore_lsp = [
|
||||
"typos_lsp"
|
||||
];
|
||||
}
|
||||
|
||||
{
|
||||
__unkeyed-1 = "diff";
|
||||
symbols = {
|
||||
added = " ";
|
||||
modified = " ";
|
||||
removed = " ";
|
||||
};
|
||||
diff_color = {
|
||||
added.fg = colors.green;
|
||||
removed.fg = colors.red;
|
||||
modified.fg = colors.orange;
|
||||
};
|
||||
}
|
||||
|
||||
{
|
||||
# icon = ""; # NOTE: IDK why it shows twice
|
||||
icon = "";
|
||||
padding.right = 1;
|
||||
color.fg = colors.violet;
|
||||
__unkeyed-1 = "gh-actions";
|
||||
}
|
||||
|
||||
{
|
||||
color.fg = colors.pink;
|
||||
__unkeyed-1 = "progress";
|
||||
}
|
||||
]
|
||||
39
home/editors/nvim/plugins/utils/lualine/tabline.nix
Normal file
39
home/editors/nvim/plugins/utils/lualine/tabline.nix
Normal file
@@ -0,0 +1,39 @@
|
||||
let
|
||||
colors = import ./colors.nix;
|
||||
get-mode-color =
|
||||
# lua
|
||||
"
|
||||
function()
|
||||
local mode_color = {
|
||||
n = '${colors.blue}',
|
||||
i = '${colors.green}',
|
||||
|
||||
v = '${colors.violet}',
|
||||
[''] = '${colors.violet}',
|
||||
V = '${colors.violet}',
|
||||
|
||||
c = '${colors.magenta}',
|
||||
no = '${colors.red}',
|
||||
|
||||
s = '${colors.orange}',
|
||||
S = '${colors.orange}',
|
||||
[''] = '${colors.orange}',
|
||||
|
||||
ic = '${colors.yellow}',
|
||||
R = '${colors.magenta}',
|
||||
Rv = '${colors.magenta}',
|
||||
cv = '${colors.red}',
|
||||
ce = '${colors.red}',
|
||||
r = '${colors.cyan}',
|
||||
rm = '${colors.cyan}',
|
||||
['r?'] = '${colors.cyan}',
|
||||
['!'] = '${colors.red}',
|
||||
t = '${colors.pink}',
|
||||
}
|
||||
return { fg = mode_color[vim.fn.mode()] }
|
||||
end
|
||||
";
|
||||
in {
|
||||
lualine_c = import ./section-left.nix colors get-mode-color;
|
||||
lualine_x = import ./section-right.nix colors get-mode-color;
|
||||
}
|
||||
23
home/editors/nvim/plugins/utils/presence.nix
Normal file
23
home/editors/nvim/plugins/utils/presence.nix
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
plugins.presence = {
|
||||
enable = true;
|
||||
settings = {
|
||||
neovim_image_text = "Neovim";
|
||||
main_image = "file";
|
||||
buttons.__raw = ''
|
||||
function (buffer, repo_url)
|
||||
local buttons = {}
|
||||
|
||||
if repo_url ~= nil then
|
||||
table.insert(buttons, {
|
||||
label = "Git Repository",
|
||||
url = repo_url
|
||||
})
|
||||
end
|
||||
|
||||
return buttons
|
||||
end
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
24
home/editors/nvim/plugins/utils/silicon.nix
Normal file
24
home/editors/nvim/plugins/utils/silicon.nix
Normal file
@@ -0,0 +1,24 @@
|
||||
{pkgs, ...}: let
|
||||
theme = "Catppuccin";
|
||||
font = "JetBrainsMono Nerd Font=32;Noto Color Emoji=34";
|
||||
in {
|
||||
extraPackages = with pkgs; [
|
||||
silicon
|
||||
jetbrains-mono
|
||||
noto-fonts-color-emoji
|
||||
];
|
||||
|
||||
extraPlugins = let
|
||||
builds = import ../builds.nix pkgs;
|
||||
in
|
||||
with builds; [silicon];
|
||||
|
||||
extraConfigLua = ''
|
||||
require 'nvim-silicon'.setup {
|
||||
font = '${font}',
|
||||
theme = '${theme}',
|
||||
no_line_number = true,
|
||||
no_window_controls = true,
|
||||
}
|
||||
'';
|
||||
}
|
||||
22
home/editors/nvim/plugins/utils/todo-comments.nix
Normal file
22
home/editors/nvim/plugins/utils/todo-comments.nix
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
plugins.todo-comments = {
|
||||
enable = true;
|
||||
settings.keywords = let
|
||||
word = icon: color: {inherit icon color;};
|
||||
hint = icon: word icon "hint";
|
||||
info = icon: word icon "info";
|
||||
test = icon: word icon "test";
|
||||
in {
|
||||
NOTE = hint "";
|
||||
TODO = hint "";
|
||||
REFACTOR = hint "";
|
||||
|
||||
INFO = info "";
|
||||
DOCS = info "";
|
||||
LINK = info "";
|
||||
GITHUB = info "";
|
||||
|
||||
TEST = test "";
|
||||
};
|
||||
};
|
||||
}
|
||||
14
home/editors/nvim/plugins/utils/toggleterm.nix
Normal file
14
home/editors/nvim/plugins/utils/toggleterm.nix
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
plugins.toggleterm = {
|
||||
enable = true;
|
||||
settings = {
|
||||
float_opts = {};
|
||||
persistent_size = true;
|
||||
direction = "horizontal";
|
||||
open_mapping = "[[<M-CR>]]";
|
||||
shade_filetypes = ["lazygit"];
|
||||
|
||||
highlights.FloatBorder.guifg = "#7b8496";
|
||||
};
|
||||
};
|
||||
}
|
||||
227
home/editors/nvim/plugins/utils/which-key/config.lua
Normal file
227
home/editors/nvim/plugins/utils/which-key/config.lua
Normal file
@@ -0,0 +1,227 @@
|
||||
local wk = require "which-key"
|
||||
local gitsigns = require "gitsigns"
|
||||
local Terminal = require("toggleterm.terminal").Terminal
|
||||
|
||||
local set_key = {
|
||||
cmd = function(key, action, desc, hidden)
|
||||
return {
|
||||
"<leader>" .. key,
|
||||
type(action) == "string" and "<cmd>" .. action .. "<cr>" or action,
|
||||
desc = desc:gsub("^%l", string.upper),
|
||||
hidden = hidden or false,
|
||||
}
|
||||
end,
|
||||
}
|
||||
|
||||
local function smart_buffer_delete()
|
||||
local current_buf = vim.api.nvim_get_current_buf()
|
||||
pcall(vim.cmd.bnext)
|
||||
if current_buf == vim.api.nvim_get_current_buf() then
|
||||
vim.cmd.enew()
|
||||
end
|
||||
pcall(vim.cmd, "bdelete " .. current_buf)
|
||||
end
|
||||
|
||||
wk.add {
|
||||
set_key.cmd("e", require("nvim-tree.api").tree.toggle, "Files"),
|
||||
set_key.cmd("w", "w!", "Write buffer"),
|
||||
set_key.cmd("d", smart_buffer_delete, "Delete buffer"),
|
||||
set_key.cmd("Q", "qa", "Quit all", true),
|
||||
set_key.cmd("q", "quit", "Quit window", true),
|
||||
}
|
||||
|
||||
set_key.git_signs = function(key, action, desc)
|
||||
return set_key.cmd("g" .. key, function()
|
||||
gitsigns[action]()
|
||||
end, desc)
|
||||
end
|
||||
|
||||
local function lazygit_toggle()
|
||||
local lazygit = Terminal:new {
|
||||
cmd = "lazygit",
|
||||
hidden = true,
|
||||
direction = "float",
|
||||
}
|
||||
lazygit:toggle()
|
||||
end
|
||||
|
||||
wk.add {
|
||||
{ "<leader>g", group = "Git" },
|
||||
|
||||
-- Gitsigns --
|
||||
set_key.git_signs("s", "stage_buffer", "Stage buffer"),
|
||||
set_key.git_signs("R", "reset_buffer", "Reset buffer"),
|
||||
set_key.git_signs("t", "toggle_signs", "Toggle signs"),
|
||||
set_key.git_signs("n", "toggle_numhl", "Toggle numhl"),
|
||||
set_key.git_signs("L", "toggle_linehl", "Toggle linehl"),
|
||||
set_key.git_signs("d", "toggle_deleted", "Toggle deleted"),
|
||||
|
||||
set_key.cmd("gg", lazygit_toggle, "Lazygit"),
|
||||
set_key.cmd("gH", "GhActions", "Github Actions"),
|
||||
set_key.cmd("gm", "GitMessenger", "Show Message"),
|
||||
|
||||
{ "<leader>gh", group = "Hunk" },
|
||||
|
||||
set_key.git_signs("hs", "stage_hunk", "Stage"),
|
||||
set_key.git_signs("hr", "reset_hunk", "Reset"),
|
||||
set_key.git_signs("hv", "preview_hunk", "Preview"),
|
||||
set_key.git_signs("hu", "undo_stage_hunk", "Undo Stage"),
|
||||
set_key.cmd("ghn", function()
|
||||
gitsigns.nav_hunk "next"
|
||||
end, "Next"),
|
||||
set_key.cmd("ghp", function()
|
||||
gitsigns.nav_hunk "prev"
|
||||
end, "Previous"),
|
||||
set_key.git_signs("hd", "diffthis", "Diff this"),
|
||||
set_key.cmd("ghD", function()
|
||||
gitsigns.diffthis "~"
|
||||
end, "Diff this"),
|
||||
}
|
||||
|
||||
--- LSP keys ---
|
||||
set_key.lsp = function(key, action)
|
||||
return set_key.cmd("l" .. key, "Lsp" .. action, action)
|
||||
end
|
||||
set_key.lsp_saga = function(key, action, desc)
|
||||
return set_key.cmd("l" .. key, "Lspsaga " .. action, desc or action)
|
||||
end
|
||||
wk.add {
|
||||
{ "<leader>l", group = "Lsp" },
|
||||
set_key.lsp("i", "Info"),
|
||||
set_key.lsp("R", "Restart"),
|
||||
set_key.lsp("s", "Start"),
|
||||
set_key.lsp("x", "Stop"),
|
||||
set_key.cmd("lf", require("conform").format, "Format"),
|
||||
set_key.cmd("lF", "ConformInfo", "Format"),
|
||||
|
||||
set_key.lsp_saga("r", "rename"),
|
||||
set_key.lsp_saga("o", "outline"),
|
||||
set_key.lsp_saga("a", "code_action", "Code Action"),
|
||||
}
|
||||
|
||||
--- FZF keys ---
|
||||
set_key.fzf = function(key, action, desc)
|
||||
return set_key.cmd("f" .. key, function()
|
||||
local fzf = require "fzf-lua"
|
||||
fzf[action]()
|
||||
end, desc or action)
|
||||
end
|
||||
|
||||
wk.add {
|
||||
{ "<leader>f", group = "FZF" },
|
||||
set_key.fzf("f", "files", "Files"),
|
||||
set_key.fzf("o", "oldfiles", "Old files"),
|
||||
set_key.fzf("l", "live_grep", "Live grep"),
|
||||
set_key.fzf("b", "buffers", "Buffers"),
|
||||
set_key.fzf("k", "keymaps", "Keymaps"),
|
||||
set_key.fzf("j", "jumps", "Jumps"),
|
||||
set_key.fzf("c", "commands", "Commands"),
|
||||
set_key.fzf("C", "colorschemes", "Colorschemes"),
|
||||
set_key.fzf("t", "tabs", "Tabs"),
|
||||
set_key.fzf("T", "treesitter", "Treesitter"),
|
||||
-- set_key.cmd("fh", "FzfHarpoon", "Harpoon"),
|
||||
set_key.fzf("s", "spell_suggest", "Spelling suggest"),
|
||||
|
||||
{ "<leader>fg", group = "Git" },
|
||||
set_key.fzf("gg", "git_files", "Files"),
|
||||
set_key.fzf("gs", "git_status", "Status"),
|
||||
set_key.fzf("gb", "git_bcommits", "Buffer commits"),
|
||||
set_key.fzf("gB", "git_branches", "Branches"),
|
||||
|
||||
{ "<leader>fL", group = "LSP" },
|
||||
set_key.fzf("Lr", "lsp_references", "References"),
|
||||
set_key.fzf("Ld", "lsp_definitions", "Definitions"),
|
||||
set_key.fzf("LD", "lsp_declarations", "Declarations"),
|
||||
set_key.fzf("Lt", "lsp_typedefs", "Type definitions"),
|
||||
set_key.fzf("Li", "lsp_implementations", "Implementations"),
|
||||
set_key.fzf("Ls", "lsp_document_symbols", "Symbols"),
|
||||
set_key.fzf("LS", "lsp_workspace_symbols", "Workspace symbols"),
|
||||
-- set_key.fzf("LS", "lsp_live_workspace_symbols", "Live workspace symbols"),
|
||||
set_key.fzf("LI", "lsp_incoming_calls", "Incoming calls"),
|
||||
set_key.fzf("Lc", "lsp_code_actions", "Code actions"),
|
||||
set_key.fzf("Lf", "lsp_finder", "Finder"),
|
||||
set_key.fzf("Lo", "lsp_outgoing_calls", "Outgoing calls"),
|
||||
-- set_key.fzf("LD", "diagnostics_document", "Diagnostics document"),
|
||||
-- set_key.fzf("LD", "diagnostics_workspace", "Diagnostics workspace"),
|
||||
}
|
||||
|
||||
set_key.trouble = function(key, action, desc)
|
||||
return set_key.cmd("x" .. key, "Trouble " .. action .. " focus=true win.position=bottom", desc)
|
||||
end
|
||||
wk.add {
|
||||
{ "<leader>x", group = "Trouble" },
|
||||
set_key.trouble("x", "diagnostics filter.buf=0", "Buffer Diagnostics"),
|
||||
set_key.trouble("X", "diagnostics", "Diagnostics"),
|
||||
set_key.trouble("t", "todo", "Todo"),
|
||||
set_key.trouble("q", "qflist", "QuickFix List"),
|
||||
set_key.trouble("L", "loclist", "Location List"),
|
||||
set_key.cmd("xv", function()
|
||||
local current_value = vim.diagnostic.config().virtual_text
|
||||
vim.diagnostic.config({ virtual_text = not current_value })
|
||||
end, "Toggle virtual text"),
|
||||
|
||||
--- LSP ---
|
||||
set_key.trouble("l", "lsp", "LSP"),
|
||||
set_key.trouble("D", "lsp_declarations", "declarations"),
|
||||
set_key.trouble("d", "lsp_definitions", "definitions"),
|
||||
set_key.trouble("s", "symbols", "Symbols"),
|
||||
set_key.trouble("i", "lsp_implementations", "implementations"),
|
||||
set_key.trouble("I", "lsp_incoming_calls", "Incoming calls"),
|
||||
set_key.trouble("O", "lsp_outgoing_calls", "Outgoing calls"),
|
||||
set_key.trouble("r", "lsp_references", "references"),
|
||||
set_key.trouble("T", "lsp_type_definitions", "type definitions"),
|
||||
}
|
||||
|
||||
set_key.latex = function(key, action)
|
||||
return set_key.cmd("L" .. key, "Vimtex" .. action, action)
|
||||
end
|
||||
|
||||
wk.add {
|
||||
{ "<leader>m", group = "Markdown" },
|
||||
set_key.cmd("mr", "RenderMarkdown toggle", "Toggle render"),
|
||||
set_key.cmd("mv", "MarkdownPreviewToggle", "Browser preview"),
|
||||
|
||||
--- Snap (Silicon) --
|
||||
{ "<leader>S", group = "Snap(Silicon)" },
|
||||
set_key.cmd("Ss", require("silicon").file, "Save as file"),
|
||||
set_key.cmd("Sc", require("silicon").clip, "Copy to clipboard"),
|
||||
|
||||
--- Latex (Vimtex) --
|
||||
{ "<leader>L", group = "Latex" },
|
||||
set_key.latex("v", "View"),
|
||||
set_key.latex("e", "Errors"),
|
||||
set_key.latex("r", "Reload"),
|
||||
set_key.latex("c", "Compile"),
|
||||
|
||||
set_key.cmd("r", require("grug-far").open, "Replace"),
|
||||
set_key.cmd("z", function()
|
||||
vim.wo.number = false
|
||||
require("zen-mode").toggle()
|
||||
end, "Zen Mode"),
|
||||
set_key.cmd("u", "UndotreeToggle", "Undo Tree"),
|
||||
set_key.cmd("H", "HexokinaseToggle", "Hexokinase"),
|
||||
}
|
||||
|
||||
wk.add {
|
||||
{ "<leader>t", group = "Debugging" },
|
||||
--- dap ---
|
||||
set_key.cmd("tb", "DapToggleBreakpoint", "Toggle Breakpoint"),
|
||||
set_key.cmd("td", "DapContinue", "Continue Debug Session"),
|
||||
set_key.cmd("tD", "DapNew", "New Debug Session"),
|
||||
set_key.cmd("ts", "DapStepInto", "Step Into"),
|
||||
set_key.cmd("tS", "DapStepOver", "Step Over"),
|
||||
set_key.cmd("tr", function()
|
||||
require("dap").repl.toggle()
|
||||
end, "Toggle Debug REPL"),
|
||||
|
||||
--- neotest ---
|
||||
set_key.cmd("tt", function()
|
||||
require("neotest").run.run()
|
||||
end, "Run nearest test"),
|
||||
set_key.cmd("tT", function()
|
||||
require("neotest").run.run({strategy = "dap"})
|
||||
end, "Debug nearest test"),
|
||||
set_key.cmd("ta", function()
|
||||
require("neotest").run.run(vim.fn.expand("%"))
|
||||
end, "Run all tests in file"),
|
||||
}
|
||||
17
home/editors/nvim/plugins/utils/which-key/default.nix
Normal file
17
home/editors/nvim/plugins/utils/which-key/default.nix
Normal file
@@ -0,0 +1,17 @@
|
||||
{pkgs, ...}: {
|
||||
extraPackages = with pkgs; [lazygit];
|
||||
|
||||
plugins.which-key = {
|
||||
enable = true;
|
||||
settings = {
|
||||
preset = "helix"; # "classic" | "modern" | "helix"
|
||||
sort = ["manual"];
|
||||
win = {
|
||||
border = "rounded";
|
||||
};
|
||||
icon.mappings = false;
|
||||
};
|
||||
};
|
||||
|
||||
extraConfigLua = builtins.readFile ./config.lua;
|
||||
}
|
||||
2
home/editors/nvim/stylua.toml
Normal file
2
home/editors/nvim/stylua.toml
Normal file
@@ -0,0 +1,2 @@
|
||||
quote_style = "AutoPreferSignle"
|
||||
call_parentheses = "None"
|
||||
Reference in New Issue
Block a user