170 lines
5.6 KiB
Nix
170 lines
5.6 KiB
Nix
{ pkgs, ... }: {
|
|
programs.neovim = {
|
|
enable = true;
|
|
extraLuaConfig = [
|
|
"vim.g.mapleader = ' '"
|
|
"vim.g.maplocalleader = ' '"
|
|
"vim.g.have_nerd_font = true"
|
|
"vim.opt.clipboard = 'unnamedplus'"
|
|
"vim.opt.cursorline = true"
|
|
"vim.opt.expandtab = true"
|
|
"vim.opt.hlsearch = true"
|
|
"vim.opt.inccommand = 'split'"
|
|
"vim.opt.modeline = true"
|
|
"vim.opt.mouse = 'a'"
|
|
"vim.opt.number = true"
|
|
"vim.opt.preserveindent = true"
|
|
"vim.opt.relativenumber = true"
|
|
"vim.opt.ruler = true"
|
|
"vim.opt.scrolloff = 5"
|
|
"vim.opt.shiftwidth = 2"
|
|
"vim.opt.showmode = true"
|
|
"vim.opt.showtabline = 1"
|
|
"vim.opt.softtabstop = 2"
|
|
"vim.opt.tabstop = 2"
|
|
"vim.opt.termguicolors = true"
|
|
"vim.opt.listchars = { tab = '» ', trail = '·', nbsp = '␣' }"
|
|
"vim.opt.inccommand = 'split'"
|
|
"vim.opt.foldmethod = 'marker'"
|
|
"vim.cmd.colorscheme 'sprouting-dark'"
|
|
];
|
|
plugins = with pkgs.vimPlugins; [
|
|
{ plugin = mini-align; }
|
|
{ plugin = mini-basics; }
|
|
{ plugin = mini-diff; }
|
|
{ plugin = mini-extra; }
|
|
{ plugin = mini-git; }
|
|
{ plugin = mini-icons; }
|
|
{ plugin = mini-move; }
|
|
{ plugin = mini-operators; }
|
|
{ plugin = mini-pairs; }
|
|
{ plugin = mini-snippets; }
|
|
{ plugin = mini-splitjoin; }
|
|
{
|
|
plugin = mini-statusline;
|
|
type = "lua";
|
|
config = /* lua */''
|
|
content = {
|
|
active = function()
|
|
local check_macro_recording = function()
|
|
if vim.fn.reg_recording() ~= \'\' then
|
|
return '@' .. vim.fn.reg_recording()
|
|
else
|
|
return \'\'
|
|
end
|
|
end
|
|
|
|
-- configure statusline for active windows
|
|
local mode, mode_hl = MiniStatusline.section_mode { trunc_width = 120 }
|
|
local git = MiniStatusline.section_git { trunc_width = 40 }
|
|
local diff = MiniStatusline.section_diff { trunc_width = 75 }
|
|
local diagnostics = MiniStatusline.section_diagnostics { trunc_width = 75 }
|
|
local lsp = MiniStatusline.section_lsp { trunc_width = 75 }
|
|
local filename = MiniStatusline.section_filename { trunc_width = 140 }
|
|
local fileinfo = MiniStatusline.section_fileinfo { trunc_width = 120 }
|
|
local location = MiniStatusline.section_location { trunc_width = 75 }
|
|
local search = MiniStatusline.section_searchcount { trunc_width = 75 }
|
|
local macro = check_macro_recording()
|
|
|
|
return MiniStatusline.combine_groups {
|
|
{ hl = mode_hl, strings = { mode } },
|
|
{ hl = 'MiniStatuslineDevinfo', strings = { git, diff, diagnostics, lsp } },
|
|
'%<', -- Mark general truncate point
|
|
{ hl = 'MiniStatuslineFilename', strings = { filename } },
|
|
'%=', -- End left alignment
|
|
{ hl = 'MiniStatuslineFilename', strings = { macro } },
|
|
{ hl = 'MiniStatuslineFileinfo', strings = { fileinfo } },
|
|
{ hl = mode_hl, strings = { search, location } },
|
|
}
|
|
end,
|
|
use_icons = true,
|
|
set_vim_settings = true,
|
|
}
|
|
'';
|
|
}
|
|
{ plugin = nui-nvim; }
|
|
{ plugin = nvim-colorizer-lua; }
|
|
{
|
|
plugin = noice-nvim;
|
|
type = "lua";
|
|
config = /* lua */''
|
|
lsp = {
|
|
override = {
|
|
['vim.lsp.util.convert_input_to_markdown_lines'] = true,
|
|
['vim.lsp.util.stylize_markdown'] = true,
|
|
},
|
|
},
|
|
popupmenu = {
|
|
enabled = true,
|
|
backend = 'nui',
|
|
},
|
|
notify = {
|
|
enabled = true,
|
|
view = 'notify',
|
|
},
|
|
routes = {
|
|
{
|
|
view = 'notify',
|
|
filter = { event = 'msg_showmode' },
|
|
},
|
|
},
|
|
'';
|
|
}
|
|
{
|
|
plugin = snacks-nvim;
|
|
type = "lua";
|
|
config = /* lua */''
|
|
animate = {},
|
|
dim = {},
|
|
image = {},
|
|
indent = {},
|
|
lazygit = {},
|
|
picker = {},
|
|
'';
|
|
}
|
|
{ plugin = lazygit-nvim; }
|
|
{ plugin = nvim-lspconfig; }
|
|
{ plugin = nvim-treesitter; }
|
|
{ plugin = plenary-nvim; }
|
|
{ plugin = go-nvim; }
|
|
{ plugin = guihua-lua; }
|
|
{
|
|
plugin = conform-nvim;
|
|
type = "lua";
|
|
config = /* lua */''
|
|
formatters_by_ft = {
|
|
ansible = { 'ansible-lint' },
|
|
buf = { 'buf' },
|
|
cmake = { 'cmake_format' },
|
|
go = { 'goimports' },
|
|
markdown = { 'cbfmt', 'mdformat' },
|
|
sql = { 'sqlfluff' },
|
|
terraform = { 'terraform_fmt' },
|
|
templ = { 'go tool templ fmt' },
|
|
},
|
|
'';
|
|
}
|
|
{ plugin = which-key-nvim; }
|
|
{ plugin = yazi-nvim; }
|
|
{ plugin = dashboard-nvim; }
|
|
];
|
|
defaultEditor = true;
|
|
viAlias = true;
|
|
vimAlias = true;
|
|
vimdiffAlias = true;
|
|
withNodeJs = true;
|
|
withPerl = true;
|
|
withPython3 = true;
|
|
extraPackages = with pkgs; [
|
|
delve
|
|
ginkgo
|
|
golangci-lint
|
|
gopls
|
|
gotests
|
|
gotestsum
|
|
gotools
|
|
govulncheck
|
|
tree-sitter
|
|
];
|
|
};
|
|
} |