kitty-runner.nvim icon indicating copy to clipboard operation
kitty-runner.nvim copied to clipboard

Add options to KittyOpenRunner

Open venzen opened this issue 1 year ago • 1 comments

It would be useful to be able to add options to the KittyOpenRunner command. For example, specifying a kitty layout or running a shell command via the kitty option cmdline:

I guess a logical place to specify such options would be in the lua config file. Perhaps by adding a config option "open_opts" that then gets concatenated during the open_and_or_send() function.

@jghauser if you think this is a reasonable approach then I can code it and send a pull request with updates to the README too.

Any suggestions would be welcome. Understand that my goal here is to always open kitty with the same (alternate) layout and with an instance of vim-tiny running before I start sending lines. I've tried to automate this process with a keymap (in Normal mode and using KittyRunCommand) but once Nvim enters Command mode I cannot specify the command text from the keymap. Workarounds welcome.

venzen avatar Sep 12 '22 08:09 venzen

Hey @venzen! Sorry for the slow response!

I think this sounds like a great idea! What do you mean with the cmdline option? A quick search in the man files doesn't seem to yield any results. I'm not sure the open_or_send() function is the right place as the kitty instance is opened in M.open_runner(). Would having a custom extension of the the args table in M.open_runner() achieve what you need? I'm thinking that we could have something like extra_opts in the config which is merged into the args table. What do you think?

I'm not sure if we need to consider something regarding the order of the options but that should be easy to figure out.

Feel free to hack away and send a PR, I'll be more than happy to take a look!

jghauser avatar Sep 16 '22 06:09 jghauser