feat: UI overhaul

This commit is contained in:
NotAShelf 2023-02-06 03:55:19 +03:00
parent 202eaaf322
commit 5f861b3ed1
No known key found for this signature in database
GPG Key ID: 5B5C8895F28445F1
6 changed files with 113 additions and 2 deletions

View File

@ -41,6 +41,7 @@
viAlias = true;
vimAlias = true;
};
vim.lsp = {
enable = true;
formatOnSave = true;
@ -61,6 +62,7 @@
formatter = "alejandra";
};
};
vim.visuals = {
enable = true;
nvimWebDevicons.enable = true;
@ -79,20 +81,24 @@
lineTimeout = 0;
};
};
vim.statusline.lualine = {
enable = true;
theme = "catppuccin";
};
vim.theme = {
enable = true;
name = "catppuccin";
style = "mocha";
};
vim.autopairs.enable = true;
vim.autocomplete = {
enable = true;
type = "nvim-cmp";
};
vim.filetree = {
nvimTreeLua = {
enable = true;
@ -101,7 +107,10 @@
};
};
};
vim.tabline.nvimBufferline.enable = true;
vim.tabline = {
nvimBufferline.enable = true;
};
vim.treesitter = {
enable = true;
@ -155,6 +164,10 @@
vim.terminal = {
toggleterm.enable = true;
};
vim.ui = {
noice.enable = true;
};
};
};
@ -547,6 +560,12 @@
flake = false;
};
# UI44444
noice-nvim = {
url = "github:folke/noice.nvim";
flake = false;
};
# Dependencies
plenary-nvim = {
# (required by crates-nvim)
@ -571,5 +590,11 @@
url = "github:godlygeek/tabular";
flake = false;
};
nui-nvim = {
# (required by obsidian-nvim)
url = "github:MunifTanjim/nui.nvim";
flake = false;
};
};
}

View File

@ -60,6 +60,8 @@ with lib; let
"vim-markdown"
"tabular"
"toggleterm-nvim"
"noice-nvim"
"nui-nvim"
];
# You can either use the name of the plugin or a package.
pluginsType = with types; listOf (nullOr (either (enum availablePlugins) package));

View File

@ -28,6 +28,7 @@
./presence
./notes
./terminal
./ui
];
pkgsModule = {config, ...}: {

View File

@ -73,7 +73,18 @@ in {
},
}
}
telescope.load_extension('notify')
${
if config.vim.ui.noice.enable
then "telescope.load_extension('noice')"
else null
}
${
if config.vim.notify.nvim-notify.enable
then "telescope.load_extension('notify')"
else null
}
'';
};
}

5
modules/ui/default.nix Normal file
View File

@ -0,0 +1,5 @@
_: {
imports = [
./noice.nix
];
}

67
modules/ui/noice.nix Normal file
View File

@ -0,0 +1,67 @@
{
pkgs,
config,
lib,
...
}:
with lib;
with builtins; let
cfg = config.vim.ui.noice;
in {
options.vim.ui.noice = {
enable = mkEnableOption "noice-nvim";
};
config = mkIf cfg.enable {
vim.startPlugins = [
"noice-nvim"
"nui-nvim"
];
vim.luaConfigRC.noice-nvim = nvim.dag.entryAnywhere ''
require("noice").setup({
lsp = {
override = {
["vim.lsp.util.convert_input_to_markdown_lines"] = true,
["vim.lsp.util.stylize_markdown"] = true,
["cmp.entry.get_documentation"] = true,
},
signature = {
enabled = false, -- FIXME: enabling this file throws an error which I couldn't figure out
},
},
presets = {
bottom_search = true, -- use a classic bottom cmdline for search
command_palette = true, -- position the cmdline and popupmenu together
long_message_to_split = true, -- long messages will be sent to a split
inc_rename = false, -- enables an input dialog for inc-rename.nvim
lsp_doc_border = false, -- add a border to hover docs and signature help
},
format = {
cmdline = { pattern = "^:", icon = "", lang = "vim" },
search_down = { kind = "search", pattern = "^/", icon = " ", lang = "regex" },
search_up = { kind = "search", pattern = "^%?", icon = " ", lang = "regex" },
filter = { pattern = "^:%s*!", icon = "", lang = "bash" },
lua = { pattern = "^:%s*lua%s+", icon = "", lang = "lua" },
help = { pattern = "^:%s*he?l?p?%s+", icon = "" },
input = {},
},
-- Hide written messages
routes = {
{
filter = {
event = "msg_show",
kind = "",
find = "written",
},
opts = { skip = true },
},
},
})
'';
};
}