nix/home-manager/common/software/cli/neovim.nix
2024-02-07 12:46:59 +09:00

100 lines
1.9 KiB
Nix

{config, pkgs, ... }: {
programs.neovim = {
package = pkgs.neovim-unwrapped;
enable = true;
defaultEditor = true;
viAlias = true;
vimAlias = true;
vimdiffAlias = true;
plugins = with pkgs.vimPlugins; [
nvchad
fugitive
fzf-vim
fzf-lua
fzfWrapper
];
};
# nvchad requires gcc, npm, and unzip
home.packages = [
pkgs.gcc
pkgs.unzip
pkgs.nodejs_20
pkgs.ripgrep
pkgs.fd
pkgs.lazygit
];
# Link the nvchad files to my homedir
# https://mipmip.github.io/home-manager-option-search/?query=xdg.dataFile
xdg.configFile."nvim" = {
enable = true;
recursive = true;
source = "${pkgs.vimPlugins.nvchad}/";
target = "./nvim";
};
xdg.configFile."nvim-custom-plugins" = {
enable = true;
target = "./nvim/lua/custom/plugins.lua";
text = ''
local overrides = require("custom.configs.overrides")
---@type NvPluginSpec[]
local plugins = {
-- Override plugin definition options
{
"neovim/nvim-lspconfig",
dependencies = {
-- format & linting
{
"jose-elias-alvarez/null-ls.nvim",
config = function()
require "custom.configs.null-ls"
end,
},
},
config = function()
require "plugins.configs.lspconfig"
require "custom.configs.lspconfig"
end, -- Override to setup mason-lspconfig
},
-- override plugin configs
{
"williamboman/mason.nvim",
opts = overrides.mason
},
{
"nvim-treesitter/nvim-treesitter",
opts = overrides.treesitter,
},
{
"nvim-tree/nvim-tree.lua",
opts = overrides.nvimtree,
},
-- Install a plugin
{
"max397574/better-escape.nvim",
event = "InsertEnter",
config = function()
require("better_escape").setup()
end,
},
-- vim-fugitive for integrated Git
{
"tpope/vim-fugitive",
event = "VeryLazy",
}
}
return plugins
'';
};
}