vimtutor only starts the terminal version of vim.   Since vimtutor
is for newbies, it would good if vimtutor could also start in gvim.
Some beginners may feel more comfortable with gvim rather than
vim.

I just wrote a simple patch which adds an optional -g argument
to start vimtutor in gvim rather than vim  (by default, it starts vimtutor
in vim).

-- Dominique

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Index: src/vimtutor
===================================================================
RCS file: /cvsroot/vim/vim7/src/vimtutor,v
retrieving revision 1.2
diff -c -r1.2 vimtutor
*** src/vimtutor	17 Jul 2007 12:33:46 -0000	1.2
--- src/vimtutor	5 Apr 2008 09:22:14 -0000
***************
*** 2,12 ****
  
  # Start Vim on a copy of the tutor file.
  
! # Usage: vimtutor [xx], where xx is a language code like "es" or "nl".
  # When an argument is given, it tries loading that tutor.
  # When this fails or no argument was given, it tries using 'v:lang'
  # When that also fails, it uses the English version.
  
  xx=$1
  export xx
  
--- 2,25 ----
  
  # Start Vim on a copy of the tutor file.
  
! # Usage: vimtutor [-g] [xx]
! # Where optional argument -g starts vimtutor in gvim (GUI) instead of vim.
! # and xx is a language code like "es" or "nl".
  # When an argument is given, it tries loading that tutor.
  # When this fails or no argument was given, it tries using 'v:lang'
  # When that also fails, it uses the English version.
  
+ # Vim could be called "vim" or "vi".  Also check for "vimN", for people who
+ # have Vim installed with its version number.
+ # We anticipate up to a future Vim 8 version :-).
+ seq="vim vim8 vim75 vim74 vim73 vim72 vim71 vim70 vim7 vim6 vi"
+ if test "$1" = "-g"; then 
+   # Try to use the GUI version of Vim if possible, it will fall back
+   # on Vim if Gvim is not installed.
+   seq="gvim gvim8 gvim75 gvim74 gvim73 gvim72 gvim71 gvim70 gvim7 gvim6 $seq"
+   shift
+ fi
+ 
  xx=$1
  export xx
  
***************
*** 39,48 ****
  # remove the copy of the tutor on exit
  trap "rm -rf $TODELETE" 0 1 2 3 9 11 13 15
  
- # Vim could be called "vim" or "vi".  Also check for "vimN", for people who
- # have Vim installed with its version number.
- # We anticipate up to a future Vim 8 version :-).
- seq="vim vim8 vim75 vim74 vim73 vim72 vim71 vim70 vim7 vim6 vi"
  for i in $seq; do
  	testvim=`which $i 2>/dev/null`
  	if test -f "$testvim"; then
--- 52,57 ----
***************
*** 59,65 ****
  
  # Use Vim to copy the tutor, it knows the value of $VIMRUNTIME
  # The script tutor.vim tells Vim which file to copy
! $VIM -u NONE -c 'so $VIMRUNTIME/tutor/tutor.vim'
  
  # Start vim without any .vimrc, set 'nocompatible'
! $VIM -u NONE -c "set nocp" $TUTORCOPY
--- 68,74 ----
  
  # Use Vim to copy the tutor, it knows the value of $VIMRUNTIME
  # The script tutor.vim tells Vim which file to copy
! $VIM -f -u NONE -c 'so $VIMRUNTIME/tutor/tutor.vim'
  
  # Start vim without any .vimrc, set 'nocompatible'
! $VIM -f -u NONE -c "set nocp" $TUTORCOPY
Index: runtime/doc/vimtutor.1
===================================================================
RCS file: /cvsroot/vim/vim7/runtime/doc/vimtutor.1,v
retrieving revision 1.1
diff -c -r1.1 vimtutor.1
*** runtime/doc/vimtutor.1	13 Jun 2004 16:50:18 -0000	1.1
--- runtime/doc/vimtutor.1	5 Apr 2008 09:22:14 -0000
***************
*** 3,9 ****
  vimtutor \- the Vim tutor
  .SH SYNOPSIS
  .br
! .B vimtutor [language]
  .SH DESCRIPTION
  .B Vimtutor
  starts the
--- 3,9 ----
  vimtutor \- the Vim tutor
  .SH SYNOPSIS
  .br
! .B vimtutor [-g] [language]
  .SH DESCRIPTION
  .B Vimtutor
  starts the
***************
*** 18,23 ****
--- 18,26 ----
  .B Vim
  commands.
  .PP
+ The optional argument -g starts vimtutor with gvim rather than vim, if the
+ GUI version of vim is available, or falls back to Vim if gvim is not found.
+ .PP
  The optional [language] argument is the two-letter name of a language, like
  "it" or "es".
  If the [language] argument is missing, the language of the current locale will

Raspunde prin e-mail lui