-
Notifications
You must be signed in to change notification settings - Fork 239
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
double click option for open files #1884
Comments
You can do that by rebinding some keymap.add({
["2lclick"] = "treeview:select-and-open",
["1lclick"] = "treeview:select"
}) |
Single clicks on directories are quite satisfactory. The problem is that random clicks on files open them. It seems to me that such code will also open directories with a double click. |
Yeah, you could create a new command to do that: local TreeView = require "plugins.treeview"
local command = require "core.command"
command.add(function()
return core.active_view == TreeView, core.active_view
end, {
["custom-treeview:select-file-or-open-dir"] = function(view)
if view.hovered_item and view.hovered_item.type == "dir" then
command.perform("treeview:select-and-open")
else
command.perform("treeview:select")
end
end
})
keymap.add({
["2lclick"] = "treeview:select-and-open",
["1lclick"] = "custom-treeview:select-file-or-open-dir"
}) |
Yes, great, that works too. It would be great to write it into the user module so that others could quickly find this knowledge. |
The text was updated successfully, but these errors were encountered: