Jelmerro / Vieb

Vim Inspired Electron Browser - Vim bindings for the web by design
https://vieb.dev
GNU General Public License v3.0
1.29k stars 61 forks source link

Add a setting to customize the `action.editWithVim` filename #547

Open Jelmerro opened 3 months ago

Jelmerro commented 3 months ago

Discussed in https://github.com/Jelmerro/Vieb/discussions/546

Originally posted by **slalik** March 11, 2024 I think it would be useful to call vim with some options depending on the site. For example, on a webmail it could be `vim -c "set filetype=mail textwidth=72 spell"`, on a forum `vim -c "set filetype=bbcode spell"` and so on. Is it possible to do this? I can imagine an external approach, for example, to have a script that first read the title of the active window (say, `xdotool getactivewindow getwindowname`) and then call vim with needed options. But I think it would be better to be able to do this using Vieb, for example, Vieb could add the domain to the filename, something like `.example.org` (this is how it works in the ["Browser's external editor" Chrome extension](https://chrome.google.com/webstore/detail/browsers-external-editor/moakhilhbeednkjahjmomncgigcoemoi))

Probably best to do in the form of a filename setting for this edit action that supports templating.