This commit is contained in:
cnst
2024-10-17 20:06:17 +02:00
parent f70061cc24
commit ec57cb7599
196 changed files with 1150 additions and 1271 deletions

View File

@@ -0,0 +1,38 @@
{pkgs, ...}: {
programs.neovim.plugins = with pkgs.vimPlugins; [
{
plugin = alpha-nvim;
type = "lua";
config =
/*
lua
*/
''
local alpha = require("alpha")
local dashboard = require("alpha.themes.dashboard")
dashboard.section.header.val = {
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
}
dashboard.section.header.opts.hl = "Title"
dashboard.section.buttons.val = {
dashboard.button("n", "󰈔 New file", ":enew<CR>"),
dashboard.button("e", " Explore", ":Explore<CR>"),
dashboard.button("g", " Git summary", ":Git | :only<CR>"),
dashboard.button("c", " Nix config flake", ":e ~/.nix-config/flake.nix<CR>"),
}
alpha.setup(dashboard.opts)
vim.keymap.set("n", "<space>h", ":Alpha<CR>", { desc = "Open home dashboard" })
'';
}
];
}

View File

@@ -0,0 +1,15 @@
{pkgs, ...}: {
programs.neovim.plugins = with pkgs.vimPlugins; [
{
plugin = nvim-autopairs;
type = "lua";
config =
/*
lua
*/
''
require("nvim-autopairs").setup({})
'';
}
];
}

View File

@@ -0,0 +1,15 @@
{pkgs, ...}: {
programs.neovim.plugins = with pkgs.vimPlugins; [
{
plugin = nvim-bqf;
type = "lua";
config =
/*
lua
*/
''
require("bqf").setup({})
'';
}
];
}

View File

@@ -0,0 +1,15 @@
{pkgs, ...}: {
programs.neovim.plugins = with pkgs.vimPlugins; [
{
plugin = bufferline-nvim;
type = "lua";
config =
/*
lua
*/
''
require("bufferline").setup({})
'';
}
];
}

View File

@@ -0,0 +1,15 @@
{pkgs, ...}: {
programs.neovim.plugins = with pkgs.vimPlugins; [
{
plugin = nvim-colorizer-lua;
type = "lua";
config =
/*
lua
*/
''
require("colorizer").setup({})
'';
}
];
}

View File

@@ -0,0 +1,22 @@
{pkgs, ...}: {
programs.neovim.plugins = with pkgs.vimPlugins; [
{
plugin = comment-nvim;
type = "lua";
config =
/*
lua
*/
''
require("Comment").setup({
opleader = {
line = "<C-b>",
},
toggler = {
line = "<C-b>",
},
})
'';
}
];
}

View File

@@ -0,0 +1,47 @@
{pkgs, ...}: {
programs.neovim.plugins = with pkgs.vimPlugins; [
{
plugin = conform-nvim;
type = "lua";
config =
/*
lua
*/
''
require("conform").setup({
default_format_opts = {
timeout_ms = 3000,
async = false, -- not recommended to change
quiet = false, -- not recommended to change
lsp_format = "fallback", -- not recommended to change
},
formatters_by_ft = {
bash = { "shfmt" },
css = { "prettierd" },
html = { "prettierd" },
javascript = { "prettierd" },
json = { "fixjson" },
lua = { "stylua" },
nix = { "alejandra" },
php = { "php_cs_fixer" },
python = { "black" },
rust = { "rustfmt" },
sh = { "shfmt" },
typescript = { "prettierd" },
query = { "sql_formatter" },
yaml = { "prettierd" },
["*"] = { "injected" },
},
})
-- Optionally, set up a command or auto-command to format on save
vim.api.nvim_create_autocmd("BufWritePre", {
pattern = "*",
callback = function()
require("conform").format()
end,
})
'';
}
];
}

View File

