mirror of
https://github.com/NotAShelf/neovim-flake.git
synced 2025-01-10 12:19:49 +01:00
Compare commits
8 commits
414b9e0d49
...
a91d6d026c
Author | SHA1 | Date | |
---|---|---|---|
|
a91d6d026c | ||
48bcd5d695 | |||
bd9fe9eb68 | |||
5b2ab22777 | |||
|
6d07646fae | ||
|
14de965ce9 | ||
|
234ad31909 | ||
|
73cc5edd31 |
2 changed files with 10 additions and 2 deletions
|
@ -77,6 +77,9 @@ in {
|
||||||
-- buffer is a real file on the disk
|
-- buffer is a real file on the disk
|
||||||
local real_file = vim.fn.filereadable(data.file) == 1
|
local real_file = vim.fn.filereadable(data.file) == 1
|
||||||
|
|
||||||
|
-- buffer is a directory
|
||||||
|
local directory = vim.fn.isdirectory(data.file) == 1
|
||||||
|
|
||||||
-- buffer is a [No Name]
|
-- buffer is a [No Name]
|
||||||
local no_name = data.file == "" and vim.bo[data.buf].buftype == ""
|
local no_name = data.file == "" and vim.bo[data.buf].buftype == ""
|
||||||
|
|
||||||
|
@ -84,7 +87,7 @@ in {
|
||||||
local filetype = vim.bo[data.buf].ft
|
local filetype = vim.bo[data.buf].ft
|
||||||
|
|
||||||
-- only files please
|
-- only files please
|
||||||
if not real_file and not no_name then
|
if not real_file and not directory and not no_name then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -93,6 +96,10 @@ in {
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- cd if buffer is a directory
|
||||||
|
if directory then
|
||||||
|
vim.cmd.cd(data.file)
|
||||||
|
end
|
||||||
-- open the tree but don't focus it
|
-- open the tree but don't focus it
|
||||||
require("nvim-tree.api").tree.toggle({ focus = false })
|
require("nvim-tree.api").tree.toggle({ focus = false })
|
||||||
end
|
end
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
inherit (lib.modules) mkRenamedOptionModule;
|
inherit (lib.modules) mkRenamedOptionModule;
|
||||||
inherit (lib.options) mkOption mkEnableOption literalExpression;
|
inherit (lib.options) mkOption mkEnableOption literalExpression;
|
||||||
inherit (lib.types) int bool str nullOr either listOf attrsOf;
|
inherit (lib.types) int bool str nullOr either listOf attrsOf;
|
||||||
|
inherit (lib.nvim.types) mkPluginSetupOption;
|
||||||
|
|
||||||
cfg = config.vim.visuals;
|
cfg = config.vim.visuals;
|
||||||
in {
|
in {
|
||||||
|
@ -15,7 +16,7 @@ in {
|
||||||
|
|
||||||
options.vim.visuals.indent-blankline = {
|
options.vim.visuals.indent-blankline = {
|
||||||
enable = mkEnableOption "indentation guides [indent-blankline]";
|
enable = mkEnableOption "indentation guides [indent-blankline]";
|
||||||
setupOpts = {
|
setupOpts = mkPluginSetupOption "indent-blankline" {
|
||||||
debounce = mkOption {
|
debounce = mkOption {
|
||||||
type = int;
|
type = int;
|
||||||
description = "Debounce time in milliseconds";
|
description = "Debounce time in milliseconds";
|
||||||
|
|
Loading…
Reference in a new issue