Article directory
GVim on the Cygwin platform is X-based.
If you want to use GVim, you must first install the ported versions of X such as Cygwin/X, Xming, vcXsrv, MobaXterm, and Xmanager.
To install a bunch of packages such as xserver
, xstart
, xinit
, xorg
and so on.
You need to spend extra hours to install these tools, and then dozens of hours of learning costs.
Edit your code just to run GVim.
For users like me who put CygwinPortable into a USB flash drive, when I plug the USB flash drive into a new computer, I need to start X11 before I can use the Gvim editor.
It's such a hassle that dogs don't need it.
alternative solution
Don't forget, GVim already has a win32 version. GVim download address
And its compressed package version can be directly inserted into the U disk as Portable software.
But please note that the win32 version of GVim here, according to the design, all its files are in the same directory.
Therefore, you cannot directly copy gvim.exe
and paste to the directory of Cygwin /bin
.
Open the root directory of CygwinE:\CygwinPortable_1.4.0.0\App\Runtime\Cygwin
We can see:
d---- 2023/5/28 19:28 %SystemDrive%
d---- 2023/5/26 22:56 bin
d---- 2023/5/26 22:58 dev
d---- 2023/5/26 22:56 etc
d---- 2023/5/26 22:56 home
d---- 2023/5/26 22:58 lib
d---- 2023/5/27 0:00 opt
d---- 2023/5/26 22:56 packages
d---- 2023/5/26 23:01 sbin
d---- 2023/5/26 22:58 tmp
d---- 2023/5/26 22:58 usr
d---- 2023/5/26 22:56 var
-a--- 2023/5/26 23:02 53342 Cygwin-Terminal.ico
-a--- 2023/5/28 20:53 88 Cygwin.bat
-a--- 2023/5/26 23:02 157097 Cygwin.ico
-a--- 2023/5/26 22:56 1388051 CygwinConfig.exe
-a--- 2023/5/27 1:17 616 setup.log
-a--- 2023/5/27 1:17 730 setup.log.full
There is a /opt
directory in it. For the function of this directory, you can refer to the big brother's blog Linux - about the description of the /opt folder
We can:
- Deploy the win32 release compressed package of GVim to
/opt/
the following - Add
/opt/Vim/vim[版本]
this path to Cygwin's environment variables.
So far what we have to do is very simple.
Method of implementation
- Unzip the downloaded GVim archive,
./Vim/vim[版本]
copy and paste this path to the Cygwin folder.
- Note that it should be
./Vim
copied together with this outer folder.
For example, I am using GVim90 here, then the path of gvim.exe is:
/opt/Vim/vim90/gvim.exe
This is because the win32 version of the GVim configuration file is ./Vim/_vimrc
under this path. If you don't copy it together, the program will have some problems when reading it.
Then add some environment variables.
Consistent with the practice of the Linux system, edit /etc/profile/
and add this path to the environment variable.
nano /etc/profile
Add the following:
# The Dictionary of my Own Gvim90
export PATH=$PATH:/opt/Vim/vim90/
Restart Cygwin Bash after saving and exiting, enter gvim
.
It can be seen that the classic Cold War style window of the last century has come out.
Simply configure it and molokai.vim
copy it to ./colors
the folder.
Then copy the configuration file in the computer and change it.
This looks pretty good.