Open rickalex21 opened 3 years ago
Hey, do you mean you want to add something like NerdTree
plugin?
I'm asking because of:
Yes, something like that but a gui version since this is Macvim. This is what I'm talking about.
I don't really use the project files '.vscode' but I'm sure others find them useful. Ya I agree with you on '2', that's why I was suggesting this feature.
I don't understand how to properly implement this without breaking "pure Vim" experience as MacVim currently has
I'm sure there will be changes that would have to be made but I don't know to what extent. I would imagine that this would need to be separated from vim to prevent things from breaking and have an intermediate module to reflect changes in vim windows. For example, if a user clicks on a file then it should be shown in the vim window. This is not much different from File -> open.
What's about opening files from the same project from terminal? What's about other corner cases?
I think opening workspace folders from the menu on macvim is fine. The main idea is the ability to drag and drop stuff into folders just like you can in visual studio code.
OK, while generally agree with this idea and willing to have this in MacVim implemented, I have questions before we start implementation to be on the same page and not to make a thing won't be totally needed by others
let's imagine, we have this feature implemented. Where is the root directory? or /
is the root directory and we show tree as NerdTree
? How we can define workspace? what would be saved there?
There's sessions in Vim, as an already implemented feature, and we theoretically can extend it by adding something used only by MacVim (some work could be required in the upstream, but it's ok)
Where is the root directory? or / is the root directory and we show tree as NerdTree?
Make it work the same way vscode works. I'm not a big fan of terminal file explorers when it comes to web development so I can't comment much on nerd tree, netrw, or any other file explorer.
How we can define workspace? what would be saved there?
By saving the workspace, I mean just save what files and folders I have open. I know mksession does this but it does not have gui folders. As you can see in the image above I have two folders pandoc and wiki along with a makefile. That was all restored from a workspace save. Which basically is just a json file, another method of saving would need to be used by macvim.
{
"folders": [
{
"path": "../../pandoc"
},
{
"path": "../../hugo/wiki"
}
],
"settings": {
"liveServer.settings.multiRootWorkspaceName": "pandoc"
}
}
Only implement the basic stuff first. You can always add features later on like ability to save workspace or mksession. For now just the basics.
It would look like this, you would click on a file and it would show up in the terminal. Nerdtree and other file explores do this but it's not as fluid like in a gui where you can drag and drop.
Sweet, I like the idea more and more.
There's my thoughts on how to integrate this feature as smooth as possible to MacVim without breaking "pure vim" experience. (this could lead to PRs in Vim)
On file format for sessions/workspace, I'd extend existing Vim mechanism (see notes below)
let's imagine following scenarios: prerequisites:
I have scenarios, multiplied by how I open files. How MacVim should behave?
test.py
from folder inside written in session file as the basetest.c
from folder outside written in session file as the baseLet's multiply this by:
File -> New window
File -> New tab
$ vim filename
, and have setting enable "open in new window"$ vim filename
, and have setting enable "open in current window"What user actions will change session file? how these actions could be customized?
I see following constraints and integrations points to introduce it as smooth as possible by inviting as many users as possible without creating a monster with "Mac"-specific UI
Sessions:
File Tree:
vimrc
. ideally - every aspect. PS: These constrains doesn't neglect drag&drop fluidness and other features you mentioned. I try to involve to this as many people as possible, not only MacVim community, but whole Vim community!
These constrains doesn't neglect drag&drop fluidness and other features you mentioned. I try to involve to this as many people as possible, not only MacVim community, but whole Vim community!
Yes I agree with you it should be feature rich and something that everyone would want to use :) . As far as the technical details go, I wouldn't be much help since I'm not familiar with developing for Mac, swift, or the macvim code. The developers in macvim would know more about how to do this. As long as it has a similar file explorer to visual studio code I'm fine with it. I just want to drag and drop files, move folders around etc... You can download visual studio code or vscodium if you would like to check it out.
So now you want this? Try keyword: fern 🌿🌿 (my keyboard shortcut is
@nyngwang great tool, thanks, I'll give it a try
The only thing it doesn't satisfy is drag-n-drop feature inside MacVim, from and out :) This is why I'd like to have a standardized GUI drawer, not the text-only.
PS: this won't make such plugins obsolete as text-only UI for Vim is widely used and I'd prefer to have them around
The only thing it doesn't satisfy is drag-n-drop feature inside MacVim, from and out :) This is why I'd like to have a standardized GUI drawer, not the text-only.
PS: this won't make such plugins obsolete as text-only UI for Vim is widely used and I'd prefer to have them around
@eirnym What do you mean drag-n-drop feature? In my case the vertical bar can be adjusted like this without trouble, the following is done in sequence, it looks like Vim but I'm actually using MacVim, the trick is that I set the titlebar of MacVim Hidden
:
Adjust left:
Move bottom up:
Adjust right:
Move bottom down:
@nyngwang
What do you mean drag-n-drop feature?
The ability to easily move images, files, etc... in and out of folders with the mouse. I wouldn't suggest it on vim but since this is MacVim a 'gui' version of vim, it would be a nice feature to have.
Thanks to everyone for their contributions to this project. Are there any plans of including a feature like a gui file explorer on the side like visual studio code workspace folders?
I understand that this is vim but this is the 'gui' version of vim. There are text based file explorers out there but when it comes to web development I find myself going back to visual studio code every time. I'm not new to vim, I've created lots of personal vim plugins. I just find it easier in vscode to go in and out of folders, drag and drop folders/images/files etc.. Once everything is set, I go back to vim.
You could have an option to hide or show the folder workspace if people want to use it.