Skip to content

Commit

Permalink
set up noice plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
gvolpe committed Mar 31, 2024
1 parent eb528d2 commit 16cb3c7
Show file tree
Hide file tree
Showing 25 changed files with 178 additions and 49 deletions.
34 changes: 34 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,15 @@
url = github:kyazdani42/nvim-web-devicons;
flake = false;
};
noice = {
url = github:folke/noice.nvim;
flake = false;
};
# noice dependency
nui-nvim = {
url = github:MunifTanjim/nui.nvim;
flake = false;
};

# Git
vim-fugitive = {
Expand Down
2 changes: 1 addition & 1 deletion modules/autopairs/config.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ pkgs, config, lib, ... }:
{ lib, ... }:

with lib;

Expand Down
2 changes: 1 addition & 1 deletion modules/autopairs/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ config, lib, pkgs, ... }:
{ ... }:

{
imports = [
Expand Down
12 changes: 6 additions & 6 deletions modules/filetree/nvimtreelua.nix
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,12 @@ in
];

vim.nnoremap = {
"<C-F>" = ":NvimTreeToggle<CR>";
"<C-s>" = ":NvimTreeFindFile<CR>";
"<leader>tr" = ":NvimTreeRefresh<CR>";
"<leader>tp" = ":NvimTreeResize +40<CR>";
"<leader>ts" = ":NvimTreeResize +10<CR>";
"<leader>tx" = ":NvimTreeResize -10<CR>";
"<C-F>" = "<cmd> NvimTreeToggle<CR>";
"<C-s>" = "<cmd> NvimTreeFindFile<CR>";
"<leader>tr" = "<cmd> NvimTreeRefresh<CR>";
"<leader>tp" = "<cmd> NvimTreeResize +40<CR>";
"<leader>ts" = "<cmd> NvimTreeResize +10<CR>";
"<leader>tx" = "<cmd> NvimTreeResize -10<CR>";
};

vim.luaConfigRC = ''
Expand Down
2 changes: 1 addition & 1 deletion modules/git/config.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ pkgs, config, lib, ... }:
{ lib, ... }:

with lib;

Expand Down
2 changes: 1 addition & 1 deletion modules/git/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ pkgs, config, lib, ... }:
{ ... }:

{
imports = [
Expand Down
2 changes: 1 addition & 1 deletion modules/lsp/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ config, lib, pkgs, ... }:
{ ... }:

{
imports = [
Expand Down
2 changes: 1 addition & 1 deletion modules/lsp/nvim-code-action-menu.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ in
];

vim.nnoremap = {
"<silent><leader>ac" = ":CodeActionMenu<CR>";
"<silent><leader>ac" = "<cmd> CodeActionMenu<CR>";
};
};
}
12 changes: 6 additions & 6 deletions modules/lsp/trouble.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ in
vim.startPlugins = with pkgs.neovimPlugins; [ trouble ];

vim.nnoremap = {
"<leader>xx" = "<cmd>TroubleToggle<CR>";
"<leader>lwd" = "<cmd>TroubleToggle workspace_diagnostics<CR>";
"<leader>ld" = "<cmd>TroubleToggle document_diagnostics<CR>";
"<leader>lr" = "<cmd>TroubleToggle lsp_references<CR>";
"<leader>xq" = "<cmd>TroubleToggle quickfix<CR>";
"<leader>xl" = "<cmd>TroubleToggle loclist<CR>";
"<leader>xx" = "<cmd> TroubleToggle<CR>";
"<leader>lwd" = "<cmd> TroubleToggle workspace_diagnostics<CR>";
"<leader>ld" = "<cmd> TroubleToggle document_diagnostics<CR>";
"<leader>lr" = "<cmd> TroubleToggle lsp_references<CR>";
"<leader>xq" = "<cmd> TroubleToggle quickfix<CR>";
"<leader>xl" = "<cmd> TroubleToggle loclist<CR>";
};

vim.luaConfigRC = ''
Expand Down
2 changes: 1 addition & 1 deletion modules/markdown/config.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ pkgs, config, lib, ... }:
{ lib, ... }:

with lib;

Expand Down
2 changes: 1 addition & 1 deletion modules/markdown/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ config, lib, pkgs, ... }:
{ ... }:

{
imports = [
Expand Down
2 changes: 1 addition & 1 deletion modules/neovim/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ config, lib, pkgs, ... }:
{ lib, pkgs, ... }:

with lib;

Expand Down
2 changes: 1 addition & 1 deletion modules/snippets/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ pkgs, lib, config, ... }:
{ ... }:

