I am not able to run gvim from cygwin. When I try to open a new file with :
gvim filename gvim opens a file with 'No name' and displays error as :
Error detected while processing command line
E492: Not editor command: C:\cygwin\home\chandan\l
Press enter or type command to continue
More problematic is that I can't open existing file in the path
>which gvim
shows /usr/bin/gvim
I have put alias gvim=/cygdrive/c/Program\Files\(x86\)/Vim/vim73/gvim.exe
still
Vim is a text editor that is based on the Vi editor, which is common to UNIX-like systems. gVim is the GUI version of Vim. This article is a detailed account on how to install gVim on a Windows 7 machine along with Git, Pathogen and plugins.
I wrote cyg-wrapper.sh for this sole purpose.
It supports:
-c
with gvim, or any flags starting with a minus sign).In other words, it enables us to type:
gvim /etc/profile -c /PS1 -c "echo 'correctly opened'"
# or even:
cd ~/tmp ; ln -s ~/bin/cyg-wrapper.sh
gvim -d http://hermitte.free.fr/cygwin/cyg-wrapper.sh cyg-wrapper.sh
explorer -e
explorer "$vim"
explorer http://hermitte.free.fr/
Note: I use the following function in my .profile to run gvim with cyg-wrapper.sh
gvim() {
opt=''
if [ `expr "$*" : '.*tex\>'` -gt 0 ] ; then
opt='--servername LATEX '
fi
cyg-wrapper.sh "C:/Progra~1/Edition/vim/vim73/gvim.exe" --binary-opt=-c,--cmd,-T,-t,--servername,--remote-send,--remote-expr --cyg-verbose --fork=2 $opt "$@"
}
EDIT: Currently (Sept 26 2014, using Vim 7.4), Windows gVim uses C:\Windows\gvim.bat
to launch gVim from the command line. Replacing the gvim.exe
path in the gvim()
function with this script allows launching gvim without changing the path to match the current Vim version (which may actually be in Progra~2
); however, it appears to also open a superfluous cmd.exe
window.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With