bye nixvim

This commit is contained in:
cnst
2024-09-02 19:14:35 +02:00
parent ef04f7df84
commit ba1772e041
44 changed files with 1301 additions and 973 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 = bufferline-nvim;
type = "lua";
config =
/*
lua
*/
''
require('bufferline').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,41 @@
{pkgs, ...}: {
programs.neovim.plugins = with pkgs.vimPlugins; [
{
plugin = conform-nvim;
type = "lua";
config =
/*
lua
*/
''
require("conform").setup({
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(args)
require("conform").format({ bufnr = args.buf })
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-nvim.nix
./bufferline-nvim.nix
./comment-nvim.nix
./copilot-lua.nix
./fidget-nvim.nix
./gitsigns-nvim.nix
./treesitter.nix
./conform-nvim.nix
./gx-nvim.nix
./nvim-bqf.nix
./nvim-colorizer-lua.nix
./nvim-web-devicons.nix
./oil.nix
./lualine.nix
./range-highlight-nvim.nix
./vim-fugitive.nix
./which-key.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,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,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 = nvim-colorizer-lua;
type = "lua";
config =
/*
lua
*/
''
require('colorizer').setup{}
'';
}
];
}

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,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 = range-highlight-nvim;
type = "lua";
config =
/*
lua
*/
''
require('range-highlight').setup{}
'';
}
];
}

View File

@@ -0,0 +1,25 @@
{pkgs, ...}: {
programs.neovim.plugins = with pkgs.vimPlugins; [
{
plugin = nvim-treesitter.withAllGrammars;
type = "lua";
config =
/*
lua
*/
''
require("nvim-treesitter.configs").setup({
-- ensure_installed = { "nix", "lua" },
highlight = {
enable = true,
additional_vim_regex_highlighting = false,
disable = function(lang, bufnr)
return vim.fn.getfsize(vim.api.nvim_buf_get_name(bufnr)) > 1048576
end,
},
parser_install_dir = vim.fn.stdpath("data") .. "/parsers",
})
'';
}
];
}

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,15 @@
{pkgs, ...}: {
programs.neovim.plugins = with pkgs.vimPlugins; [
{
plugin = which-key-nvim;
type = "lua";
config =
/*
lua
*/
''
require('which-key').setup{}
'';
}
];
}