oni icon indicating copy to clipboard operation
oni copied to clipboard

Feature request: Create a new file from Ctrl+P menu

Open SkyLeite opened this issue 8 years ago • 14 comments

The Ctrlp extension allows you to type the path of a file and press Ctrl+Y to create it if it doesn't exist. This is a super handy feature, as it lets the user create new files without taking their hands off the keyboard.

SkyLeite avatar Apr 21 '18 14:04 SkyLeite

Hello and welcome to the Oni repository! Thanks for opening your first issue here. To help us out, please make sure to include as much detail as possible - including screenshots and logs, if possible.

oni-bot avatar Apr 21 '18 14:04 oni-bot

Check #1839 which was merged some days ago. It's more "vim style".

tarciozemel avatar Apr 21 '18 14:04 tarciozemel

@Kxze I'm currently working on increased explorer functionality as @tarciozemel pointed out with #1839 and also in #2115 the next PR i'll be adding will be using probably e binding to add a new file in the explorer, the idea being you move to the selected folder where you want the file using h,j,k,l then hit e to get an input where you'd type in the file name to create a new file (and have this be undoable with u)

akinsho avatar Apr 21 '18 16:04 akinsho

@Akin909 I have a suggestion, when cursor over a file in a particular folder o, opens the dialog to create a new file as well, has the same semantic idea of a new line on vim.

badosu avatar Apr 23 '18 11:04 badosu

@badosu #2130 adds the ability to press <c-e> (e seemed too easy to hit by accident, but can easily be rebound) over a file or folder and if a folder is selected the the new file or folder is created within it so I think if i'm understanding it right it should already do what you're suggesting? (although the binding is different)

akinsho avatar Apr 23 '18 13:04 akinsho

Is there anything pending with this issue? A lot of ideas were thrown around but all the referenced pull requests have been merged in so this issue feels "done" to me.

keforbes avatar May 25 '18 16:05 keforbes

I'm just going to close this issue and see if anyone complains. :stuck_out_tongue:

keforbes avatar May 25 '18 16:05 keforbes

What was merged and referenced was sidebar explorer code. If I understand OP correctly he wants to be able to press <Ctrl+Shift+P>, type something like "New file" and be able to create new file that way. I think it's quite different from sidebar explorer user experience.

dkns avatar May 25 '18 19:05 dkns

Yes, the question is whether this functionality is necessary given the explorer functionality.

Em Sex, 25 de mai de 2018 16:36, Daniel Kosiński [email protected] escreveu:

What was merged and referenced was sidebar explorer code. If I understand OP correctly he wants to be able to press <Ctrl+Shift+P>, type something like "New file" and be able to create new file that way. I think it's quite different from sidebar explorer functionality.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/onivim/oni/issues/2129#issuecomment-392159364, or mute the thread https://github.com/notifications/unsubscribe-auth/AAVNoORSuSGFq3IFZ6xjCIAEBCGGc5suks5t2F1LgaJpZM4Teeit .

badosu avatar May 25 '18 20:05 badosu

For what it's worth, @Akin909 described his alternative solution using the explorer and the OP responded with hooray emoji so I assumed it was an acceptable alternative. I guess there's just a question of whether we want to implement a feature as originally described or if we just want to make an OP happy. :slightly_smiling_face:

keforbes avatar May 25 '18 20:05 keforbes

I love the new explorer functionality but personally I still think the originally asked feature would be desirable, considering it's something many Vim/Neovim users have already adapted into their workflow. I'm personally fine with either, it's just a matter of whether there's demand for the Ctrl + P menu in my opinion.

SkyLeite avatar May 25 '18 20:05 SkyLeite

OP has spoken! Re-opening.

keforbes avatar May 25 '18 20:05 keforbes

In neovim a user can create a new file by using the command line :e new.txt or a host of dozens of other alternatives including :vsp newThing.js or :sp otherThing etc. whilst I think oni tutorials could surface this, an implementation of this feature is essentially going to be registering a command that does this behind the scenes, which I personally think is duplicating existing but perhaps less readily accessible functionality

akinsho avatar May 25 '18 23:05 akinsho

I agree with @Akin909, IMO there's a limit on how much we want to hold the hand of the user.

Having this would be contraproductive IMO with regard to using existing functionality, however if someone want to add an entry to Ctrl+Shift+P I would not be against it.

I just think this would be unnecessary complexity, will you always create a file in the root folder, if not how to specify, etc...?

badosu avatar May 25 '18 23:05 badosu