{
imports = [
Expand Down
2 changes: 1 addition & 1 deletion modules/statusline/config.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ pkgs, config, lib, ... }:
{ lib, ... }:

with lib;

Expand Down
2 changes: 1 addition & 1 deletion modules/statusline/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ pkgs, config, lib, ... }:
{ ... }:

{
imports = [
Expand Down
2 changes: 1 addition & 1 deletion modules/tabline/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ pkgs, config, lib, ... }:
{ ... }:

{
imports = [
Expand Down
32 changes: 16 additions & 16 deletions modules/tabline/nvim-bufferline.nix
Original file line number Diff line number Diff line change
Expand Up @@ -29,23 +29,23 @@ in
];

vim.nnoremap = {
"<silent><leader>bn" = ":BufferLineCycleNext<CR>";
"<silent><leader>bp" = ":BufferLineCyclePrev<CR>";
"<silent><leader>bc" = ":BufferLinePick<CR>";
"<silent><leader>bse" = ":BufferLineSortByExtension<CR>";
"<silent><leader>bsd" = ":BufferLineSortByDirectory<CR>";
"<silent><leader>bn" = "<cmd> BufferLineCycleNext<CR>";
"<silent><leader>bp" = "<cmd> BufferLineCyclePrev<CR>";
"<silent><leader>bc" = "<cmd> BufferLinePick<CR>";
"<silent><leader>bse" = "<cmd> BufferLineSortByExtension<CR>";
"<silent><leader>bsd" = "<cmd> BufferLineSortByDirectory<CR>";
"<silent><leader>bsi" = ":lua require'bufferline'.sort_buffers_by(function (buf_a, buf_b) return buf_a.id < buf_b.id end)<CR>";
"<silent><leader>bmn" = ":BufferLineMoveNext<CR>";
"<silent><leader>bmp" = ":BufferLineMovePrev<CR>";
"<silent><leader>b1" = "<Cmd>BufferLineGoToBuffer 1<CR>";
"<silent><leader>b2" = "<Cmd>BufferLineGoToBuffer 2<CR>";
"<silent><leader>b3" = "<Cmd>BufferLineGoToBuffer 3<CR>";
"<silent><leader>b4" = "<Cmd>BufferLineGoToBuffer 4<CR>";
"<silent><leader>b5" = "<Cmd>BufferLineGoToBuffer 5<CR>";
"<silent><leader>b6" = "<Cmd>BufferLineGoToBuffer 6<CR>";
"<silent><leader>b7" = "<Cmd>BufferLineGoToBuffer 7<CR>";
"<silent><leader>b8" = "<Cmd>BufferLineGoToBuffer 8<CR>";
"<silent><leader>b9" = "<Cmd>BufferLineGoToBuffer 9<CR>";
"<silent><leader>bmn" = "<cmd> BufferLineMoveNext<CR>";
"<silent><leader>bmp" = "<cmd> BufferLineMovePrev<CR>";
"<silent><leader>b1" = "<cmd> BufferLineGoToBuffer 1<CR>";
"<silent><leader>b2" = "<cmd> BufferLineGoToBuffer 2<CR>";
"<silent><leader>b3" = "<cmd> BufferLineGoToBuffer 3<CR>";
"<silent><leader>b4" = "<cmd> BufferLineGoToBuffer 4<CR>";
"<silent><leader>b5" = "<cmd> BufferLineGoToBuffer 5<CR>";
"<silent><leader>b6" = "<cmd> BufferLineGoToBuffer 6<CR>";
"<silent><leader>b7" = "<cmd> BufferLineGoToBuffer 7<CR>";
"<silent><leader>b8" = "<cmd> BufferLineGoToBuffer 8<CR>";
"<silent><leader>b9" = "<cmd> BufferLineGoToBuffer 9<CR>";
};

vim.luaConfigRC = ''
Expand Down
2 changes: 1 addition & 1 deletion modules/theme/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ pkgs, config, lib, ... }:
{ ... }:

{
imports = [ ./theme.nix ];
Expand Down
2 changes: 1 addition & 1 deletion modules/todo/config.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ pkgs, config, lib, ... }:
{ lib, ... }:

with lib;

Expand Down
2 changes: 1 addition & 1 deletion modules/todo/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ config, lib, pkgs, ... }:
{ ... }:

