Files
dotfiles/nix/modules/nixvim/home.nix

160 lines
3.3 KiB
Nix

{
config,
inputs,
pkgs,
lib,
...
}:
let
cfg = config.modules.nixvim;
in
{
options.modules.nixvim = {
enable = lib.mkEnableOption "Nixvim";
};
imports = [
inputs.nixvim.homeModules.nixvim
./plugins
];
config.home.packages = with pkgs; [
# formatters
nixfmt
rustfmt
# misc
ripgrep
];
config.programs.nixvim = lib.mkIf cfg.enable {
enable = true;
defaultEditor = true;
colorschemes.tokyonight.enable = true;
plugins = {
lsp-status.enable = true;
lsp = {
enable = true;
servers = {
rust_analyzer = {
enable = true;
};
};
};
notify.enable = true;
mini-cursorword.enable = true;
mini-statusline.enable = true;
web-devicons.enable = true;
vim-dadbod-completion.enable = true;
telescope.enable = true;
lazygit.enable = true;
persisted.enable = true;
wakatime.enable = true;
treesitter = {
enable = true;
grammarPackages = with pkgs.vimPlugins.nvim-treesitter.builtGrammars; [
bash
json
lua
make
markdown
nix
regex
toml
vim
vimdoc
xml
yaml
];
settings = {
highlight.enable = true;
};
};
};
extraPlugins =
with pkgs;
[
vimPlugins.mini-completion
vimPlugins.mini-comment
vimPlugins.melange-nvim
vimPlugins.telescope-file-browser-nvim
]
++ [
(pkgs.vimUtils.buildVimPlugin {
name = "telescope-tabs";
doCheck = false; # i didnt figure out how to do deps so lmfao
src = pkgs.fetchFromGitHub {
owner = "LukasPietzschmann";
repo = "telescope-tabs";
rev = "777b1f630f3d6a12a2e71635a82581c988d6da2e";
hash = "sha256-5NpH9+0ECrcKi8quPLpCHLSPTuzGETWtq4E+2jqUKio=";
};
})
];
opts = {
number = true;
bg = "dark";
tabstop = 2;
shiftwidth = 2;
termguicolors = true;
};
globals = {
mapleader = " ";
};
keymaps = [
{
action = "<cmd>Telescope persisted<cr>";
key = "<leader>fs";
options = {
silent = true;
};
}
{
action = "<cmd>Telescope find_files<cr>";
key = "<leader>ff";
options = {
silent = true;
};
}
{
action = "<cmd>Telescope file_browser<cr>";
key = "<leader>fv";
options = {
silent = true;
};
}
{
action = "<cmd>Telescope telescope-tabs list_tabs<cr>";
key = "<leader>ft";
options = {
silent = true;
};
}
{
action = "<cmd>tabnew<cr>";
key = "<leader>tt";
options = {
silent = true;
};
}
{
action = "<cmd>LazyGit<cr>";
key = "<leader>lg";
options = {
silent = true;
};
}
{
action = "<cmd>Telescope buffers<cr>";
key = "<leader>fb";
options = {
silent = true;
};
}
{
action = "<cmd>Telescope live_grep<cr>";
key = "<leader>fg";
options = {
silent = true;
};
}
];
};
}