@@ -0,0 +1,45 @@
{pkgs, ...}: {
programs.neovim.plugins = with pkgs.vimPlugins; [
{
plugin = copilot-lua;
type = "lua";
config =
/*
lua
*/
''
require("copilot").setup({
panel = {
enabled = true,
auto_refresh = true,
keymap = {
jump_prev = "[[",
jump_next = "]]",
accept = "<CR>",
refresh = "gr",
open = "<M-CR>",
},
layout = {
position = "bottom", -- | top | left | right
ratio = 0.4,
},
},
suggestion = {
enabled = true,
auto_trigger = true,
hide_during_completion = true,
debounce = 75,
keymap = {
accept = "<C-CR>",
accept_word = false,
accept_line = false,
next = "<M-]>",
prev = "<M-[>",
dismiss = "<C-]>",
},
},
})
'';
}
];
}

View File

@@ -0,0 +1,24 @@
{pkgs, ...}: {
programs.neovim.plugins = with pkgs.vimPlugins; [
vim-illuminate
];
imports = [
./alpha.nix
./bufferline.nix
./copilot.nix
./fidget.nix
./gitsigns.nix
./treesitter.nix
./conform.nix
./gx.nix
./bqf.nix
./colorizer.nix
./web-devicons.nix
./oil.nix
./lualine.nix
./range-highlight.nix
./fugitive.nix
./which-key.nix
./autopairs.nix
];
}

View File

@@ -0,0 +1,21 @@
{pkgs, ...}: {
programs.neovim.plugins = with pkgs.vimPlugins; [
{
plugin = fidget-nvim;
type = "lua";
config =
/*
lua
*/
''
require("fidget").setup({
progress = {
display = {
progress_icon = { pattern = "dots", period = 1 },
},
},
})
'';
}
];
}

View File

@@ -0,0 +1,15 @@
{pkgs, ...}: {
programs.neovim.plugins = with pkgs.vimPlugins; [
{
plugin = vim-fugitive;
type = "viml";
config =
/*
vim
*/
''
nmap <space>G :Git<CR>
'';
}
];
}

View File

@@ -0,0 +1,23 @@
{pkgs, ...}: {
programs.neovim.plugins = with pkgs.vimPlugins; [
{
plugin = gitsigns-nvim;
type = "lua";
config =
/*
lua
*/
''
require("gitsigns").setup({
signs = {
add = { text = "+" },
change = { text = "~" },
delete = { text = "_" },
topdelete = { text = "" },
changedelete = { text = "~" },
},
})
'';
}
];
}

View File

@@ -0,0 +1,28 @@
{pkgs, ...}: let
gx-nvim = pkgs.vimUtils.buildVimPlugin {
name = "gx-nvim";
src = pkgs.fetchFromGitHub {
owner = "chrishrb";
repo = "gx.nvim";
rev = "f29a87454b02880e0d76264c21be8316224a7395";
hash = "sha256-QWJ/cPvSyMTJoWLg51BNFf9+/9i7G+nzennpHP/eQ4g=";
};
};
in {
programs.neovim.plugins = [
{
plugin = gx-nvim;
type = "lua";
config =
/*
lua
*/
''
require("gx").setup({})
vim.keymap.set({ "n", "x" }, "gx", ":Browse<CR>", {
desc = "Open the file under cursor with system app",
})
'';
}
];
}

View File

@@ -0,0 +1,54 @@
{pkgs, ...}: {
programs.neovim.plugins = with pkgs.vimPlugins; [
{
plugin = lualine-nvim;
type = "lua";
config =
/*
lua
*/
''
require("lualine").setup({
options = {
icons_enabled = true,
theme = "gruvbox-material",
component_separators = { left = "", right = "" },
section_separators = { left = "", right = "" },
disabled_filetypes = {
statusline = {},
winbar = {},
},
ignore_focus = {},
always_divide_middle = true,
globalstatus = false,
refresh = {
statusline = 1000,
tabline = 1000,
winbar = 1000,
},
},
sections = {
lualine_a = { "mode" },
lualine_b = { "branch", "diff", "diagnostics" },
lualine_c = { "filename" },
lualine_x = { "encoding", "fileformat", "filetype" },
lualine_y = { "progress" },
lualine_z = { "location" },
},
inactive_sections = {
lualine_a = {},
lualine_b = {},
lualine_c = { "filename" },
lualine_x = { "location" },
lualine_y = {},
lualine_z = {},
},
tabline = {},
winbar = {},
inactive_winbar = {},
extensions = {},
})
'';
}
];
}

