253 lines
6.3 KiB
Nix
253 lines
6.3 KiB
Nix
{ lib, config, ... }:
|
|
{
|
|
options = {
|
|
custom.neovim.enable = lib.mkEnableOption "My neovim config";
|
|
};
|
|
config = lib.mkIf config.custom.neovim.enable {
|
|
home = {
|
|
sessionVariables = {
|
|
EDITOR = "nvim";
|
|
};
|
|
};
|
|
programs.nixvim = {
|
|
enable = true;
|
|
plugins = {
|
|
neogit.enable = true;
|
|
dropbar.enable = true;
|
|
lspconfig.enable = true;
|
|
guess-indent.enable = true;
|
|
gitsigns = {
|
|
enable = true;
|
|
settings = {
|
|
sign_priority = 15;
|
|
};
|
|
};
|
|
oil.enable = true;
|
|
trouble.enable = true;
|
|
web-devicons.enable = true;
|
|
lualine.enable = true;
|
|
mini-pairs.enable = true;
|
|
snacks = {
|
|
enable = true;
|
|
settings = {
|
|
picker = {
|
|
ui_select = true;
|
|
};
|
|
};
|
|
};
|
|
mini-indentscope.enable = true;
|
|
mini-surround.enable = true;
|
|
ts-autotag.enable = true;
|
|
blink-cmp = {
|
|
enable = true;
|
|
settings = {
|
|
signature = {
|
|
enabled = true;
|
|
};
|
|
};
|
|
};
|
|
treesitter = {
|
|
enable = true;
|
|
highlight.enable = true;
|
|
indent.enable = true;
|
|
};
|
|
harpoon.enable = true;
|
|
dap.enable = true;
|
|
dap-virtual-text.enable = true;
|
|
dap-view = {
|
|
enable = true;
|
|
settings = {
|
|
winbar = {
|
|
default_section = "scopes";
|
|
};
|
|
};
|
|
};
|
|
dap-python.enable = true;
|
|
hydra = {
|
|
enable = true;
|
|
hydras = [
|
|
{
|
|
body = "<leader>d";
|
|
config = {
|
|
color = "pink";
|
|
hint = {
|
|
hide_on_load = true;
|
|
};
|
|
on_enter = ''
|
|
function()
|
|
require("dap-view").open()
|
|
end
|
|
'';
|
|
on_exit = ''
|
|
function()
|
|
require("dap-view").close()
|
|
end
|
|
'';
|
|
};
|
|
heads = [
|
|
[
|
|
"o"
|
|
""
|
|
]
|
|
[
|
|
"c"
|
|
"<cmd>DapContinue<CR>"
|
|
]
|
|
[
|
|
"b"
|
|
"<cmd>DapToggleBreakpoint<CR>"
|
|
]
|
|
[
|
|
"n"
|
|
"<cmd>DapStepOver<CR>"
|
|
]
|
|
[
|
|
"i"
|
|
"<cmd>DapStepInto<CR>"
|
|
]
|
|
[
|
|
"x"
|
|
"<cmd>DapDisconnect<CR>"
|
|
]
|
|
[
|
|
"t"
|
|
{
|
|
__raw = ''
|
|
function()
|
|
debug_current_test()
|
|
end
|
|
'';
|
|
}
|
|
]
|
|
];
|
|
}
|
|
];
|
|
};
|
|
};
|
|
keymaps = [
|
|
{
|
|
action = "<cmd>Oil<CR>";
|
|
key = "<leader>o";
|
|
}
|
|
{
|
|
action = "<cmd>lua require('snacks').picker.files()<CR>";
|
|
key = "<leader>f";
|
|
}
|
|
{
|
|
action = "<cmd>lua require('snacks').picker.grep()<CR>";
|
|
key = "<leader>l";
|
|
}
|
|
{
|
|
action = "<cmd>lua require('snacks').picker.help()<CR>";
|
|
key = "<leader>h";
|
|
}
|
|
{
|
|
action = "<cmd>lua require('snacks').picker.resume()<CR>";
|
|
key = "<leader>r";
|
|
}
|
|
{
|
|
action = "<cmd>lua vim.lsp.buf.format()<CR>";
|
|
key = "<leader>i";
|
|
}
|
|
{
|
|
action = "<cmd>lua vim.lsp.buf.code_action()<CR>";
|
|
key = "<leader>a";
|
|
}
|
|
{
|
|
action = "<cmd>lua vim.diagnostic.goto_prev({ float = true })<CR>";
|
|
key = "[d";
|
|
}
|
|
{
|
|
action = "<cmd>lua vim.diagnostic.goto_next({ float = true })<CR>";
|
|
key = "]d";
|
|
}
|
|
{
|
|
action = "<cmd>Trouble diagnostics<CR>";
|
|
key = "<leader>q";
|
|
}
|
|
{
|
|
action = "<cmd>lua require('harpoon'):list():add()<CR>";
|
|
key = "<leader>k";
|
|
}
|
|
{
|
|
action = "<cmd>lua require('harpoon'):list():select(1)<CR>";
|
|
key = "<M-q>";
|
|
}
|
|
{
|
|
action = "<cmd>lua require('harpoon'):list():select(2)<CR>";
|
|
key = "<M-w>";
|
|
}
|
|
{
|
|
action = "<cmd>lua require('harpoon'):list():select(3)<CR>";
|
|
key = "<M-e>";
|
|
}
|
|
{
|
|
action = "<cmd>lua require('harpoon'):list():select(4)<CR>";
|
|
key = "<M-r>";
|
|
}
|
|
{
|
|
action = "<cmd>lua require('harpoon').ui:toggle_quick_menu(require('harpoon'):list())<CR>";
|
|
key = "<leader>j";
|
|
}
|
|
{
|
|
action = "<cmd>CopyRelativePath<CR>";
|
|
key = "<leader>p";
|
|
}
|
|
{
|
|
action = "<cmd>Neogit<CR>";
|
|
key = "<leader>go";
|
|
}
|
|
{
|
|
action = "<cmd>Gitsigns blame<CR>";
|
|
key = "<leader>gb";
|
|
}
|
|
{
|
|
action = "<cmd>Gitsigns diffthis<CR>";
|
|
key = "<leader>gd";
|
|
}
|
|
];
|
|
globals.mapleader = " ";
|
|
opts = {
|
|
number = true;
|
|
relativenumber = true;
|
|
ignorecase = true;
|
|
smartcase = true;
|
|
swapfile = false;
|
|
exrc = true;
|
|
};
|
|
colorschemes.catppuccin = {
|
|
enable = true;
|
|
settings = {
|
|
custom_highlights = {
|
|
__raw = ''
|
|
function(colors)
|
|
return {
|
|
LineNr = { fg = colors.subtext0 },
|
|
}
|
|
end
|
|
'';
|
|
};
|
|
};
|
|
};
|
|
clipboard.register = "unnamedplus";
|
|
userCommands = {
|
|
CopyRelativePath = {
|
|
command = "call setreg('+', expand('%'))";
|
|
};
|
|
};
|
|
lsp.servers = {
|
|
basedpyright.enable = true;
|
|
gopls.enable = true;
|
|
nil_ls.enable = true;
|
|
rust_analyzer.enable = true;
|
|
html.enable = true;
|
|
jsonls.enable = true;
|
|
yamlls.enable = true;
|
|
cssls.enable = true;
|
|
tailwindcss.enable = true;
|
|
vtsls.enable = true;
|
|
lua_ls.enable = true;
|
|
};
|
|
};
|
|
};
|
|
}
|