mirror of
https://github.com/NotAShelf/neovim-flake.git
synced 2025-01-10 15:49:48 +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)'
|
or '<Plug>(comment_toggle_linewise_count)'
|
||||||
end
|
end
|
||||||
'' {
|
'' {
|
||||||
|
lua = true;
|
||||||
expr = true;
|
expr = true;
|
||||||
desc = mappings.toggleCurrentLine.description;
|
desc = mappings.toggleCurrentLine.description;
|
||||||
})
|
})
|
||||||
|
@ -33,6 +34,7 @@ in {
|
||||||
or '<Plug>(comment_toggle_blockwise_count)'
|
or '<Plug>(comment_toggle_blockwise_count)'
|
||||||
end
|
end
|
||||||
'' {
|
'' {
|
||||||
|
lua = true;
|
||||||
expr = true;
|
expr = true;
|
||||||
desc = mappings.toggleCurrentBlock.description;
|
desc = mappings.toggleCurrentBlock.description;
|
||||||
})
|
})
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue