mirror of
https://github.com/NotAShelf/neovim-flake.git
synced 2025-01-10 12:19:49 +01:00
Compare commits
8 commits
8585efdfc5
...
0f62abd2d2
Author | SHA1 | Date | |
---|---|---|---|
|
0f62abd2d2 | ||
bd9fe9eb68 | |||
|
f672d3cdee | ||
5b2ab22777 | |||
|
6d07646fae | ||
|
14de965ce9 | ||
|
234ad31909 | ||
|
73cc5edd31 |
2 changed files with 10 additions and 1 deletions
|
@ -24,6 +24,7 @@ in {
|
|||
or '<Plug>(comment_toggle_linewise_count)'
|
||||
end
|
||||
'' {
|
||||
lua = true;
|
||||
expr = true;
|
||||
desc = mappings.toggleCurrentLine.description;
|
||||
})
|
||||
|
@ -33,6 +34,7 @@ in {
|
|||
or '<Plug>(comment_toggle_blockwise_count)'
|
||||
end
|
||||
'' {
|
||||
lua = true;
|
||||
expr = true;
|
||||
desc = mappings.toggleCurrentBlock.description;
|
||||
})
|
||||
|
|
|
@ -77,6 +77,9 @@ in {
|
|||
-- buffer is a real file on the disk
|
||||
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]
|
||||
local no_name = data.file == "" and vim.bo[data.buf].buftype == ""
|
||||
|
||||
|
@ -84,7 +87,7 @@ in {
|
|||
local filetype = vim.bo[data.buf].ft
|
||||
|
||||
-- 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
|
||||
end
|
||||
|
||||
|
@ -93,6 +96,10 @@ in {
|
|||
return
|
||||
end
|
||||
|
||||
-- cd if buffer is a directory
|
||||
if directory then
|
||||
vim.cmd.cd(data.file)
|
||||
end
|
||||
-- open the tree but don't focus it
|
||||
require("nvim-tree.api").tree.toggle({ focus = false })
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue