I knew about the “-m” command, but also, under windows, one can use Tortoise CVS, you then have a nice GUI to take care of all your CVS trouble. But I remain a command line freak. So I should get in the habit of using -m, it is probably faster in the long run anyhow.
I do not really like to post such plain advertizes, but I think the script I’m maintening, cyg-wrapper.sh, could solve both your problems. (If I understand how the blog works, just click on my name to access to the script).
Regarding Vim, look at the example given on the web page. Regarding cvs, declare -m as a binary-argument. BTW, Vim plugin, cvsmenu, is quite addictive — though I have used it only on Solaris.
NB: As cyg-wrapper is just a bash script, it may take some time when to many filenames need to be converted.
HTH.
TidyTimsays:
The script as given above will only edit one file. What if you want to edit several files? What if you want to edit several files and start all open in their own frame? If you add the “-o” switch cypath will take it as a option so it probably produce an error and it won’t get passed to Vim.
Here’s a more useful variation (assuming the Bash shell):
“/cygdrive…/vim.exe” $(cygpath -w — $*) &
Cygpath ignores options after the “–“.
Greggsays:
I experienced several issues using vim ( ex – pressing “i” didn’t put it into INSERT mode ), i created a blank file ~/.vimrc and everything worked great.
Lucassays:
Thanks Gregg! Worked just fine!
dudesays:
Greg is right
touch.exe ~/.vimrc
and you don’t need to install the other vim, cygwin vim suddenly starts working just fine!!
martianpacketssays:
creating a blank .vimrc file in ~/ to make cygwin-installed vim or gvim behave correctly, is the most brilliant idea I’ve seen so far in 2011.
martianpacketssays:
so I took it to the next level. I went to my most-used linux shell, grabbed my .vimrc file, and scp’d it into my cygwin ~/ folder. Now I am in business!
Chandan Choudhurysays:
I am not able to run gvim from cygwin. When I try to open a new file with :
gvim filename gvim opens 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
You can use the -m ‘log_message’ option for the commit to enter the comments.
-m message
Use message as log information, instead of invoking an editor.
Available with the following commands: add, commit and import.
From cvs man page.
Thanks. Indeed a good alternative.
I knew about the “-m” command, but also, under windows, one can use Tortoise CVS, you then have a nice GUI to take care of all your CVS trouble. But I remain a command line freak. So I should get in the habit of using -m, it is probably faster in the long run anyhow.
cat ~/.bashrc
vi(){ # windows.
vifile=${@:-$vifile}; # use last file or argv
vifile=$(cygpath -m $@) # dos paths
c:/bin32/gvim $vifile &
}
I too just started using cygwin and tortoise-cvs.
Hello.
I do not really like to post such plain advertizes, but I think the script I’m maintening, cyg-wrapper.sh, could solve both your problems. (If I understand how the blog works, just click on my name to access to the script).
Regarding Vim, look at the example given on the web page. Regarding cvs, declare -m as a binary-argument. BTW, Vim plugin, cvsmenu, is quite addictive — though I have used it only on Solaris.
NB: As cyg-wrapper is just a bash script, it may take some time when to many filenames need to be converted.
HTH.
The script as given above will only edit one file. What if you want to edit several files? What if you want to edit several files and start all open in their own frame? If you add the “-o” switch cypath will take it as a option so it probably produce an error and it won’t get passed to Vim.
Here’s the original script:
“/cygdrive/c/Program Files/Vim/vim63/vim.exe” `cygpath -w $1`
Here’s a more useful variation (assuming the Bash shell):
“/cygdrive…/vim.exe” $(cygpath -w — $*) &
Cygpath ignores options after the “–“.
I experienced several issues using vim ( ex – pressing “i” didn’t put it into INSERT mode ), i created a blank file ~/.vimrc and everything worked great.
Thanks Gregg! Worked just fine!
Greg is right
touch.exe ~/.vimrc
and you don’t need to install the other vim, cygwin vim suddenly starts working just fine!!
creating a blank .vimrc file in ~/ to make cygwin-installed vim or gvim behave correctly, is the most brilliant idea I’ve seen so far in 2011.
so I took it to the next level. I went to my most-used linux shell, grabbed my .vimrc file, and scp’d it into my cygwin ~/ folder. Now I am in business!
I am not able to run gvim from cygwin. When I try to open a new file with :
gvim filename gvim opens 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
Thanks,
Chandan