susam / vimer Goto Github PK
View Code? Open in Web Editor NEWDeclutter your desktop by opening files in existing instance of GVim/MacVim
License: MIT License
Declutter your desktop by opening files in existing instance of GVim/MacVim
License: MIT License
I was perusing the code here after seeing this on lobste.rs, and I was very confused by the following line,
Line 185 in 23a5246
I don’t have a Windows computer handy to see if there’s anything going on that I’m missing, but based on the comment it sounds like this just creates an empty file, a la touch
on *nix. If this indeed is what’s going on, copy nul > file
is a more supported (and potentially faster) way to do just that.
Occasionally, I like to have two gui windows (e.g. multi monitor setup or multiple OSX spaces/Linux workspaces).
Therefore, gui window 1 has a certain set of files open and also the gui window 2. both sets are disjoint.
For simplicity, gui window 1 has file1 and gui window 2 has file2.
I would like to run following commands:
$ vimer +20 file1
$ vimer +40 file2
which should open the correct gui window and reposition the cursor.
My use case is a latex setup using synctex. That means the pdf viewer is re-opening/focusing gvim/mvim and moves appproximately the cursor to the line where you have clicked in the pdf viewer.
Do you think you would like to extend your script to handle multiple gvim servers?
See also
https://sourceforge.net/p/skim-app/wiki/TeX_and_PDF_Synchronization/#tex-pdf-synchronization
and possibly helpful
http://www.vim.org/scripts/script.php?script_id=4131
Hi
Is it possible to update the script to take the vim instance name as an argument where the file would be opened.
If that can be supported that would be super awesome.
Thanks in advance
If gvim is run as a protable application, say installed by scoop, for users without admin rights to access the HKCM branch of the registry, then the vim executable cannot be found. How about a check using where
such as
IF DEFINED EDITOR (
IF EXIST "%EDITOR%" (
SET E=%EDITOR%
) ELSE (
where /q %EDITOR%
IF NOT ERRORLEVEL 1 (
SET E=%EDITOR%
)
)
)
IF NOT DEFINED E (
where /q vim
IF ERRORLEVEL 1 (
SET E=start /b notepad
) ELSE (
SET E=vim
)
)
to look for it in the (user's) %PATH%
?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.