Daniel Lemire's blog

, 8 min read

Using Vim under Cygwin

12 thoughts on “Using Vim under Cygwin”

  1. Zbigniew Lukasiak says:





    You can use the -m ‘log_message’ option for the commit to enter the comments.

  2. Zbigniew Lukasiak says:

    -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.

  3. 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.

  4. Dr.M says:

    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.

  5. Luc Hermitte says:

    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.

  6. TidyTim says:

    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 “–“.

  7. Gregg says:

    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.

  8. Lucas says:

    Thanks Gregg! Worked just fine!

  9. dude says:

    Greg is right
    touch.exe ~/.vimrc
    and you don’t need to install the other vim, cygwin vim suddenly starts working just fine!!

  10. martianpackets says:

    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.

  11. martianpackets says:

    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!

  12. Chandan Choudhury says:

    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