obaland / vfiler.vim Goto Github PK
View Code? Open in Web Editor NEW:file_folder: File explorer plugin for Neovim/Vim
License: MIT License
:file_folder: File explorer plugin for Neovim/Vim
License: MIT License
here's the error:
E5108: Error executing lua /home/mjhd/.cache/nvim/vfiler.vim/lua/vfiler/buffer.lua:93: assertion failed!
stack traceback:
[C]: in function 'assert'
/home/mjhd/.cache/nvim/vfiler.vim/lua/vfiler/buffer.lua:93: in function 'set_option'
/home/mjhd/.cache/nvim/vfiler.vim/lua/vfiler/view.lua:404: in function 'finally'
/home/mjhd/.cache/nvim/vfiler.vim/lua/vfiler/libs/core.lua:42: in function 'try'
/home/mjhd/.cache/nvim/vfiler.vim/lua/vfiler/view.lua:397: in function 'redraw'
.../.cache/nvim/vfiler.vim/lua/vfiler/actions/utilities.lua:125: in function 'open_file'
.../.cache/nvim/vfiler.vim/lua/vfiler/actions/utilities.lua:140: in function 'choose_file'
.../.cache/nvim/vfiler.vim/lua/vfiler/actions/utilities.lua:148: in function 'edit_file'
.../.cache/nvim/vfiler.vim/lua/vfiler/actions/utilities.lua:206: in function 'open_file'
.../mjhd/.cache/nvim/vfiler.vim/lua/vfiler/actions/open.lua:7: in function 'action'
/home/mjhd/.cache/nvim/vfiler.vim/lua/vfiler/vfiler.lua:215: in function 'do_action'
/home/mjhd/.cache/nvim/vfiler.vim/lua/vfiler/vfiler.lua:196: in function '_do_action'
[string ":lua"]:1: in main chunk
my config:
local action = require('vfiler/action')
local config = require('vfiler/config')
config.around = {
options = {
auto_resize = true,
header = true,
name = 'around',
blend = 20,
layout = 'floating',
border = 'none',
columns = 'indent,devicons,name',
keep = true,
},
mappings = {
['<esc>'] = action.quit,
['<C-s>'] = action.open_by_split,
['s'] = action.toggle_sort,
},
}
config.filer = {
options = {
header = true,
name = 'filer',
layout = 'tab',
columns = 'indent,devicons,name,mode,size,time',
['git.ignored'] = false,
['git.untracked'] = false,
},
mappings = {
['h'] = action.switch_to_filer,
['l'] = action.switch_to_filer,
['<left>'] = action.switch_to_filer,
['<right>'] = action.switch_to_filer,
},
}
my environment:
When I try to open a UNC path, following error is thrown.
ex1. require("vfiler").start("//COMPUTERNAME/FOLDERNAME")
ex2. require("vfiler").start("\\COMPUTERNAME\FOLDERNAME")
E5108: Error executing lua ...ocal/nvim-data/lazy/vfiler.vim/lua/vfiler/items/item.lua:72: attempt to index local 'stat' (a nil value)
stack traceback:
...ocal/nvim-data/lazy/vfiler.vim/lua/vfiler/items/item.lua:72: in function 'new'
...Local/nvim-data/lazy/vfiler.vim/lua/vfiler/libs/core.lua:22: in function 'inherit'
...nvim-data/lazy/vfiler.vim/lua/vfiler/items/directory.lua:33: in function 'new'
...a/Local/nvim-data/lazy/vfiler.vim/lua/vfiler/context.lua:297: in function 'switch'
...ta/Local/nvim-data/lazy/vfiler.vim/lua/vfiler/vfiler.lua:275: in function 'start'
...1/AppData/Local/nvim-data/lazy/vfiler.vim/lua/vfiler.lua:32: in function 'start'
[string ":lua"]:1: in main chunk
OS: Windows10
NVIM: v0.9.5
vfiler.vim: ed2c4a7
When I quit, the struct folder expands reset.
I want to like this(defx.nvim)
File module_vfiler.lua
NVIM v0.8.0-dev
local action = require('vfiler/action')
require'vfiler/config'.setup {
options = {
auto_cd = false,
auto_resize = false,
columns = 'indent,icon,name',
header = true,
keep = true,
listed = true,
name = '',
session = none,
show_hidden_files = true,
sort = 'name',
layout = 'left',
width = 35,
new = false,
quit = true,
row = 0,
col = 0,
blend = 0,
border = 'rounded',
zindex = 200,
git = {
enabled = false,
ignored = false,
untracked = false,
},
preview = {
layout = 'floating',
width = 0,
height = 0,
},
},
mappings = {
['.'] = action.toggle_show_hidden,
['<BS>'] = action.change_to_parent,
['<C-l>'] = action.reload,
['<C-p>'] = action.toggle_auto_preview,
['<C-r>'] = action.sync_with_current_filer,
['<C-s>'] = action.toggle_sort,
['<CR>'] = action.open,
['<Space>'] = function(vfiler, context, view)
action.toggle_select(vfiler, context, view)
end,
['*'] = action.toggle_select_all,
['cc'] = action.copy_to_filer,
['dd'] = action.delete,
['gg'] = action.move_cursor_top,
['b'] = action.list_bookmark,
['h'] = action.close_tree_or_cd,
['j'] = action.loop_cursor_down,
['k'] = action.loop_cursor_up,
['l'] = action.open_tree,
['mm'] = action.move_to_filer,
['p'] = action.toggle_preview,
['r'] = action.rename,
['s'] = action.open_by_split,
['t'] = action.open_by_tabpage,
['v'] = action.open_by_vsplit,
['x'] = action.execute_file,
['yy'] = action.yank_path,
['B'] = action.add_bookmark,
['C'] = action.copy,
['D'] = action.delete,
['G'] = action.move_cursor_bottom,
['~'] = action.jump_to_home,
['J'] = action.jump_to_directory,
['K'] = action.new_directory,
['L'] = action.switch_to_drive,
['M'] = action.move,
['N'] = action.new_file,
['P'] = action.paste,
['q'] = action.quit,
['S'] = action.change_sort,
['U'] = action.clear_selected_all,
['YY'] = action.yank_name,
},
}
:help xxx
でデフォルトマップの一覧を参照することは可能でしょうか?
When using with b0o/incline.nvim, vfiler detects incline's window and treats it as a choice.
It's so helpful if there is an option to ignore specific types windows.
I had forked and trying add action named toggle_show_linenumber
.
But I had got error messsage E21: Cannot make changes, 'modifiable' is off
.
I think this is the one of way. It be toggle modifiable
at before and after toggle_show_linenumber
. Is this better? Or?
vfiler.vim/lua/vfiler/view.lua
Lines 274 to 287 in 9e51bd2
Attach toggle_show_linenumber
to i
key.
And type i
then get error message, as a bellow.
E21: Cannot make changes, 'modifiable' is off
Is this one of specifications? Or bug?
action.toggle_show_hidden
has effects for all directory under the displayed directory.
action.toggle_show_hidden
can't show diplayed_top_directory/**/\..*
, like nvim/.gitignore
.
action.reload
was no effects.
local M = {}
M.setup = function()
local _vfiler = require('vfiler')
local _vfiler_action = require('vfiler/action')
local _vfiler_config = require('vfiler/config')
_vfiler_config.setup {
options = {
name = 'myfiler',
auto_cd = true,
auto_resize = true,
keep = true,
layout = 'left',
width = 30,
columns = 'indent,devicons,name,git',
preview = {
layout = 'right',
},
},
mappings = {},
}
_vfiler_action.setup {
hook = {},
}
_vfiler.start('./')
end
require('vfiler/columns/indent').setup {
icon = ''
}
return M
execute-file
function is same xyzzy's shell-execute
?
ps. tell me how to show 2-windows-layout
Hello! Thank you for this great plugin!
I use lazy.nvim as the plugins manager and I have the following configs:
return {
"obaland/vfiler.vim",
keys = {
{ "<leader>t", "<cmd>VFiler<cr>", desc = "Open vfiler" },
},
cmd = {"VFiler"},
dependencies = {"obaland/vfiler-column-devicons"},
config = function(_, opts)
local action = require("vfiler/action")
-- following options are the default
require'vfiler/config'.clear_mappings()
require("vfiler/config").setup({
options = {
auto_cd = true,
auto_resize = true,
columns = "indent,devicons,name,git,time,mode,size",
find_file = true,
header = true,
keep = true,
listed = true,
name = "",
session = "buffer",
show_hidden_files = true,
sort = "name",
layout = "left",
width = 80,
height = 20,
new = false,
quit = true,
row = 0,
col = 0,
blend = 0,
border = "rounded",
zindex = 200,
git = {
enabled = true,
ignored = true,
untracked = true,
},
preview = {
layout = "floating",
width = 0,
height = 0,
},
},
mappings = {
["."] = action.toggle_show_hidden,
["<BS>"] = action.change_to_parent,
["<C-l>"] = action.reload,
["<C-p>"] = action.toggle_auto_preview,
["<C-r>"] = action.sync_with_current_filer,
["<C-s>"] = action.toggle_sort,
["<CR>"] = action.open,
["K"] = function(vfiler, context, view)
action.toggle_select(vfiler, context, view)
action.move_cursor_up(vfiler, context, view)
end,
["J"] = function(vfiler, context, view)
action.toggle_select(vfiler, context, view)
action.move_cursor_down(vfiler, context, view)
end,
["<Tab>"] = action.switch_to_filer,
["~"] = action.jump_to_home,
["*"] = action.toggle_select_all,
["\\"] = action.jump_to_root,
["cc"] = action.copy_to_filer,
["dd"] = action.delete,
["gg"] = action.move_cursor_top,
["b"] = action.list_bookmark,
["h"] = action.close_tree_or_cd,
["j"] = action.loop_cursor_down,
["k"] = action.loop_cursor_up,
["l"] = action.open_tree,
["M"] = action.move_to_filer,
["P"] = action.toggle_preview,
["q"] = action.quit,
["r"] = action.rename,
["s"] = action.open_by_split,
["t"] = action.open_by_tabpage,
["v"] = action.open_by_vsplit,
["e"] = action.execute_file,
["yp"] = action.yank_path,
["B"] = action.add_bookmark,
["yy"] = action.copy,
["D"] = action.delete,
["G"] = action.move_cursor_bottom,
-- ["J"] = action.jump_to_directory,
["A"] = action.new_directory,
["L"] = action.switch_to_drive,
["x"] = action.move,
["a"] = action.new_file,
["p"] = action.paste,
["S"] = action.change_sort,
["U"] = action.clear_selected_all,
["yn"] = action.yank_name,
},
})
end,
}
I'm using floating filer by following config:
config.around = {
options = {
auto_resize = true,
header = true,
name = 'around',
blend = 20,
layout = 'floating',
border = 'none',
columns = 'indent,devicons,name',
keep = true,
},
mappings = {
['<esc>'] = action.quit,
['<C-s>'] = action.open_by_split,
['s'] = action.toggle_sort,
},
}
When I close the floating window, following error is thrown:
E5108: Error executing lua ...d/.cache/nvim/vfiler.vim/lua/vfiler/windows/floating.lua:10: BufLeave Autocommands
for "<buffer=7>": Vim(lua):E5108: Error executing lua /home/mjhd/.cache/nvim/vfiler.vim/lua/vfiler/vfiler.lua:358: attempt to call field '_unregister_events' (a nil value)
stack traceback:
/home/mjhd/.cache/nvim/vfiler.vim/lua/vfiler/vfiler.lua:358: in function '_unregister_events'
/home/mjhd/.cache/nvim/vfiler.vim/lua/vfiler/vfiler.lua:329: in function 'wipeout'
/home/mjhd/.cache/nvim/vfiler.vim/lua/vfiler/config.lua:108: in function 'action'
/home/mjhd/.cache/nvim/vfiler.vim/lua/vfiler/vfiler.lua:215: in function 'do_action'
/home/mjhd/.cache/nvim/vfiler.vim/lua/vfiler/vfiler.lua:348: in function 'callback'
.../mjhd/.cache/nvim/vfiler.vim/lua/vfiler/events/event.lua:30: in function '_handle'
[string ":lua"]:1: in main chunk
[C]: in function 'nvim_win_close'
...d/.cache/nvim/vfiler.vim/lua/vfiler/windows/floating.lua:10: in function 'close'
...d/.cache/nvim/vfiler.vim/lua/vfiler/windows/floating.lua:93: in function 'close'
/home/mjhd/.cache/nvim/vfiler.vim/lua/vfiler/view.lua:196: in function 'close'
/home/mjhd/.cache/nvim/vfiler.vim/lua/vfiler/vfiler.lua:260: in function 'quit'
...jhd/.cache/nvim/vfiler.vim/lua/vfiler/actions/buffer.lua:16: in function 'action'
/home/mjhd/.cache/nvim/vfiler.vim/lua/vfiler/vfiler.lua:215: in function 'do_action'
/home/mjhd/.cache/nvim/vfiler.vim/lua/vfiler/vfiler.lua:196: in function '_do_action'
[string ":lua"]:1: in main chunk
stack traceback:
[C]: in function 'nvim_win_close'
...d/.cache/nvim/vfiler.vim/lua/vfiler/windows/floating.lua:10: in function 'close'
...d/.cache/nvim/vfiler.vim/lua/vfiler/windows/floating.lua:93: in function 'close'
/home/mjhd/.cache/nvim/vfiler.vim/lua/vfiler/view.lua:196: in function 'close'
/home/mjhd/.cache/nvim/vfiler.vim/lua/vfiler/vfiler.lua:260: in function 'quit'
...jhd/.cache/nvim/vfiler.vim/lua/vfiler/actions/buffer.lua:16: in function 'action'
/home/mjhd/.cache/nvim/vfiler.vim/lua/vfiler/vfiler.lua:215: in function 'do_action'
/home/mjhd/.cache/nvim/vfiler.vim/lua/vfiler/vfiler.lua:196: in function '_do_action'
[string ":lua"]:1: in main chunk
OS: Ubuntu 22.04 on WSL2
Neovim:NVIM v0.9.1
vfiler.vim: 0edad19
Hello, I have a new idea I can somehow use the l
key to open tree and open file without changing current directory. Then there is no need to move my finger from l
to <CR>
to open the file...
so in the "mapping" configuration, I may need something like below:
{
mapping = {
["l"] = function(vfiler, context, view)
if action.is_directory(vfiler, context, view) then
return action.open_tree(vfiler, context, view)
else
return action.open_file(vfiler, context, view)`
end
}
}
Yes, I need this action.is_directory(vfiler, context, view)
API...
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.