{
imports = [
Expand Down
6 changes: 3 additions & 3 deletions modules/todo/todo-comments.nix
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ in
vim.startPlugins = [ pkgs.neovimPlugins.todo-comments ];

vim.nnoremap = {
"<leader>tdq" = ":TodoQuickFix<CR>";
"<leader>tds" = ":TodoTelescope<CR>";
"<leader>tdt" = ":TodoTrouble<CR>";
"<leader>tdq" = "<cmd> TodoQuickFix<CR>";
"<leader>tds" = "<cmd> TodoTelescope<CR>";
"<leader>tdt" = "<cmd> TodoTrouble<CR>";
};

vim.luaConfigRC = ''
Expand Down
3 changes: 2 additions & 1 deletion modules/visuals/config.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ pkgs, config, lib, ... }:
{ lib, ... }:

with lib;

Expand All @@ -7,6 +7,7 @@ with lib;
vim.visuals = {
enable = mkDefault false;

noice.enable = mkDefault true;
nvimWebDevicons.enable = mkDefault false;
lspkind.enable = mkDefault false;

Expand Down
2 changes: 1 addition & 1 deletion modules/visuals/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ pkgs, config, lib, ... }:
{ ... }:

{
imports = [
Expand Down
85 changes: 85 additions & 0 deletions modules/visuals/visuals.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ in
description = "visual enhancements";
};

noice.enable = mkOption {
type = types.bool;
description = "enable the noice plugin";
};

nvimWebDevicons.enable = mkOption {
type = types.bool;
description = "enable dev icons. required for certain plugins [nvim-web-devicons]";
Expand Down Expand Up @@ -66,6 +71,7 @@ in
config = mkIf cfg.enable
{
vim.startPlugins = with pkgs.neovimPlugins; (
(withPlugins cfg.noice.enable [ noice nui-nvim ]) ++
(withPlugins cfg.nvimWebDevicons.enable [ nvim-web-devicons ]) ++
(withPlugins cfg.lspkind.enable [ lspkind ]) ++
(withPlugins cfg.cursorWordline.enable [ nvim-cursorline ]) ++
Expand Down Expand Up @@ -105,6 +111,85 @@ in
vim.g.cursorline_timeout = ${toString cfg.cursorWordline.lineTimeout}
''
}
${writeIf cfg.noice.enable ''
require("noice").setup({
cmdline = {
enabled = true, -- enables the Noice cmdline UI
view = "cmdline_popup", -- view for rendering the cmdline. Change to `cmdline` to get a classic cmdline at the bottom
opts = {}, -- global options for the cmdline. See section on views
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+", "^:%s*lua%s*=%s*", "^:%s*=%s*" }, icon = "", lang = "lua" },
help = { pattern = "^:%s*he?l?p?%s+", icon = "" },
input = {}, -- Used by input()
},
},
messages = {
enabled = false, -- enables the Noice messages UI
view = "notify", -- default view for messages
view_error = "notify", -- view for errors
view_warn = "notify", -- view for warnings
view_history = "messages", -- view for :messages
view_search = "virtualtext", -- view for search count messages. Set to `false` to disable
},
popupmenu = {
enabled = true, -- enables the Noice popupmenu UI
backend = "nui", -- backend to use to show regular cmdline completions
kind_icons = {}, -- set to `false` to disable icons
},
lsp = {
progress = {
enabled = true,
format = "lsp_progress",
format_done = "lsp_progress_done",
throttle = 1000 / 30, -- frequency to update lsp progress message
view = "mini",
},
override = {
["vim.lsp.util.convert_input_to_markdown_lines"] = false,
["vim.lsp.util.stylize_markdown"] = false,
["cmp.entry.get_documentation"] = false,
},
hover = {
enabled = true,
silent = false, -- set to true to not show a message if hover is not available
view = nil, -- when nil, use defaults from documentation
opts = {}, -- merged with defaults from documentation
},
signature = {
enabled = true,
auto_open = {
enabled = true,
trigger = true, -- Automatically show signature help when typing a trigger character from the LSP
luasnip = true, -- Will open signature help when jumping to Luasnip insert nodes
throttle = 50, -- Debounce lsp signature help request by 50ms
},
view = nil, -- when nil, use defaults from documentation
opts = {}, -- merged with defaults from documentation
},
message = {
enabled = true,
view = "notify",
opts = {},
},
documentation = {
view = "hover",
opts = {
lang = "markdown",
replace = true,
render = "plain",
format = { "{message}" },
win_options = { concealcursor = "n", conceallevel = 3 },
},
},
},
})
''
}
'';
};
}

0 comments on commit 16cb3c7

Please sign in to comment.