View File

@@ -0,0 +1,51 @@
{pkgs, ...}: {
programs.neovim = {
plugins = with pkgs.vimPlugins; [
none-ls-nvim
plenary-nvim
nvim-treesitter.withAllGrammars
];
extraConfig =
/*
lua
*/
''
-- Require necessary plugins
require("plenary")
require("nvim-treesitter.configs").setup({
highlight = {
enable = true,
},
indent = {
enable = true,
},
})
local null_ls = require("null-ls")
-- Setup null-ls with stylua and other formatters
null_ls.setup({
sources = {
null_ls.builtins.formatting.alejandra,
null_ls.builtins.formatting.stylua,
null_ls.builtins.formatting.black,
null_ls.builtins.formatting.isort,
null_ls.builtins.formatting.phpcsfixer,
null_ls.builtins.formatting.pint,
null_ls.builtins.formatting.prettier,
null_ls.builtins.formatting.sql_formatter,
null_ls.builtins.formatting.xmllint,
null_ls.builtins.formatting.shfmt,
},
})
-- Function to format on save
local function format_on_save()
vim.cmd([[autocmd BufWritePre * lua vim.lsp.buf.format({ async = true })]])
end
-- Call the function to enable auto format on save
format_on_save()
'';
};
}

View File

@@ -0,0 +1,35 @@
{pkgs, ...}: {
programs.neovim.plugins = with pkgs.vimPlugins; [
{
plugin = oil-nvim;
type = "lua";
config =
/*
lua
*/
''
require("oil").setup({
buf_options = {
buflisted = true,
bufhidden = "delete",
},
cleanup_delay_ms = false,
use_default_keymaps = false,
keymaps = {
["<CR>"] = "actions.select",
["-"] = "actions.parent",
["_"] = "actions.open_cwd",
["`"] = "actions.cd",
["~"] = "actions.tcd",
["gc"] = "actions.close",
["gr"] = "actions.refresh",
["gs"] = "actions.change_sort",
["gx"] = "actions.open_external",
["g."] = "actions.toggle_hidden",
["g\\"] = "actions.toggle_trash",
},
})
'';
}
];
}

View File

@@ -0,0 +1,15 @@
{pkgs, ...}: {
programs.neovim.plugins = with pkgs.vimPlugins; [
{
plugin = plenary-nvim;
type = "lua";
config =
/*
lua
*/
''
require("plenary").setup({})
'';
}
];
}

View File

@@ -0,0 +1,15 @@
{pkgs, ...}: {
programs.neovim.plugins = with pkgs.vimPlugins; [
{
plugin = range-highlight-nvim;
type = "lua";
config =
/*
lua
*/
''
require("range-highlight").setup({})
'';
}
];
}

View File

@@ -0,0 +1,20 @@
{pkgs, ...}: {
programs.neovim.plugins = with pkgs.vimPlugins; [
{
plugin = nvim-treesitter.withAllGrammars;
type = "lua";
config =
/*
lua
*/
''
require("nvim-treesitter.configs").setup({
highlight = {
enable = true,
additional_vim_regex_highlighting = false,
},
})
'';
}
];
}

View File

@@ -0,0 +1,15 @@
{pkgs, ...}: {
programs.neovim.plugins = with pkgs.vimPlugins; [
{
plugin = nvim-web-devicons;
type = "lua";
config =
/*
lua
*/
''
require("nvim-web-devicons").setup({})
'';
}
];
}

View File

@@ -0,0 +1,15 @@
{pkgs, ...}: {
programs.neovim.plugins = with pkgs.vimPlugins; [
{
plugin = which-key-nvim;
type = "lua";
config =
/*
lua
*/
''
require("which-key").setup({})
'';
}
];
}