filemanager-plugin
                                
                                 filemanager-plugin copied to clipboard
                                
                                    filemanager-plugin copied to clipboard
                            
                            
                            
                        [Feature Request] Open as new tab instead of new pane
In many cases, it would be preferrable to open a file in a new tab over the previously selected pane rather than opening a whole new pane. Perhaps by using Shift+Tab instead of just Tab, or some other keyboard shortcut.
Shouldn't be too hard, but note that when the file opens it will leave the tree view in the previous tab.
I found the potential function to do this, NewTabFromView in tabs.go, but the various methods I've tried to use it all fail. I've asked about it in Micro's Gitter, so until I get an answer this is on hold. Sorry.
@sum01
Is the OpenFileTab() func in this PR any use? https://github.com/zyedidia/micro/pull/963
It might be. Zyedidia's suggestion on how to open a new tab with a prompt could work as well, although have no idea if it requires user input or not.
Please could someone add this feature? This would almost feel like sublime in the console, if it had this feature.
@franzflasch
Please could someone add this feature? This would almost feel like sublime in the console, if it had this feature.
check github.com/rvi64/files-plugin
great! will have a look at it!
I would rather have it as filemanager-openintab rather than a keyboard shortcut. I know of no other editor that opens a split if you click the files in the tree view...
@ghost
github.com/rvi64/files-plugin
This link is dead (the entire github user is 404), is it moved?
@karl-gustav That's what happens when someone deletes their github account. Renames them ghost & all their repos go poof.
@sum01 oh ಠ_ಠ, thanks for the info! @franzflasch Did you download a copy of the repo before @rvi64 deleted his account?
@karl-gustav Unfortunately not. Must have been deleted on my last cleanup. :(
This PR gives plugins access to View: https://github.com/zyedidia/micro/pull/1231
So then if that was merged, then maybe something like this might work?
https://github.com/sc0ttj/filemanager-plugin/pull/1/files?utf8=%E2%9C%93&diff=unified&w=1
@sc0ttj Looks good I suppose. One note, however, is that you wouldn't really want to change that function. That would make everything you open go to a new tab, which isn't the desired outcome.
If/when that PR goes through, you'd want to add a new function and a way to trigger it (i.e. with a different keybinding) to open files in a new tab. The original issue poster mentioned using Shift-tab, for example.
Either that, or you'd add a parameter that allows the function to do either, and then detect the keybind in any place where that function is used.
I think the former is the better of the two options, as it's a lot easier.
Does anyone know how to do this? The issue linked (https://github.com/zyedidia/micro/pull/1231) has been closed because micro v2 was released but I don't know what's changed in v2 that would allow implementing this functionality.
@sum01 regarding the addition of a new function or a parameter I'd just default to opening in a new tab because that's how AFAIK all editors which have a treeview work.
I belive internal/action/tab.go might be the key for what is needed to close this issue in Micro v2. Accessing micro.CurPane():Tab should give access to those functions.
@simonvanderveldt Defaulting to opening on a new tab seems strange. I haven't found that to be the default on any editors I've used. Maybe you're confusing tabs and splits?
I belive internal/action/tab.go might be the key for what is needed to close this issue in Micro v2. Accessing
micro.CurPane():Tabshould give access to those functions.
OK, I'll see if I can get it to work, don't really know how the lua to go mapping works but I can probably figure that out :)
@simonvanderveldt Defaulting to opening on a new tab seems strange. I haven't found that to be the default on any editors I've used. Maybe you're confusing tabs and splits?
Hmm, that's strange, from all of the editors I've used zero open files in a split, all of them open files in a new or existing tab. The editors I'm comparing against are GUI editors, which micro would be a replacement for for me. To be specific: IntelliJ, Sublime, Atom, VS Code. Which ones have you used that open in a split?
Hmm. Maybe it's been too long since I've used those to remember if it's a tab or split. I thought VS opened in splits.
Nerdtree opens in splits or tabs depending on keypressed, which was what I based the features in my rework on. Could do something like that for this plugin, just need to find another key besides tab that works on scratch-type Micro panes.
This works for me for the basic action of opening a file in a new tab
micro.CurPane():NewTabCmd({scanlist[y].abspath})
But it seems like tabs always take up the whole screen? :confused: I expected tabs to be nestable in splits (specifically a vsplit) but I've been unable to get that to work.