willothy / flatten.nvim

Open files and command output from wezterm, kitty, and neovim terminals in your current neovim instance
https://luarocks.org/modules/willothy/flatten.nvim
MIT License
497 stars 13 forks source link

Allow to configure where to open files #3

Closed Allaman closed 1 year ago

Allaman commented 1 year ago

Hi, thanks for this plugin! I just tried it with your settings for toggle-term and it works perfect.

There is one thing I would appreciate. Currently, a file is opened in a new tab. As I never work with tabs, it would be wonderful if there is an option allowing you to open a file in the current window.

willothy commented 1 year ago

Definitely, that's a good idea. I'll add some options for where to open files with the next update! Do you think it'd be useful to configure file open locations for specific filetypes, or would you prefer a setting that applies to all filetypes?

Allaman commented 1 year ago

Thanks in advance :)

In my opinion, applying this option to all file types is sufficient.

willothy commented 1 year ago

Sounds good, glad you like the plugin :)

willothy commented 1 year ago

Okay, working on this right now. I'm adding options for opening in a tab (as it already does), in a split, vsplit, or in the current window. You'll also be able to provide a function instead of a string if you want to handle the window opening yourself, and the bufnr of the opened file will be passed to it as an argument.

willothy commented 1 year ago

If there are any more related requests / comments, please add them to #5 :)

Allaman commented 1 year ago

It works like a charm! Thanks!