fregante / GhostText

👻 Use your text editor to write in your browser. Everything you type in the editor will be instantly updated in the browser (and vice versa).
https://GhostText.fregante.com
MIT License
3.31k stars 117 forks source link

Use file names corresponding to webpages URLs #119

Closed doronbehar closed 6 years ago

doronbehar commented 6 years ago

Back in Firefox version <57, when we used itsalltext, the add-on opened a .txt file and the name of the file corresponded to the URL of the webpage. For example, for the webpage I'm editing right now, the file name would be something like github.com_GhostText_GhostText_issues_new_jakd1312.txt (including the random characters). In addition, I told itsalltext to open a terminal emulator with Vim and the said file. Next, in my Vim configuration, I created a new file type for itsalltext and I detect(ed) the files created by the add-on and set custom settings for files from certain websites.

For example, it enables me to automatically have markdown syntax in my text editor for text areas in webpages like stackexchange's and stackoverflow.com's, or mediawiki syntax in Wikipedia-like pages.

For those who don't know Vim-Lang, I use regular expressions to set custom editor settings for files whose paths'/names' match the expressions. I don't how many of you people here use Vim/Neovim but it is one of it's best feature and I really miss having it.

I hope it's not that hard to implement it as well.

Thanks for a wonderful application.

fregante commented 6 years ago

This is part of #95

Currently the URL is already sent to the editor, however I doubt it’s actually implemented by any editor plugin except the official one (sublime). Your best bet now is to make a pull request to the vim plugin repo if it isn’t already supported, and/or help me work towards #95

Additionally I’m not sure of what you’re referring to with terminal emulation but I think that’s not gonna be possible with the current extension framework.