mirror of
https://github.com/NotAShelf/neovim-flake.git
synced 2024-11-07 12:45:57 +01:00
Compare commits
1 commit
d3ef353557
...
48bc045cfa
Author | SHA1 | Date | |
---|---|---|---|
|
48bc045cfa |
12 changed files with 153 additions and 491 deletions
|
@ -222,10 +222,10 @@ inputs: let
|
||||||
enable = true;
|
enable = true;
|
||||||
setupOpts.custom_colorcolumn = {
|
setupOpts.custom_colorcolumn = {
|
||||||
# this is a freeform module, it's `buftype = int;` for configuring column position
|
# this is a freeform module, it's `buftype = int;` for configuring column position
|
||||||
nix = "110";
|
nix = 110;
|
||||||
ruby = "120";
|
ruby = 120;
|
||||||
java = "130";
|
java = 130;
|
||||||
go = ["90" "130"];
|
go = [90 130];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -12,24 +12,18 @@ Release notes for release 0.7
|
||||||
[frothymarrow](https://github.com/frothymarrow):
|
[frothymarrow](https://github.com/frothymarrow):
|
||||||
|
|
||||||
- Modified type for
|
- Modified type for
|
||||||
[vim.visuals.fidget-nvim.setupOpts.progress.display.overrides](#opt-vim.visuals.fidget-nvim.setupOpts.progress.display.overrides)
|
[](#opt-vim.visuals.fidget-nvim.setupOpts.progress.display.overrides) from
|
||||||
from `anything` to a `submodule` for better type checking.
|
`anything` to a `submodule` for better type checking.
|
||||||
|
|
||||||
- Fix null `vim.lsp.mappings` generating an error and not being filtered out.
|
- Fix null `vim.lsp.mappings` generating an error and not being filtered out.
|
||||||
|
|
||||||
- Add basic transparency support for `oxocarbon` theme by setting the highlight
|
- Add basic transparency support for `oxocarbon` theme by setting the highlight
|
||||||
group for `Normal`, `NormalFloat`, `LineNr`, `SignColumn` and optionally
|
group for `Normal`, `NormalFloat`, `LineNr`, `SignColumn` and optionally
|
||||||
`NvimTreeNormal` to `none`.
|
`NvimTreeNormal` to `none`.
|
||||||
|
|
||||||
- Fix [vim.ui.smartcolumn.setupOpts.custom_colorcolumn](#opt-vim.ui.smartcolumn.setupOpts.custom_colorcolumn)
|
|
||||||
using the wrong type `int` instead of the expected type `string`.
|
|
||||||
|
|
||||||
[horriblename](https://github.com/horriblename):
|
[horriblename](https://github.com/horriblename):
|
||||||
|
|
||||||
- Fix broken treesitter-context keybinds in visual mode
|
- Fix broken treesitter-context keybinds in visual mode
|
||||||
- Deprecate use of `__empty` to define empty tables in lua. Empty attrset are no
|
- Deprecate use of `__empty` to define empty tables in lua. Empty attrset are no
|
||||||
longer filtered and thus should be used instead.
|
longer filtered and thus should be used instead.
|
||||||
- Add dap-go for better dap configurations
|
|
||||||
|
|
||||||
[jacekpoz](https://github.com/jacekpoz):
|
[jacekpoz](https://github.com/jacekpoz):
|
||||||
|
|
||||||
|
@ -41,13 +35,9 @@ Release notes for release 0.7
|
||||||
|
|
||||||
- Move the `theme` dag entry to before `luaScript`.
|
- Move the `theme` dag entry to before `luaScript`.
|
||||||
|
|
||||||
- Add rustfmt as the default formatter for Rust.
|
- Add rustfmt as the default formatter for Rust
|
||||||
|
|
||||||
- Enabled the terminal integration of catppuccin for theming Neovim's built-in terminal (this also affects toggleterm).
|
[NotAShelf](https://github.com/notashelf)
|
||||||
|
|
||||||
- Migrate bufferline to setupOpts for more customizability
|
|
||||||
|
|
||||||
[NotAShelf](https://github.com/notashelf):
|
|
||||||
|
|
||||||
- Add `deno fmt` as the default Markdown formatter. This will be enabled
|
- Add `deno fmt` as the default Markdown formatter. This will be enabled
|
||||||
automatically if you have autoformatting enabled, but can be disabled manually
|
automatically if you have autoformatting enabled, but can be disabled manually
|
||||||
|
|
17
flake.lock
17
flake.lock
|
@ -1089,22 +1089,6 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"plugin-nvim-dap-go": {
|
|
||||||
"flake": false,
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1716775637,
|
|
||||||
"narHash": "sha256-B8A+ven18YgePLxAN3Q/j5NFb0FeTHCQak1uzaNDX9c=",
|
|
||||||
"owner": "leoluz",
|
|
||||||
"repo": "nvim-dap-go",
|
|
||||||
"rev": "a0c5a2b991d7e9304a9a032cf177e22a4b0acda1",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "leoluz",
|
|
||||||
"repo": "nvim-dap-go",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"plugin-nvim-dap-ui": {
|
"plugin-nvim-dap-ui": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
|
@ -1860,7 +1844,6 @@
|
||||||
"plugin-nvim-colorizer-lua": "plugin-nvim-colorizer-lua",
|
"plugin-nvim-colorizer-lua": "plugin-nvim-colorizer-lua",
|
||||||
"plugin-nvim-cursorline": "plugin-nvim-cursorline",
|
"plugin-nvim-cursorline": "plugin-nvim-cursorline",
|
||||||
"plugin-nvim-dap": "plugin-nvim-dap",
|
"plugin-nvim-dap": "plugin-nvim-dap",
|
||||||
"plugin-nvim-dap-go": "plugin-nvim-dap-go",
|
|
||||||
"plugin-nvim-dap-ui": "plugin-nvim-dap-ui",
|
"plugin-nvim-dap-ui": "plugin-nvim-dap-ui",
|
||||||
"plugin-nvim-docs-view": "plugin-nvim-docs-view",
|
"plugin-nvim-docs-view": "plugin-nvim-docs-view",
|
||||||
"plugin-nvim-lightbulb": "plugin-nvim-lightbulb",
|
"plugin-nvim-lightbulb": "plugin-nvim-lightbulb",
|
||||||
|
|
|
@ -224,11 +224,6 @@
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
plugin-nvim-dap-go = {
|
|
||||||
url = "github:leoluz/nvim-dap-go";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
# Filetrees
|
# Filetrees
|
||||||
plugin-nvim-tree-lua = {
|
plugin-nvim-tree-lua = {
|
||||||
url = "github:nvim-tree/nvim-tree.lua";
|
url = "github:nvim-tree/nvim-tree.lua";
|
||||||
|
|
|
@ -4,8 +4,9 @@
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (lib.modules) mkIf;
|
inherit (lib.modules) mkIf;
|
||||||
inherit (lib.trivial) boolToString;
|
inherit (lib.strings) optionalString;
|
||||||
inherit (lib.nvim.dag) entryAnywhere;
|
inherit (lib.nvim.dag) entryAnywhere;
|
||||||
|
inherit (lib.nvim.lua) toLuaObject;
|
||||||
|
|
||||||
cfg = config.vim.autopairs;
|
cfg = config.vim.autopairs;
|
||||||
in {
|
in {
|
||||||
|
@ -13,7 +14,7 @@ in {
|
||||||
vim.startPlugins = ["nvim-autopairs"];
|
vim.startPlugins = ["nvim-autopairs"];
|
||||||
|
|
||||||
vim.luaConfigRC.autopairs = entryAnywhere ''
|
vim.luaConfigRC.autopairs = entryAnywhere ''
|
||||||
require("nvim-autopairs").setup({ map_cr = ${boolToString (!config.vim.autocomplete.enable)} })
|
require("nvim-autopairs").setup{}
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,16 +61,12 @@ in {
|
||||||
(mkSetLuaBinding mappings.complete ''
|
(mkSetLuaBinding mappings.complete ''
|
||||||
require('cmp').complete
|
require('cmp').complete
|
||||||
'')
|
'')
|
||||||
(let
|
(mkSetLuaBinding mappings.confirm ''
|
||||||
defaultKeys =
|
|
||||||
if config.vim.autopairs.enable
|
|
||||||
then "require('nvim-autopairs').autopairs_cr()"
|
|
||||||
else "vim.api.nvim_replace_termcodes(${toJSON mappings.confirm.value}, true, false, true)";
|
|
||||||
in
|
|
||||||
mkSetLuaBinding mappings.confirm ''
|
|
||||||
function()
|
function()
|
||||||
if not require('cmp').confirm({ select = true }) then
|
if not require('cmp').confirm({ select = true }) then
|
||||||
vim.fn.feedkeys(${defaultKeys}, 'n')
|
local termcode = vim.api.nvim_replace_termcodes(${toJSON mappings.confirm.value}, true, false, true)
|
||||||
|
|
||||||
|
vim.fn.feedkeys(termcode, 'n')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
'')
|
'')
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
clangd = {
|
clangd = {
|
||||||
package = pkgs.clang-tools;
|
package = pkgs.clang-tools_16;
|
||||||
lspConfig = ''
|
lspConfig = ''
|
||||||
local clangd_cap = capabilities
|
local clangd_cap = capabilities
|
||||||
-- use same offsetEncoding as null-ls
|
-- use same offsetEncoding as null-ls
|
||||||
|
|
|
@ -12,7 +12,6 @@
|
||||||
inherit (lib.types) bool enum either listOf package str;
|
inherit (lib.types) bool enum either listOf package str;
|
||||||
inherit (lib.nvim.types) mkGrammarOption;
|
inherit (lib.nvim.types) mkGrammarOption;
|
||||||
inherit (lib.nvim.lua) expToLua;
|
inherit (lib.nvim.lua) expToLua;
|
||||||
inherit (lib.nvim.dag) entryAfter;
|
|
||||||
|
|
||||||
cfg = config.vim.languages.go;
|
cfg = config.vim.languages.go;
|
||||||
|
|
||||||
|
@ -38,6 +37,40 @@
|
||||||
debuggers = {
|
debuggers = {
|
||||||
delve = {
|
delve = {
|
||||||
package = pkgs.delve;
|
package = pkgs.delve;
|
||||||
|
dapConfig = ''
|
||||||
|
dap.adapters.delve = {
|
||||||
|
type = "server",
|
||||||
|
port = "''${port}",
|
||||||
|
executable = {
|
||||||
|
command = "${getExe cfg.dap.package}",
|
||||||
|
args = { "dap", "-l", "127.0.0.1:''${port}" },
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
dap.configurations.go = {
|
||||||
|
{
|
||||||
|
type = "delve",
|
||||||
|
name = "Debug",
|
||||||
|
request = "launch",
|
||||||
|
program = "''${file}",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type = "delve",
|
||||||
|
name = "Debug test", -- configuration for debugging test files
|
||||||
|
request = "launch",
|
||||||
|
mode = "test",
|
||||||
|
program = "''${file}",
|
||||||
|
},
|
||||||
|
-- works with go.mod packages and sub packages
|
||||||
|
{
|
||||||
|
type = "delve",
|
||||||
|
name = "Debug test (go.mod)",
|
||||||
|
request = "launch",
|
||||||
|
mode = "test",
|
||||||
|
program = "./''${relativeFileDirname}",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
|
@ -69,17 +102,15 @@ in {
|
||||||
|
|
||||||
dap = {
|
dap = {
|
||||||
enable = mkOption {
|
enable = mkOption {
|
||||||
description = "Enable Go Debug Adapter via nvim-dap-go plugin";
|
description = "Enable Go Debug Adapter";
|
||||||
type = bool;
|
type = bool;
|
||||||
default = config.vim.languages.enableDAP;
|
default = config.vim.languages.enableDAP;
|
||||||
};
|
};
|
||||||
|
|
||||||
debugger = mkOption {
|
debugger = mkOption {
|
||||||
description = "Go debugger to use";
|
description = "Go debugger to use";
|
||||||
type = enum (attrNames debuggers);
|
type = enum (attrNames debuggers);
|
||||||
default = defaultDebugger;
|
default = defaultDebugger;
|
||||||
};
|
};
|
||||||
|
|
||||||
package = mkOption {
|
package = mkOption {
|
||||||
description = "Go debugger package.";
|
description = "Go debugger package.";
|
||||||
type = package;
|
type = package;
|
||||||
|
@ -100,17 +131,8 @@ in {
|
||||||
})
|
})
|
||||||
|
|
||||||
(mkIf cfg.dap.enable {
|
(mkIf cfg.dap.enable {
|
||||||
vim = {
|
vim.debugger.nvim-dap.enable = true;
|
||||||
startPlugins = ["nvim-dap-go"];
|
vim.debugger.nvim-dap.sources.go-debugger = debuggers.${cfg.dap.debugger}.dapConfig;
|
||||||
luaConfigRC.nvim-dap-go = entryAfter ["nvim-dap"] ''
|
|
||||||
require('dap-go').setup {
|
|
||||||
delve = {
|
|
||||||
path = '${getExe cfg.dap.package}',
|
|
||||||
}
|
|
||||||
}
|
|
||||||
'';
|
|
||||||
debugger.nvim-dap.enable = true;
|
|
||||||
};
|
|
||||||
})
|
})
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,13 +6,23 @@
|
||||||
inherit (lib.modules) mkIf mkMerge;
|
inherit (lib.modules) mkIf mkMerge;
|
||||||
inherit (lib.nvim.binds) mkLuaBinding mkBinding pushDownDefault;
|
inherit (lib.nvim.binds) mkLuaBinding mkBinding pushDownDefault;
|
||||||
inherit (lib.nvim.dag) entryAnywhere;
|
inherit (lib.nvim.dag) entryAnywhere;
|
||||||
inherit (lib.nvim.lua) toLuaObject;
|
|
||||||
|
|
||||||
cfg = config.vim.tabline.nvimBufferline;
|
cfg = config.vim.tabline.nvimBufferline;
|
||||||
|
|
||||||
self = import ./nvim-bufferline.nix {inherit lib;};
|
self = import ./nvim-bufferline.nix {inherit lib;};
|
||||||
inherit (self.options.vim.tabline.nvimBufferline) mappings;
|
inherit (self.options.vim.tabline.nvimBufferline) mappings;
|
||||||
in {
|
in {
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable (
|
||||||
|
let
|
||||||
|
mouse = {
|
||||||
|
right = "'vertical sbuffer %d'";
|
||||||
|
close = ''
|
||||||
|
function(bufnum)
|
||||||
|
require("bufdelete").bufdelete(bufnum, false)
|
||||||
|
end
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
in {
|
||||||
vim = {
|
vim = {
|
||||||
startPlugins = [
|
startPlugins = [
|
||||||
(assert config.vim.visuals.nvimWebDevicons.enable; "nvim-bufferline-lua")
|
(assert config.vim.visuals.nvimWebDevicons.enable; "nvim-bufferline-lua")
|
||||||
|
@ -40,8 +50,57 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
luaConfigRC.nvimBufferline = entryAnywhere ''
|
luaConfigRC.nvimBufferline = entryAnywhere ''
|
||||||
require("bufferline").setup(${toLuaObject cfg.setupOpts})
|
require("bufferline").setup{
|
||||||
|
options = {
|
||||||
|
mode = "buffers",
|
||||||
|
numbers = "both",
|
||||||
|
close_command = ${mouse.close},
|
||||||
|
right_mouse_command = ${mouse.right},
|
||||||
|
indicator = {
|
||||||
|
style = 'icon',
|
||||||
|
indicator_icon = '▎',
|
||||||
|
},
|
||||||
|
buffer_close_icon = '',
|
||||||
|
modified_icon = '●',
|
||||||
|
close_icon = '',
|
||||||
|
left_trunc_marker = '',
|
||||||
|
right_trunc_marker = '',
|
||||||
|
max_name_length = 18,
|
||||||
|
max_prefix_length = 15,
|
||||||
|
tab_size = 18,
|
||||||
|
show_buffer_icons = true,
|
||||||
|
show_buffer_close_icons = true,
|
||||||
|
show_close_icon = true,
|
||||||
|
show_tab_indicators = true,
|
||||||
|
persist_buffer_sort = true,
|
||||||
|
--separator_style = "thin",
|
||||||
|
separator_style = { " ", " " },
|
||||||
|
enforce_regular_tabs = true,
|
||||||
|
always_show_bufferline = true,
|
||||||
|
offsets = {
|
||||||
|
{filetype = "NvimTree", text = "File Explorer", text_align = "center"}
|
||||||
|
},
|
||||||
|
sort_by = 'extension',
|
||||||
|
diagnostics = "nvim_lsp", -- TODO: use coc if it's enabled
|
||||||
|
diagnostics_update_in_insert = true,
|
||||||
|
diagnostics_indicator = function(count, level, diagnostics_dict, context)
|
||||||
|
local s = ""
|
||||||
|
for e, n in pairs(diagnostics_dict) do
|
||||||
|
local sym = e == "error" and ""
|
||||||
|
or (e == "warning" and "" or "" )
|
||||||
|
if(sym ~= "") then
|
||||||
|
s = s .. " " .. n .. sym
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return s
|
||||||
|
end,
|
||||||
|
numbers = function(opts)
|
||||||
|
return string.format('%s·%s', opts.raise(opts.id), opts.lower(opts.ordinal))
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
}
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,6 @@
|
||||||
{lib, ...}: let
|
{lib, ...}: let
|
||||||
inherit (lib.options) mkOption mkEnableOption literalExpression;
|
inherit (lib.options) mkEnableOption;
|
||||||
inherit (lib.types) enum bool either nullOr str int listOf attrs;
|
|
||||||
inherit (lib.generators) mkLuaInline;
|
|
||||||
inherit (lib.nvim.binds) mkMappingOption;
|
inherit (lib.nvim.binds) mkMappingOption;
|
||||||
inherit (lib.nvim.types) mkPluginSetupOption luaInline;
|
|
||||||
in {
|
in {
|
||||||
options.vim.tabline.nvimBufferline = {
|
options.vim.tabline.nvimBufferline = {
|
||||||
enable = mkEnableOption "neovim bufferline";
|
enable = mkEnableOption "neovim bufferline";
|
||||||
|
@ -19,385 +16,5 @@ in {
|
||||||
moveNext = mkMappingOption "Move next buffer" "<leader>bmn";
|
moveNext = mkMappingOption "Move next buffer" "<leader>bmn";
|
||||||
movePrevious = mkMappingOption "Move previous buffer" "<leader>bmp";
|
movePrevious = mkMappingOption "Move previous buffer" "<leader>bmp";
|
||||||
};
|
};
|
||||||
|
|
||||||
setupOpts = mkPluginSetupOption "Bufferline-nvim" {
|
|
||||||
highlights = mkOption {
|
|
||||||
type = either attrs luaInline;
|
|
||||||
default = {};
|
|
||||||
description = ''
|
|
||||||
Overrides the highlight groups of bufferline.
|
|
||||||
|
|
||||||
See `:help bufferline-highlights`.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
options = {
|
|
||||||
mode = mkOption {
|
|
||||||
type = enum ["tabs" "buffers"];
|
|
||||||
default = "buffers";
|
|
||||||
description = "Mode to use for bufferline";
|
|
||||||
};
|
|
||||||
|
|
||||||
style_preset = mkOption {
|
|
||||||
type = enum ["default" "minimal" "no_bold" "no_italic"];
|
|
||||||
default = "default";
|
|
||||||
apply = value: mkLuaInline "require('bufferline').style_preset.${value}";
|
|
||||||
description = "The base style of bufferline";
|
|
||||||
};
|
|
||||||
|
|
||||||
themable = mkOption {
|
|
||||||
type = bool;
|
|
||||||
default = true;
|
|
||||||
description = ''
|
|
||||||
Whether or not to allow highlight groups to be overriden.
|
|
||||||
|
|
||||||
While false, bufferline.nvim sets highlights as default.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
numbers = mkOption {
|
|
||||||
type = either (enum ["none" "ordinal" "buffer_id" "both"]) luaInline;
|
|
||||||
default = mkLuaInline ''
|
|
||||||
function(opts)
|
|
||||||
return string.format('%s·%s', opts.raise(opts.id), opts.lower(opts.ordinal))
|
|
||||||
end
|
|
||||||
'';
|
|
||||||
description = "Whether or not to show buffer numbers";
|
|
||||||
};
|
|
||||||
|
|
||||||
close_command = mkOption {
|
|
||||||
type = either str luaInline;
|
|
||||||
default = mkLuaInline ''
|
|
||||||
function(bufnum)
|
|
||||||
require("bufdelete").bufdelete(bufnum, false)
|
|
||||||
end
|
|
||||||
'';
|
|
||||||
description = "Command to run when closing a buffer";
|
|
||||||
};
|
|
||||||
|
|
||||||
right_mouse_command = mkOption {
|
|
||||||
type = nullOr (either str luaInline);
|
|
||||||
default = "vertical sbuffer %d";
|
|
||||||
description = "Command to run when right clicking a buffer";
|
|
||||||
};
|
|
||||||
|
|
||||||
left_mouse_command = mkOption {
|
|
||||||
type = nullOr (either str luaInline);
|
|
||||||
default = "buffer %d";
|
|
||||||
description = "Command to run when left clicking a buffer";
|
|
||||||
};
|
|
||||||
|
|
||||||
middle_mouse_command = mkOption {
|
|
||||||
type = nullOr (either str luaInline);
|
|
||||||
default = null;
|
|
||||||
description = "Command to run when middle clicking a buffer";
|
|
||||||
};
|
|
||||||
|
|
||||||
indicator = {
|
|
||||||
icon = mkOption {
|
|
||||||
type = nullOr str;
|
|
||||||
default = null;
|
|
||||||
description = ''
|
|
||||||
The indicatotor icon to use for the current buffer.
|
|
||||||
|
|
||||||
::: {.warning}
|
|
||||||
This **must** be ommitted while style is not `icon`
|
|
||||||
:::
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
style = mkOption {
|
|
||||||
type = enum ["icon" "underline" "none"];
|
|
||||||
default = "underline";
|
|
||||||
description = "Style for indicator";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
buffer_close_icon = mkOption {
|
|
||||||
type = str;
|
|
||||||
default = " ";
|
|
||||||
description = "Icon for close button";
|
|
||||||
};
|
|
||||||
|
|
||||||
modified_icon = mkOption {
|
|
||||||
type = str;
|
|
||||||
default = "● ";
|
|
||||||
description = "Icon for modified buffer";
|
|
||||||
};
|
|
||||||
|
|
||||||
close_icon = mkOption {
|
|
||||||
type = str;
|
|
||||||
default = " ";
|
|
||||||
description = "Icon for close button";
|
|
||||||
};
|
|
||||||
|
|
||||||
left_trunc_marker = mkOption {
|
|
||||||
type = str;
|
|
||||||
default = "";
|
|
||||||
description = "Icon for left truncation";
|
|
||||||
};
|
|
||||||
|
|
||||||
right_trunc_marker = mkOption {
|
|
||||||
type = str;
|
|
||||||
default = "";
|
|
||||||
description = "Icon for right truncation";
|
|
||||||
};
|
|
||||||
|
|
||||||
name_formatter = mkOption {
|
|
||||||
type = nullOr luaInline;
|
|
||||||
default = null;
|
|
||||||
description = ''
|
|
||||||
`name_formatter` can be used to change the buffer's label in the
|
|
||||||
bufferline.
|
|
||||||
|
|
||||||
::: {.note}
|
|
||||||
Some names can/will break the bufferline so use this at your
|
|
||||||
discretion knowing that it has some limitations that will
|
|
||||||
**NOT** be fixed.
|
|
||||||
:::
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
max_name_length = mkOption {
|
|
||||||
type = int;
|
|
||||||
default = 18;
|
|
||||||
description = "Max name length";
|
|
||||||
};
|
|
||||||
|
|
||||||
max_prefix_length = mkOption {
|
|
||||||
type = int;
|
|
||||||
default = 15;
|
|
||||||
description = "Length of the prefix used when a buffer is de-duplicated";
|
|
||||||
};
|
|
||||||
|
|
||||||
truncate_names = mkOption {
|
|
||||||
type = bool;
|
|
||||||
default = true;
|
|
||||||
description = "Truncate names";
|
|
||||||
};
|
|
||||||
|
|
||||||
tab_size = mkOption {
|
|
||||||
type = int;
|
|
||||||
default = 18;
|
|
||||||
description = "The size of the tabs in bufferline";
|
|
||||||
};
|
|
||||||
|
|
||||||
diagnostics = mkOption {
|
|
||||||
type = enum [false "nvim_lsp" "coc"];
|
|
||||||
default = "nvim_lsp";
|
|
||||||
description = "Diagnostics provider to be used in buffer LSP indicators";
|
|
||||||
};
|
|
||||||
|
|
||||||
diagnostics_update_in_insert = mkOption {
|
|
||||||
type = bool;
|
|
||||||
default = false;
|
|
||||||
description = ''
|
|
||||||
Whether to update diagnostics while in insert mode.
|
|
||||||
|
|
||||||
Setting this to true has performance implications, but they may be
|
|
||||||
negligible depending on your setup. Set it to true if you know what
|
|
||||||
you are doing.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
diagnostics_indicator = mkOption {
|
|
||||||
type = nullOr luaInline;
|
|
||||||
default = mkLuaInline ''
|
|
||||||
function(count, level, diagnostics_dict, context)
|
|
||||||
local s = " "
|
|
||||||
for e, n in pairs(diagnostics_dict) do
|
|
||||||
local sym = e == "error" and " "
|
|
||||||
or (e == "warning" and " " or " " )
|
|
||||||
s = s .. n .. sym
|
|
||||||
end
|
|
||||||
return s
|
|
||||||
end
|
|
||||||
'';
|
|
||||||
|
|
||||||
description = ''
|
|
||||||
Function to get the diagnostics indicator.
|
|
||||||
The function should return a string to be used as the indicator.
|
|
||||||
|
|
||||||
Can be set to nil to keep the buffer name highlight, but delete the
|
|
||||||
highlighting.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
custom_filter = mkOption {
|
|
||||||
type = nullOr luaInline;
|
|
||||||
default = null;
|
|
||||||
example = literalExpression ''
|
|
||||||
custom_filter = function(buf_number, buf_numbers)
|
|
||||||
-- filter out filetypes you don't want to see
|
|
||||||
if vim.bo[buf_number].filetype ~= "<i-dont-want-to-see-this>" then
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
-- filter out by buffer name
|
|
||||||
if vim.fn.bufname(buf_number) ~= "<buffer-name-I-dont-want>" then
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
-- filter out based on arbitrary rules
|
|
||||||
-- e.g. filter out vim wiki buffer from tabline in your work repo
|
|
||||||
if vim.fn.getcwd() == "<work-repo>" and vim.bo[buf_number].filetype ~= "wiki" then
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
-- filter out by it's index number in list (don't show first buffer)
|
|
||||||
if buf_numbers[1] ~= buf_number then
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
end
|
|
||||||
'';
|
|
||||||
|
|
||||||
description = ''
|
|
||||||
Custom filter function for filtering out buffers.
|
|
||||||
|
|
||||||
::: {.note}
|
|
||||||
This will be called a lot, so you are encouraged to keep it as
|
|
||||||
short and lightweight as possible unless you are fully aware
|
|
||||||
of the performance implications.
|
|
||||||
:::
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
offsets = mkOption {
|
|
||||||
type = listOf attrs;
|
|
||||||
default = [
|
|
||||||
{
|
|
||||||
filetype = "NvimTree";
|
|
||||||
text = "File Explorer";
|
|
||||||
highlight = "Directory";
|
|
||||||
separator = true;
|
|
||||||
}
|
|
||||||
];
|
|
||||||
description = "The windows to offset bufferline above, see `:help bufferline-offset`";
|
|
||||||
};
|
|
||||||
|
|
||||||
color_icons = mkOption {
|
|
||||||
type = bool;
|
|
||||||
default = true;
|
|
||||||
description = "Whether or not to add filetype icon highlights";
|
|
||||||
};
|
|
||||||
|
|
||||||
get_element_icon = mkOption {
|
|
||||||
type = nullOr luaInline;
|
|
||||||
default = null;
|
|
||||||
example = literalExpression ''
|
|
||||||
function(element)
|
|
||||||
local custom_map = {my_thing_ft: {icon = "my_thing_icon", hl = "DevIconDefault"}}
|
|
||||||
return custom_map[element.filetype]
|
|
||||||
end
|
|
||||||
'';
|
|
||||||
description = "The function bufferline uses to get the icon. Recommended to leave as default.";
|
|
||||||
};
|
|
||||||
|
|
||||||
show_buffer_icons = mkOption {
|
|
||||||
type = bool;
|
|
||||||
default = true;
|
|
||||||
description = "Whether or not to show buffer icons";
|
|
||||||
};
|
|
||||||
|
|
||||||
show_buffer_close_icons = mkOption {
|
|
||||||
type = bool;
|
|
||||||
default = true;
|
|
||||||
description = "Whether or not to show buffer close icons";
|
|
||||||
};
|
|
||||||
|
|
||||||
show_close_icon = mkOption {
|
|
||||||
type = bool;
|
|
||||||
default = true;
|
|
||||||
description = "Whether or not to show the close icon";
|
|
||||||
};
|
|
||||||
|
|
||||||
show_tab_indicators = mkOption {
|
|
||||||
type = bool;
|
|
||||||
default = true;
|
|
||||||
description = "Whether or not to show tab indicators";
|
|
||||||
};
|
|
||||||
|
|
||||||
show_duplicate_prefix = mkOption {
|
|
||||||
type = bool;
|
|
||||||
default = true;
|
|
||||||
description = "Whether or not to show duplicate buffer prefixes";
|
|
||||||
};
|
|
||||||
|
|
||||||
duplicates_across_groups = mkOption {
|
|
||||||
type = bool;
|
|
||||||
default = true;
|
|
||||||
description = "Whether to consider duplicate paths in different groups as duplicates";
|
|
||||||
};
|
|
||||||
|
|
||||||
persist_buffer_sort = mkOption {
|
|
||||||
type = bool;
|
|
||||||
default = true;
|
|
||||||
description = "Whether or not custom sorted buffers should persist";
|
|
||||||
};
|
|
||||||
|
|
||||||
move_wraps_at_ends = mkOption {
|
|
||||||
type = bool;
|
|
||||||
default = false;
|
|
||||||
description = "Whether or not the move command \"wraps\" at the first or last position";
|
|
||||||
};
|
|
||||||
|
|
||||||
seperator_style = mkOption {
|
|
||||||
type = either (enum ["thick" "thin" "slope" "slant"]) (listOf str);
|
|
||||||
default = [" " " "];
|
|
||||||
description = ''
|
|
||||||
Style of the buffer separator.
|
|
||||||
|
|
||||||
Can be either one of the suspported values, or a list containing
|
|
||||||
**at most** two elements for `focused` and `unfocused` respectively.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
separator_style = mkOption {
|
|
||||||
type = nullOr (either (enum ["slant" "padded_slant" "slope" "padded_slope" "thick" "thin"]) (listOf str));
|
|
||||||
default = "thin";
|
|
||||||
description = ''
|
|
||||||
The type of separator used to separate buffers and tabs.
|
|
||||||
|
|
||||||
Either one of the listed types, or a list of 2 characters for either side.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
enforce_regular_tabs = mkOption {
|
|
||||||
type = bool;
|
|
||||||
default = false;
|
|
||||||
description = "Whether to enforce regular tabs";
|
|
||||||
};
|
|
||||||
|
|
||||||
always_show_bufferline = mkOption {
|
|
||||||
type = bool;
|
|
||||||
default = true;
|
|
||||||
description = "Whether to always show bufferline";
|
|
||||||
};
|
|
||||||
|
|
||||||
auto_toggle_bufferline = mkOption {
|
|
||||||
type = bool;
|
|
||||||
default = true;
|
|
||||||
description = "Whether to auto toggle bufferline";
|
|
||||||
};
|
|
||||||
|
|
||||||
hover = {
|
|
||||||
enabled = mkEnableOption "hover" // {default = true;};
|
|
||||||
delay = mkOption {
|
|
||||||
type = int;
|
|
||||||
default = 200;
|
|
||||||
description = "Delay for hover, in ms";
|
|
||||||
};
|
|
||||||
|
|
||||||
reveal = mkOption {
|
|
||||||
type = listOf str;
|
|
||||||
default = ["close"];
|
|
||||||
description = "Reveal hover window";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
sort_by = mkOption {
|
|
||||||
type = either (enum ["insert_after_current" "insert_at_end" "id" "extension" "relative_directory" "directory" "tabs"]) luaInline;
|
|
||||||
default = "extension";
|
|
||||||
description = "Method to sort buffers by. Must be one of the supported values, or an inline Lua value.";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,7 +53,6 @@ in {
|
||||||
require('catppuccin').setup {
|
require('catppuccin').setup {
|
||||||
flavour = "${style}",
|
flavour = "${style}",
|
||||||
transparent_background = ${boolToString transparent},
|
transparent_background = ${boolToString transparent},
|
||||||
term_colors = true,
|
|
||||||
integrations = {
|
integrations = {
|
||||||
nvimtree = {
|
nvimtree = {
|
||||||
enabled = true,
|
enabled = true,
|
||||||
|
|
|
@ -31,15 +31,15 @@ in {
|
||||||
|
|
||||||
custom_colorcolumn = mkOption {
|
custom_colorcolumn = mkOption {
|
||||||
description = "The position at which smart column should be displayed for each individual buffer type";
|
description = "The position at which smart column should be displayed for each individual buffer type";
|
||||||
type = attrsOf (either str (listOf str));
|
type = attrsOf (either int (listOf int));
|
||||||
default = {};
|
default = {};
|
||||||
|
|
||||||
example = literalExpression ''
|
example = literalExpression ''
|
||||||
vim.ui.smartcolumn.setupOpts.custom_colorcolumn = {
|
vim.ui.smartcolumn.setupOpts.custom_colorcolumn = {
|
||||||
nix = "110";
|
nix = 110;
|
||||||
ruby = "120";
|
ruby = 120;
|
||||||
java = "130";
|
java = 130;
|
||||||
go = ["90" "130"];
|
go = [90 130];
|
||||||
};
|
};
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue