update nixvim config
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
programs.nixvim.extraPackages = with pkgs; [
|
||||
stylua
|
||||
nixfmt
|
||||
];
|
||||
|
||||
programs.nixvim.plugins = {
|
||||
conform-nvim = {
|
||||
enable = true;
|
||||
settings = {
|
||||
format_on_save = ''
|
||||
function(bufnr)
|
||||
-- Disable "format_on_save lsp_fallback" for lanuages that don't
|
||||
-- have a well standardized coding style. You can add additional
|
||||
-- lanuages here or re-enable it for the disabled ones.
|
||||
local disable_filetypes = { c = true, cpp = true }
|
||||
if disable_filetypes[vim.bo[bufnr].filetype] then
|
||||
return nil
|
||||
else
|
||||
return {
|
||||
timeout_ms = 500,
|
||||
lsp_format = "fallback",
|
||||
}
|
||||
end
|
||||
end
|
||||
'';
|
||||
formatters_by_ft = {
|
||||
lua = [ "stylua" ];
|
||||
nix = [ "nixfmt" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
imports = [
|
||||
./snacks.nix
|
||||
./conform.nix
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
{
|
||||
programs.nixvim.plugins = {
|
||||
snacks = {
|
||||
enable = true;
|
||||
settings = {
|
||||
bigfile.enabled = true;
|
||||
dashboard = {
|
||||
enabled = true;
|
||||
preset = {
|
||||
keys = [
|
||||
{
|
||||
icon = " ";
|
||||
key = "f";
|
||||
desc = "Find File";
|
||||
action = ":lua Snacks.dashboard.pick('files')";
|
||||
}
|
||||
{
|
||||
icon = " ";
|
||||
key = "n";
|
||||
desc = "New File";
|
||||
action = ":ene | startinsert";
|
||||
}
|
||||
{
|
||||
icon = " ";
|
||||
key = "g";
|
||||
desc = "Find Text";
|
||||
action = ":lua Snacks.dashboard.pick('live_grep')";
|
||||
}
|
||||
{
|
||||
icon = " ";
|
||||
key = "r";
|
||||
desc = "Recent Files";
|
||||
action = ":lua Snacks.dashboard.pick('oldfiles')";
|
||||
}
|
||||
{
|
||||
icon = " ";
|
||||
key = "c";
|
||||
desc = "Config";
|
||||
action = ":lua require('telescope.builtin').find_files({ cwd = '~/nix-config/modules/programs/neovim' })";
|
||||
}
|
||||
{
|
||||
icon = " ";
|
||||
key = "s";
|
||||
desc = "Restore Session";
|
||||
action = ":Telescope persisted";
|
||||
}
|
||||
{
|
||||
icon = " ";
|
||||
key = "q";
|
||||
desc = "Quit";
|
||||
action = ":qa";
|
||||
}
|
||||
];
|
||||
};
|
||||
sections = [
|
||||
{
|
||||
section = "header";
|
||||
gap = 2;
|
||||
}
|
||||
{
|
||||
section = "keys";
|
||||
gap = 1;
|
||||
padding = 1;
|
||||
}
|
||||
];
|
||||
};
|
||||
explorer = {
|
||||
enabled = true;
|
||||
auto_close = true;
|
||||
};
|
||||
indent.enabled = false;
|
||||
input.enabled = true;
|
||||
picker.enabled = true;
|
||||
notifier.enabled = true;
|
||||
quickfile.enabled = true;
|
||||
statuscolumn.enabled = true;
|
||||
words.enabled = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user