Closed wizzup closed 4 years ago
This is definitely doable... Just need a hash of domain names and corresponding file extensions and create the temp file based on the host name in the incoming url.
Would you mind giving it a shot?
I might want to use more than one file extension on a domain . I think what I really want is to be able to have command like :GhostSetFileExt ext
after server is started. I have no idea how to do that. I know virtually nothing about writing neovim plugin.
I am thinking of how I can do that without server need to be restart because it would require reactivate ghosttex browser extension.
BTW this is what I have so far a46091800e57e425e32878f591dc1908f6281564
I might want to use more than one file extension on a domain .
That might not be feasible to do automatically since we get only so much info from the browser plugin.
command like :GhostSetFileExt ext after server is started.
just set a vimscript variable in the command and you can read the value of the variable when the browser connects. See the setting for ghost port - it can be set on the vim side and read in the python code.
You can change the vimscript var and that's not tied to the server lifetime itself.
@wizzup I have been using a Windows program called Text Editor Anywhere which let your define extensions and the editors to edit the text area. When you activate this program, it lets you select the extension you want to use and open a temp file inside the editor of your choice (so it can be neovim-qt in my case). After you finished writing the text, the text will be copied to the text area.
You can give a try if you use Windows.
@jdhao Thank for the info but I don't have any Windows machine and I only trust in opensource software.
+1 for this feature request
GhostText is the only extension I know that work on site like HackerRank (codemirror editor)
Setting
filetype
in vim work for syntax highlight but external tools (linter, repl) will refuse to treat a file as source code (in my case is Haskell).I could do a dirty edit to ghost.py but it would be ugly and only work for single language.
It would be great if temporary file extension is configurable (
let ghost_temp_ext=hs
, for example)