mirror of
https://github.com/NotAShelf/neovim-flake.git
synced 2024-11-09 14:45:58 +01:00
Compare commits
11 commits
1ce62335e1
...
21f48253d0
Author | SHA1 | Date | |
---|---|---|---|
|
21f48253d0 | ||
|
64e79a9f4c | ||
fe9bcf224b | |||
6e8bb14567 | |||
2a37873f8a | |||
a12a26e405 | |||
d2d2c2a227 | |||
fde298805c | |||
56a8476bc1 | |||
|
8c5a63e72c | ||
|
636eba77d7 |
9 changed files with 367 additions and 170 deletions
52
.github/README.md
vendored
52
.github/README.md
vendored
|
@ -1,9 +1,10 @@
|
|||
<div align="center">
|
||||
<img src="assets/nvf-logo-work.svg" alt="nvf Logo" width="200">
|
||||
<h1 ❄️ nvf</h1>
|
||||
</div>
|
||||
<h1 align="center">❄️ nvf</h1>
|
||||
|
||||
<div align="center">
|
||||
<p>
|
||||
<p>
|
||||
<a href="https://github.com/NotAShelf/nvf/releases/latest">
|
||||
<img alt="Latest release" src="https://img.shields.io/github/v/release/NotAShelf/nvf?style=for-the-badge&logo=nixos&color=C9CBFF&logoColor=D9E0EE&labelColor=302D41" />
|
||||
</a>
|
||||
|
@ -22,7 +23,8 @@
|
|||
<a href="https://github.com/NotAShelf/nvf">
|
||||
<img alt="Repo Size" src="https://img.shields.io/github/repo-size/NotAShelf/nvf?color=%23DDB6F2&label=SIZE&logo=codesandbox&style=for-the-badge&logoColor=D9E0EE&labelColor=302D41" />
|
||||
</a>
|
||||
</p>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<p align="center">
|
||||
<img src="https://stars.medv.io/NotAShelf/nvf.svg", title="stars"/>
|
||||
|
@ -36,19 +38,18 @@
|
|||
Nix code.
|
||||
</a>
|
||||
</div>
|
||||
<br/>
|
||||
|
||||
> [!WARNING]
|
||||
> Main branch is only updated for small, non-breaking changes. For the latest version of neovim-flake, please see
|
||||
> [the list of branches](https://github.com/NotAShelf/neovim-flake/branches) or
|
||||
> [open pull requests](https://github.com/NotAShelf/neovim-flake/pulls?q=is%3Apr+is%3Aopen+sort%3Aupdated-desc).
|
||||
> neovim-flake, at the time, is still being actively developed - and will continue to be so for the foreseeable
|
||||
> future.
|
||||
|
||||
---
|
||||
|
||||
<div align="center"><p>
|
||||
|
||||
[Get Started]: #get-started
|
||||
[Documentation]: #documentation
|
||||
[Help]: #help
|
||||
[Contribute]: #contributing
|
||||
[FAQ]: #faq
|
||||
[Credits]: #credits
|
||||
|
||||
**[<kbd> <br> Get Started <br> </kbd>][Get Started]**
|
||||
**[<kbd> <br> Documentation <br> </kbd>][Documentation]**
|
||||
**[<kbd> <br> Help <br> </kbd>][Help]**
|
||||
|
@ -58,13 +59,6 @@
|
|||
|
||||
</p></div>
|
||||
|
||||
[Get Started]: #get-started
|
||||
[Documentation]: #documentation
|
||||
[Help]: #help
|
||||
[Contribute]: #contributing
|
||||
[FAQ]: #faq
|
||||
[Credits]: #credits
|
||||
|
||||
---
|
||||
|
||||
## Get Started
|
||||
|
@ -113,13 +107,15 @@ featured configuration with `nix` language support by running:
|
|||
nix run github:notashelf/nvf#nix
|
||||
```
|
||||
|
||||
Please create an issue on the [issue tracker](../../../issues) if you find
|
||||
[Issues]: https://github.com/NotAShelf/nvf/issues
|
||||
|
||||
Please create an issue on the [issue tracker](issues) if you find
|
||||
the documentation lacking or confusing. I also appreciate any contributions
|
||||
to the documentation.
|
||||
|
||||
## Help
|
||||
|
||||
You can create an issue on the [issue tracker](../../../issues) to ask questions
|
||||
You can create an issue on the [issue tracker](issues) to ask questions
|
||||
or report bugs. I am not yet on spaces like matrix or IRC, so please use the issue
|
||||
tracker for now.
|
||||
|
||||
|
@ -128,7 +124,7 @@ tracker for now.
|
|||
I am always looking for new ways to help improve this flake. If you would like
|
||||
to contribute, please read the [contributing guide](CONTRIBUTING.md) before
|
||||
submitting a pull request. You can also create an issue on the
|
||||
[issue tracker](../../../issues) before submitting a pull request if you would
|
||||
[issue tracker](issues) before submitting a pull request if you would
|
||||
like to discuss a feature or bug fix.
|
||||
|
||||
## FAQ
|
||||
|
@ -137,8 +133,7 @@ like to discuss a feature or bug fix.
|
|||
<br/>
|
||||
**A**: Maybe! It is not one of our goals to support each and every Neovim
|
||||
plugin, however, I am always open to new modules and plugin setup additions
|
||||
to **nvf**. Use the [appropritate issue
|
||||
template](https://github.com/NotAShelf/nvf/issues/new/choose) and I will
|
||||
to **nvf**. Use the [appropritate issue template](issues/new/choose) and I will
|
||||
consider a module addition.
|
||||
|
||||
**Q**: A plugin I need is not available in **nvf**. What to do?
|
||||
|
@ -147,6 +142,15 @@ consider a module addition.
|
|||
plugin configurations! Please see the documentation on how you may do
|
||||
this.
|
||||
|
||||
**Q**: Main branch is awfully silent, is the project dead?
|
||||
<br/>
|
||||
**A**: No! Sometimes we branch out (e.g. v0.6) to avoid breaking userspace
|
||||
and work in a separate branch until we make sure the new additions are
|
||||
implemented in the most comfortable way available to the end user. If you have
|
||||
not noticed any activity on the main branch, consider taking a look at the [list
|
||||
of branches](https://github.com/NotAShelf/nvf/branches=) or the [list of open
|
||||
pull requests](https://github.com/NotAShelf/nvf)
|
||||
|
||||
## Credits
|
||||
|
||||
### Contributors
|
||||
|
@ -180,7 +184,7 @@ recommend checking their work out.
|
|||
|
||||
Following the [original neovim-flake](https://github.com/jordanisaacs/neovim-flake)
|
||||
**nvf** has been made available under the **MIT License**. However, all assets
|
||||
are published under the [CC BY License].
|
||||
and documentation are published under the [CC BY License].
|
||||
|
||||
---
|
||||
|
||||
|
|
2
.github/workflows/check-docs.yml
vendored
2
.github/workflows/check-docs.yml
vendored
|
@ -48,4 +48,4 @@ jobs:
|
|||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: "${{ matrix.package }}"
|
||||
path: result/share/doc/neovim-flake/
|
||||
path: result/share/doc/nvf
|
||||
|
|
50
.github/workflows/docker.yml
vendored
50
.github/workflows/docker.yml
vendored
|
@ -1,50 +0,0 @@
|
|||
name: "Publish Docker Image"
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
tags: ["v*"]
|
||||
|
||||
jobs:
|
||||
build-docker-image:
|
||||
name: "Build Docker Image"
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install Nix
|
||||
uses: DeterminateSystems/nix-installer-action@main
|
||||
- name: Magic Nix Cache
|
||||
uses: DeterminateSystems/magic-nix-cache-action@main
|
||||
|
||||
- name: Build Docker Image
|
||||
run: nix build .#docker-nix --print-build-logs
|
||||
|
||||
- name: Load & Tag Built Docker Image
|
||||
run: |
|
||||
docker load -i result &&
|
||||
docker tag neovim-flake:latest notashelf/neovim-flake:latest
|
||||
|
||||
- name: Log into DockerHub
|
||||
uses: docker/login-action@master
|
||||
with:
|
||||
username: notashelf
|
||||
password: ${{ secrets.DOCKER_ACCESS_TOKEN }}
|
||||
|
||||
- name: Push to DockerHub
|
||||
run: docker push notashelf/neovim-flake:latest
|
||||
|
||||
- name: Log into ghcr
|
||||
uses: docker/login-action@master
|
||||
with:
|
||||
registry: "ghcr.io"
|
||||
username: "${{ github.actor }}"
|
||||
password: "${{ secrets.GITHUB_TOKEN }}"
|
||||
|
||||
- name: Publish Docker Image (Github Packages)
|
||||
run: docker push notashelf/neovim-flake:latest
|
2
.github/workflows/manual.yml
vendored
2
.github/workflows/manual.yml
vendored
|
@ -33,7 +33,7 @@ jobs:
|
|||
- name: Build
|
||||
run: |
|
||||
nix build '.#docs'
|
||||
cp -r result/share/doc/neovim-flake public
|
||||
cp -r result/share/doc/nvf public
|
||||
|
||||
- name: Deploy
|
||||
uses: peaceiris/actions-gh-pages@v4
|
||||
|
|
|
@ -77,8 +77,7 @@ in rec {
|
|||
else "[${toLuaObject n}] = " + (toLuaObject v))
|
||||
(filterAttrs
|
||||
(
|
||||
_: v:
|
||||
(v != null) && (toLuaObject v != "{}")
|
||||
_: v: (toLuaObject v != "{}")
|
||||
)
|
||||
args)))
|
||||
+ "}"
|
||||
|
|
|
@ -6,101 +6,30 @@
|
|||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.nvim.binds) mkLuaBinding mkBinding pushDownDefault;
|
||||
inherit (lib.nvim.dag) entryAnywhere;
|
||||
inherit (lib.nvim.lua) toLuaObject;
|
||||
|
||||
cfg = config.vim.tabline.nvimBufferline;
|
||||
|
||||
self = import ./nvim-bufferline.nix {inherit lib;};
|
||||
inherit (self.options.vim.tabline.nvimBufferline) mappings;
|
||||
in {
|
||||
config = mkIf cfg.enable (
|
||||
let
|
||||
mouse = {
|
||||
right = "'vertical sbuffer %d'";
|
||||
close = ''
|
||||
function(bufnum)
|
||||
require("bufdelete").bufdelete(bufnum, false)
|
||||
end
|
||||
'';
|
||||
config = mkIf cfg.enable {
|
||||
vim = {
|
||||
startPlugins = [
|
||||
(assert config.vim.visuals.nvimWebDevicons.enable; "nvim-bufferline-lua")
|
||||
"bufdelete-nvim"
|
||||
];
|
||||
|
||||
binds.whichKey.register = pushDownDefault {
|
||||
"<leader>b" = "+Buffer";
|
||||
"<leader>bm" = "BufferLineMove";
|
||||
"<leader>bs" = "BufferLineSort";
|
||||
"<leader>bsi" = "BufferLineSortById";
|
||||
};
|
||||
in {
|
||||
vim = {
|
||||
startPlugins = [
|
||||
(assert config.vim.visuals.nvimWebDevicons.enable; "nvim-bufferline-lua")
|
||||
"bufdelete-nvim"
|
||||
];
|
||||
|
||||
maps.normal = mkMerge [
|
||||
(mkLuaBinding cfg.mappings.closeCurrent "require(\"bufdelete\").bufdelete" mappings.closeCurrent.description)
|
||||
(mkBinding cfg.mappings.cycleNext ":BufferLineCycleNext<CR>" mappings.cycleNext.description)
|
||||
(mkBinding cfg.mappings.cycleNext ":BufferLineCycleNext<CR>" mappings.cycleNext.description)
|
||||
(mkBinding cfg.mappings.cyclePrevious ":BufferLineCyclePrev<CR>" mappings.cyclePrevious.description)
|
||||
(mkBinding cfg.mappings.pick ":BufferLinePick<CR>" mappings.pick.description)
|
||||
(mkBinding cfg.mappings.sortByExtension ":BufferLineSortByExtension<CR>" mappings.sortByExtension.description)
|
||||
(mkBinding cfg.mappings.sortByDirectory ":BufferLineSortByDirectory<CR>" mappings.sortByDirectory.description)
|
||||
(mkLuaBinding cfg.mappings.sortById "function() require(\"bufferline\").sort_buffers_by(function (buf_a, buf_b) return buf_a.id < buf_b.id end) end" mappings.sortById.description)
|
||||
(mkBinding cfg.mappings.moveNext ":BufferLineMoveNext<CR>" mappings.moveNext.description)
|
||||
(mkBinding cfg.mappings.movePrevious ":BufferLineMovePrev<CR>" mappings.movePrevious.description)
|
||||
];
|
||||
|
||||
binds.whichKey.register = pushDownDefault {
|
||||
"<leader>b" = "+Buffer";
|
||||
"<leader>bm" = "BufferLineMove";
|
||||
"<leader>bs" = "BufferLineSort";
|
||||
"<leader>bsi" = "BufferLineSortById";
|
||||
};
|
||||
|
||||
luaConfigRC.nvimBufferline = entryAnywhere ''
|
||||
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,
|
||||
}
|
||||
}
|
||||
'';
|
||||
};
|
||||
}
|
||||
);
|
||||
luaConfigRC.nvimBufferline = entryAnywhere ''
|
||||
require("bufferline").setup({options = ${toLuaObject cfg.setupOpts}})
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
{lib, ...}: let
|
||||
inherit (lib.options) mkEnableOption;
|
||||
inherit (lib.options) mkOption mkEnableOption literalExpression;
|
||||
inherit (lib.types) enum bool either nullOr str int listOf;
|
||||
inherit (lib.nvim.binds) mkMappingOption;
|
||||
inherit (lib.nvim.types) mkPluginSetupOption luaInline;
|
||||
in {
|
||||
options.vim.tabline.nvimBufferline = {
|
||||
enable = mkEnableOption "neovim bufferline";
|
||||
|
@ -16,5 +18,319 @@ in {
|
|||
moveNext = mkMappingOption "Move next buffer" "<leader>bmn";
|
||||
movePrevious = mkMappingOption "Move previous buffer" "<leader>bmp";
|
||||
};
|
||||
|
||||
setupOpts = mkPluginSetupOption "Bufferline-nvim" {
|
||||
mode = mkOption {
|
||||
type = enum ["tabs" "buffers"];
|
||||
default = "tabs";
|
||||
description = "Mode to use for bufferline";
|
||||
};
|
||||
|
||||
themable = mkOption {
|
||||
type = bool;
|
||||
default = true;
|
||||
description = ''
|
||||
Whether or not 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 = lib.generators.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 = lib.generators.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";
|
||||
};
|
||||
|
||||
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 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 prefix used when a buffer is de-duplicated";
|
||||
};
|
||||
|
||||
truncate_names = mkOption {
|
||||
type = bool;
|
||||
default = true;
|
||||
description = "Truncate names";
|
||||
};
|
||||
|
||||
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 = lib.generators.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 lib.generators.mkLuaInline ''
|
||||
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.
|
||||
:::
|
||||
'';
|
||||
};
|
||||
|
||||
color_icons = mkOption {
|
||||
type = bool;
|
||||
default = true;
|
||||
description = "Whether or not to add filetype icon highlights";
|
||||
};
|
||||
|
||||
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 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 prefix";
|
||||
};
|
||||
|
||||
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.
|
||||
'';
|
||||
};
|
||||
|
||||
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 = false;
|
||||
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 valuees, or an inline Lua value.";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
}: let
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.lists) optional optionals;
|
||||
inherit (lib.trivial) boolToString;
|
||||
inherit (lib.nvim.binds) mkSetBinding addDescriptionsToMappings;
|
||||
inherit (lib.nvim.lua) toLuaObject;
|
||||
inherit (lib.nvim.dag) entryBefore entryAfter;
|
||||
|
|
|
@ -97,7 +97,7 @@ in {
|
|||
example = literalMD ''
|
||||
```lua
|
||||
-- Disable slow treesitter highlight for large files
|
||||
disable = function(lang, buf)
|
||||
function(lang, buf)
|
||||
local max_filesize = 1000 * 1024 -- 1MB
|
||||
local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf))
|
||||
if ok and stats and stats.size > max_filesize then
|
||||
|
|
Loading…
Reference in a new issue