neovim-flake/config/plugins/qol.nix

171 lines
4.5 KiB
Nix
Raw Normal View History

# Quality of life plugins
{ pkgs, inputs, ... }:
2024-09-02 18:28:53 -07:00
{
extraPackages = with pkgs; [
ripgrep
fd
];
plugins = {
zen-mode.enable = true;
direnv.enable = true;
intellitab.enable = true;
sleuth.enable = true;
comment.enable = true;
vim-bbye.enable = true;
indent-blankline.enable = true;
2024-09-17 14:21:47 -07:00
which-key = {
enable = true;
settings.delay = 1000;
};
2024-10-08 00:06:40 -07:00
nvim-autopairs = {
enable = true;
luaConfig.post = ''
local npairs = require('nvim-autopairs')
local Rule = require('nvim-autopairs.rule')
local cond = require('nvim-autopairs.conds')
npairs.add_rules({
Rule("$", "$",{"tex", "latex", "typst"})
-- don't add a pair if the next character is %
:with_pair(cond.not_after_regex("%%"))
-- don't add a pair if the previous character is xxx
:with_pair(cond.not_before_regex("xxx", 3))
-- don't move right when repeat character
:with_move(cond.none())
-- don't delete if the next character is xx
:with_del(cond.not_after_regex("xx"))
-- disable adding a newline when you press <cr>
:with_cr(cond.none())
},
{
Rule("_", "_","typst")
-- don't add a pair if the previous character is xxx
:with_pair(cond.not_before_regex("[%w%.]", 3))
-- don't move right when repeat character
:with_move(cond.none())
-- don't delete if the next character is xx
:with_del(cond.not_after_regex("[%w%.]"))
},
{
Rule("*", "*","typst")
-- don't add a pair if the previous character is xxx
:with_pair(cond.not_before_regex("[%w%.]", 3))
-- don't move right when repeat character
:with_move(cond.none())
-- don't delete if the next character is xx
:with_del(cond.not_after_regex("[%w%.]"))
},
{
Rule("$$","$$","tex")
:with_pair(function(opts)
print(vim.inspect(opts))
if opts.line=="aa $$" then
-- don't add pair on that line
return false
end
end)
}
)
'';
};
yanky = {
enable = true;
enableTelescope = true;
};
trouble.enable = true;
barbecue.enable = true;
2024-09-18 01:23:24 -07:00
undotree.enable = true;
lualine = {
enable = true;
settings = {
sections = {
lualine_a = [ "branch" ];
lualine_b = [
2024-09-17 16:23:43 -07:00
{
__unkeyed-1 = {
__raw = ''
function()
return require('lsp-progress').progress()
end,
'';
};
}
2024-09-17 15:22:42 -07:00
];
lualine_c = [
"progress"
"filetype"
2024-09-17 15:22:42 -07:00
];
lualine_x = [
"encoding"
"fileformat"
];
lualine_y = [
2024-09-17 16:23:43 -07:00
"diff"
"diagnostics"
];
2024-09-17 15:22:42 -07:00
lualine_z = [ "location" ];
};
options = {
globalstatus = true;
2024-09-17 15:59:09 -07:00
disabled_filetypes = [
"ministarter"
];
2024-09-17 15:22:42 -07:00
section_separators = {
left = "";
right = "";
};
};
};
};
crates-nvim.enable = true;
# git stuff
2024-09-17 14:48:00 -07:00
gitsigns = {
enable = true;
settings = {
current_line_blame_opts = {
virt_text = true;
virt_text_pos = "eol";
};
};
};
neogit = {
enable = true;
2024-09-18 00:33:58 -07:00
settings = {
graph_style = "unicode";
integrations = {
diffview = true;
telescope = true;
};
2024-09-18 00:33:58 -07:00
};
};
diffview.enable = true;
2024-09-18 00:29:27 -07:00
# The greatest QoL plugin of all time. Renders codeblocks, formatting, etc
# in LSP popup buffers too. GUI users will never flex on you with their
# typesetting again!
markdown-preview.enable = true;
2024-09-18 00:29:27 -07:00
# Language specific tools
2024-08-28 01:39:06 -07:00
ts-autotag.enable = true;
};
extraPlugins = [
(pkgs.vimUtils.buildVimPlugin {
name = "satellite.nvim";
src = inputs.satellite;
})
(pkgs.vimUtils.buildVimPlugin {
name = "render-markdown.nvim";
src = inputs.render-markdown;
})
(pkgs.vimUtils.buildVimPlugin {
name = "lsp-progress.nvim";
src = inputs.lsp-progress;
})
2024-09-18 00:32:13 -07:00
(pkgs.vimUtils.buildVimPlugin {
name = "cellular-automaton.nvim";
src = inputs.cellular-automaton;
})
];
}