Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open a filemanager by at start #32

Closed
horpto opened this issue May 22, 2018 · 4 comments
Closed

Open a filemanager by at start #32

horpto opened this issue May 22, 2018 · 4 comments

Comments

@horpto
Copy link

horpto commented May 22, 2018

It would be nice if filemanager will be opened at start of micro. Or if filemanager has an option for that.

@sum01
Copy link
Collaborator

sum01 commented May 22, 2018

You can achieve this by creating an init.lua in Micro's config folder and adding the call to filemanager's toggle_tree function.

So on Linux echo "filemanager.toggle_tree()" >> ~/.config/micro/init.lua is all you need to do.


I'm not really sure if such a one-liner is necessary to put in the plugin, or if most people would want it anyways. I'll leave this open for opinions on that.

@horpto
Copy link
Author

horpto commented May 23, 2018

Ok, thanks for your reply.

if such a one-liner is necessary to put in the plugin,

I think it should be optional, but is enabled by default.

"filemanager.toggle_tree()" > ~/.config/micro/init.lua

"filemanager.toggle_tree()" >> ~/.config/micro/init.lua would be nicier as init.lua can have other lines.

@datdinhquoc
Copy link

datdinhquoc commented Oct 10, 2018

adding filemanager.toggle_tree() to init.lua does the trick.

however, the active pane (buffer) is now the filemanager, i wish the cursor be in the file i'm editing instead of filemanager pane.

I found a work-around but it is not ideal:

--this is init.lua--
filemanager.toggle_tree()

function onViewOpen(view)
  tabs[curTab+1].CurView = 1
end

@sum01
Copy link
Collaborator

sum01 commented Oct 11, 2018

I have implemented a modified version of your recommendations, I just need to get around to pushing the changes.

@sum01 sum01 closed this as completed in 01ec427 Oct 23, 2018
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

3 participants