Re: create a "fill-in" macro.

2007-03-14 Thread Thomas

Can you create and activate a macro that goes like this:
[Activate macro]
First-Name: [first fill-in place] Last-Name: [second fill in place] 
Country: [third fill-in place]
[Macro ended]
So that when you fill this in you get in insert-mode this as plain text:

First-Name: Eric Last-Name: Leenman
Country: Holland


There are some plugins that do this:

http://www.vim.org/scripts/script_search_results.php?keywords=skeleton
http://www.vim.org/scripts/script_search_results.php?keywords=template

Regards,
Thomas.



Re: Search and replace

2007-03-14 Thread François Ingelrest

I'm not an expert with this, but this should work with your example:

%s/!(\(.*\)=\(.*\))!(\(.*\))/(\1)!(\3=\2)!

On 3/15/07, Tien Pham <[EMAIL PROTECTED]> wrote:

Hi all

I have a pattern for "search and replace" but I couldn't figure out how to
do it correctly. I suppose my problem is so simple for many people, but
it's not to me. Thus, help is very much appreciated.


Existing pattern:
!(All,r,ROW=gas)!(All,c,COL)
!(All,r,ROW=water)!(All,c,COL)
!(All,r,ROW=building)!(All,c,COL)


What I need now is:
(All,r,ROW)!(All,c,COL=gas)!
(All,r,ROW)!(All,c,COL=water)!
(All,r,ROW)!(All,c,COL=building)!

Again, your help is greatly appreciated.
tien


Get date and filename as plain text

2007-03-14 Thread Eric Leenman

Hi,

Is it possible to make an inoremap that inserts the date as text and the 
filename as text?


For example:

inoremap @date   {insert_date_as_text()}
inoremap @filename   {insert_filename_as_text()}


Rgds,
Eric

_
Get a FREE Web site, company branded e-mail and more from Microsoft Office 
Live! http://clk.atdmt.com/MRT/go/mcrssaub0050001411mrt/direct/01/




create a "fill-in" macro.

2007-03-14 Thread Eric Leenman

Hi,

Is it possible to create a "fill-in" macro in VIM?
For example:
Can you create and activate a macro that goes like this:
[Activate macro]
First-Name: [first fill-in place] Last-Name: [second fill in place] 
Country: [third fill-in place]
[Macro ended]
So that when you fill this in you get in insert-mode this as plain text:

First-Name: Eric Last-Name: Leenman
Country: Holland

Rgds,

Eric

_
The average US Credit Score is 675. The cost to see yours: $0 by Experian. 
http://www.freecreditreport.com/pm/default.aspx?sc=660600&bcd=EMAILFOOTERAVERAGE




Search and replace

2007-03-14 Thread Tien Pham

Hi all

I have a pattern for "search and replace" but I couldn't figure out how to 
do it correctly. I suppose my problem is so simple for many people, but 
it's not to me. Thus, help is very much appreciated.



Existing pattern:
!(All,r,ROW=gas)!(All,c,COL)
!(All,r,ROW=water)!(All,c,COL)
!(All,r,ROW=building)!(All,c,COL)


What I need now is:
(All,r,ROW)!(All,c,COL=gas)!
(All,r,ROW)!(All,c,COL=water)!
(All,r,ROW)!(All,c,COL=building)!

Again, your help is greatly appreciated.
tien



register quoteplus - addition

2007-03-14 Thread ego1gri-lugr
In addition to my posting yesterday, i want to add:
- I`m working under kde and gnome (the actually
versions in the distribution opensuse 10.2; I`m now
not at home, therefore can`t say the number).
- If I do a selection in vim with the mouse, I can
past it, i. e., in an web browser. But I activate
linenumbers in vim an the selection via mouse includes
the numbers - and the pasting too. That`s awful.
- If I do a selection via the keybord (my normal way)
with  and cursor up/down, I get the really
text without the linenumbers; but I cannot put the
selection in the quoteplus-register with
<+>.
Under SuSE 10.1 all works. But I not remember, how I
compiled vom that time.
Anynoe knows, where`s the reason?
Thanks,
 
Dada

.
.
.
.
.
.
.




___ 
Telefonate ohne weitere Kosten vom PC zum PC: http://messenger.yahoo.de


How to convert all the buffers into tab

2007-03-14 Thread lin q

Hi,
 I usually have such problem: in VIM7 i have many files opened in old way, 
meaning they are in buffers, now I want to have them opened in TAB, each tab 
has one buffer.


Is there a simple way to do this?

Thanks.

_
Rates near 39yr lows!  $430K Loan for $1,399/mo - Paying Too Much? Calculate 
new payment 
http://www.lowermybills.com/lre/index.jsp?sourceid=lmb-9632-18226&moid=7581




Re: clone a vim session into a new tab

2007-03-14 Thread Bram Moolenaar

Andy Wokula wrote:

> >> Ok tabpages are included in the session per default.  Try
> >> :set sessionoptions-=tabpages
> >> first.
> >>
> > 
> > Awesome! Thanks a lot!
> > 
> >> :help 'sessionoptions'
> >>
> > 
> > The help is a bit confusing. It says
> > 
> > There is no option to include tab pages yet, only the current tab 
> > page
> > is stored in the session. |tab-page|
> > 
> > But in reality, it stores all the tab pages. Is this a bug in the
> > documentation? or am I misreading something?
> > 
> > raju
> 
> Confuses me too.  Looks like some forgotten beta version note.

Right, I'll remove it.

-- 
MORTICIAN:Bring out your dead!
  [clang]
  Bring out your dead!
  [clang]
  Bring out your dead!
CUSTOMER: Here's one -- nine pence.
DEAD PERSON:  I'm not dead!
  The Quest for the Holy Grail (Monty Python)

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


Re: complete=custom for path including spaces

2007-03-14 Thread Bram Moolenaar

Raphael Bauduin wrote:

> I'm writing a command with a custom completion, and it works fine,
> except when there's a space in the "path" to complete.
> 
> For example, without spaces everything works:
>:Radiant edit pages/ho
> will complete to
>:Radiant edit pages/home/
> which I can further complete:
>:Radiant edit pages/home/fi
> to
>:Radiant edit pages/home/first-post/
> 
> If there's a space, it doesn't work:
>:Radiant edit pages/Ho
> is completed to
>:Radiant edit pages/Home\ Page/
> But now, this
>:Radiant edit pages/Home\ Page/A
> doesn't complete it, although my completion function returns what is
> expected as completion:
>pages/Home\ Page/About
>pages/Home\ Page/Articles
> 
> What am I missing here?

Did you try returning the matches without the backslash?

You can also try using "customlist", then Vim will not filter the
results.  The backslash may confuse the filtering.

-- 
"A mouse can be just as dangerous as a bullet or a bomb."
 (US Representative Lamar Smith, R-Texas)

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


Re: How can a script know if we're running without X ?

2007-03-14 Thread A.J.Mechelynck

Dimitar wrote:

* A.J.Mechelynck <[EMAIL PROTECTED]> [070314 07:50]:

How can a Vim script know if we're running without an X connection?


What about if has('gui') ?


No. This wouldn't distinguish a version -gui +x11 +clipboard +clientserver 
running in a non-x console (with no clipboard and no clientserver facilities) 
from the same version running in an xterm (where those facilities are available).





Of course, some cases are obvious, such as

if has('unix') && !has('x11')

meaning we're on Unix with no X11 support compiled-in.

But what about an X-enabled Vim running in console mode, either with the -X command-line switch, or in a terminal 
with no access to an X server?


For instance, I might want to map the following

:map  cc+

in my vimrc, to replace the current line with the clipboard. However that mapping should not be enabled if we have 
no access to the clipboard. So I wrap it in


if has("clipboard") && (&term != "linux")
:map  cc+
:imap  cc+
endif

which takes care of two cases:
- running with no clipboard support compiled-in
- running in the (non-X) linux console (aka /dev/tty)
It doesn't take care, however, of the case when an X-enabled Vim was started as "vim -X" in an xterm. Is there a 
way to check for that in vimscript?



Best regards,
Tony.


Best regards,
Tony.
--
hundred-and-one symptoms of being an internet addict:
111. You and your friends get together regularly on IRC, even though
 all of you live in the same city.



register quoteplus

2007-03-14 Thread ego1gri-lugr
Hello, 
 
my registers quoteplus and quotestar are no longer
working.
  I made an upgrade from Linux SuSE 10.1 with xterm
208 and vim 7.0 (I think, I installed 7.0) to opensuse
10.2 with xterm 222 and vim 7.0.
  The to registers and the mapping
map  :qa!
were no longer working. But the mapping 
map  :w 
did. A downgrade to xterm 208 makes the first mapping
working again. 
  I compiled vim even with --with-features=huge, but
the quoteplus- and quotestar-registers do not.
  Has anyone an idea?
  Thanks,
  
Dada
  

.
.
.
.
.
.
.




___ 
Telefonate ohne weitere Kosten vom PC zum PC: http://messenger.yahoo.de


problem with autocommand and --remote

2007-03-14 Thread Travis Hume

For ages I've had this autocmd defined

autocmd BufEnter * execute "chdir ".escape(expand("%:p:h"), ' ')

Recently I started using vim to edit ruby by invoking it from w/in Eclipse
using

gvim --server eclipse --remote-silent /path/to/file

And the autocmd isn't working for files loaded this way.  I've tried a few
different things, but nothing is working.  After the file loads I can execute
"chdir ".escape(expand("%:p:h"), ' ') and it works fine.

Thanks for the help.

--
Travis Hume
[EMAIL PROTECTED]


Re: How can a script know if we're running without X ?

2007-03-14 Thread Dimitar
* A.J.Mechelynck <[EMAIL PROTECTED]> [070314 07:50]:
> How can a Vim script know if we're running without an X connection?

What about if has('gui') ?

> 
> Of course, some cases are obvious, such as
> 
>   if has('unix') && !has('x11')
> 
> meaning we're on Unix with no X11 support compiled-in.
> 
> But what about an X-enabled Vim running in console mode, either with the -X 
> command-line switch, or in a terminal 
> with no access to an X server?
> 
> For instance, I might want to map the following
> 
>   :map  cc+
> 
> in my vimrc, to replace the current line with the clipboard. However that 
> mapping should not be enabled if we have 
> no access to the clipboard. So I wrap it in
> 
>   if has("clipboard") && (&term != "linux")
>   :map  cc+
>   :imap  cc+
>   endif
> 
> which takes care of two cases:
> - running with no clipboard support compiled-in
> - running in the (non-X) linux console (aka /dev/tty)
> It doesn't take care, however, of the case when an X-enabled Vim was started 
> as "vim -X" in an xterm. Is there a 
> way to check for that in vimscript?
> 
> 
> Best regards,
> Tony.
> -- 
> The government [is] extremely fond of amassing great quantities of
> statistics.  These are raised to the _nth degree, the cube roots are
> extracted, and the results are arranged into elaborate and impressive
> displays.  What must be kept ever in mind, however, is that in every
> case, the figures are first put down by a village watchman, and he puts
> down anything he damn well pleases.
>   -- Sir Josiah Stamp


Re: How can a script know if we're running without X ?

2007-03-14 Thread A.J.Mechelynck

[EMAIL PROTECTED] wrote:

"A.J.Mechelynck" <[EMAIL PROTECTED]> wrote:

The ps solution is difficult to use, because there may be several instances
of Vim running in parallel (whose prognames might or might not be different)
and I want to make sure to access the "current" instance: so I would have to
know the process ID of the current Vim and I don't know how to do that.
Using system('ls -l /proc/self') wouldn't work, because that would return
the PID of the ls process called by a subshell called by Vim.


libcallnr("/usr/lib/libc.so", "getpid", "")

should do the trick on most *nix flavours.

From here, it should be possible to play with /proc related utilities.



Maybe I'found something... or have I?

(first try omitted, it didn't work)
(second try is better)
(third try:)

" (try to) detect whether we have clipboard and X
if has('clipboard')
let x = @+
let @+ = '--' . x
redir @"
silent reg
redir END
let @+ = x
unlet x
let clipboard_present = (@" =~ '^"+ ')
else
let clipboard_present = 0
endif
let X_available = has('x11') && clipboard_present

The above would fail in a Vim compiled with X support but without clipboard
support. I think that that risk is negligible. Do you (or does anyone) see
other cases where the above algorithm would fail? It relies on the fact that
when the clipboard is not available (for whatever reason: not compiled-in,
-X, or terminal with no X access) the ":reg" command never lists the "+
register, not even if we just yanked a nonempty value into it.


Just in case it may help, this code returns 0 in every situation (gvim, vim, vim
-X) in my config (Solaris custom build)
However it seems tied to the fact the "^" prevents '"+' from being matched --
while (@" =~ "\n".'"+ ') is non null. With this new regex, I always end up with
1.


Well, I dodn't test well enough. Here's a new snippet:

" (try to) detect whether we have clipboard and X
if has('clipboard')
function TestForX()
let x = @+
let @+ = '--' . x
redir @"
silent reg
redir END
let @+ = x
"  unlet x
return (@" =~ '\n"+ ')
endfunction
else
function TestForX()
return 0
endfunction
endif
augroup vimrclocal
au VimEnter *
\   let clipboard_present = TestForX()
\ | let X_available = has('x11') && clipboard_present
augroup END
"
" and further down in the vimrc
"
" Define these mappings only if we have access to a clipboard
augroup vimrclocal
au VimEnter *
\ if clipboard_present
\ | map   :$put +
\ | map :0put +
\ | imap  :$put +
\ | imap:0put +
\ | endif
augroup END


I didn't succeed to define the variables when sourcing the vimrc, apparently 
in gvim it only works after the GUI has started. Previously I had tested it 
only in various versions of console Vim with and without -X.




Best regards,
Tony.
--
Who's on first?


Re: How does vim do filename globbing (as in :e file*)

2007-03-14 Thread John Wiersba
Yes, there is such a setting.  From the related thread "Case-sensitive match 
for :e under cygwin?":

For comparison, bash has a nocaseglob option which, if set, matches 
filenames in a case-insensitive fashion when performing pathname
expansion. 

- Original Message 
From: A.J.Mechelynck <[EMAIL PROTECTED]>
To: John Wiersba <[EMAIL PROTECTED]>
Cc: vim@vim.org
Sent: Wednesday, March 14, 2007 1:33:56 PM
Subject: Re: How does vim do filename globbing (as in :e file*)

This is a Unix-like Vim for Cygwin, which requires POSIX paths (as opposed to 
Dos-like paths) and needs the cygwin1.dll. I /think/ that such a Vim version 
will do all of its file-globbing with the exception of ** by "subcontracting" 
it to some Unix shell such as bash. I'm not 100% sure of that and I don't 
remember where I think I saw it.

This leads me to a question: isn't there a setting in Cygwin bash to set 
whether you want case-sensitive or case-insensitive matching and globbing on 
the underlying vfat or NTFS filesystem?


Best regards,
Tony.
-- 
Remember that whatever misfortune may be your lot, it could only be
worse in Cleveland.
-- National Lampoon, "Deteriorata"





 

Food fight? Enjoy some healthy debate 
in the Yahoo! Answers Food & Drink Q&A.
http://answers.yahoo.com/dir/?link=list&sid=396545367


Re: How can a script know if we're running without X ?

2007-03-14 Thread hermitte
"A.J.Mechelynck" <[EMAIL PROTECTED]> wrote:
> The ps solution is difficult to use, because there may be several instances
> of Vim running in parallel (whose prognames might or might not be different)
> and I want to make sure to access the "current" instance: so I would have to
> know the process ID of the current Vim and I don't know how to do that.
> Using system('ls -l /proc/self') wouldn't work, because that would return
> the PID of the ls process called by a subshell called by Vim.

libcallnr("/usr/lib/libc.so", "getpid", "")

should do the trick on most *nix flavours.
>From here, it should be possible to play with /proc related utilities.

> Maybe I'found something... or have I?
>
> (first try omitted, it didn't work)
> (second try is better)
> (third try:)
>
> " (try to) detect whether we have clipboard and X
> if has('clipboard')
>   let x = @+
>   let @+ = '--' . x
>   redir @"
>   silent reg
>   redir END
>   let @+ = x
>   unlet x
>   let clipboard_present = (@" =~ '^"+ ')
> else
>   let clipboard_present = 0
> endif
> let X_available = has('x11') && clipboard_present
>
> The above would fail in a Vim compiled with X support but without clipboard
> support. I think that that risk is negligible. Do you (or does anyone) see
> other cases where the above algorithm would fail? It relies on the fact that
> when the clipboard is not available (for whatever reason: not compiled-in,
> -X, or terminal with no X access) the ":reg" command never lists the "+
> register, not even if we just yanked a nonempty value into it.

Just in case it may help, this code returns 0 in every situation (gvim, vim, vim
-X) in my config (Solaris custom build)
However it seems tied to the fact the "^" prevents '"+' from being matched --
while (@" =~ "\n".'"+ ') is non null. With this new regex, I always end up with
1.

 >% --
VIM - Vi IMproved 7.0 (2006 May 7, compiled Nov 23 2006 16:11:47)
Included patches: 1-168
Compiled by luc
Normal version with X11-Motif GUI.  Features included (+) or not (-):
-arabic +autocmd +balloon_eval +browse +builtin_terms +byte_offset +cindent
+clientserver +clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments
+cryptv -cscope +cursorshape +dialog_con_gui +diff +digraphs -dnd -ebcdic
-emacs_tags +eval +ex_extra +extra_search -farsi +file_in_path +find_in_path
+folding -footer +fork() -gettext -hangul_input -iconv +insert_expand +jumplist
-keymap -langmap +libcall +linebreak +lispindent +listcmds +localmap +menu
+mksession +modify_fname +mouse +mouseshape -mouse_dec -mouse_gpm -mouse_jsbterm
-mouse_netterm +mouse_xterm -multi_byte +multi_lang -mzscheme +netbeans_intg
-osfiletype +path_extra +perl +postscript +printer -profile -python +quickfix
+reltime -rightleft -ruby +scrollbind +signs +smartindent -sniff +statusline
-sun_workshop +syntax +tag_binary +tag_old_static -tag_any_white -tcl +terminfo
+termresponse +textobjects +title +toolbar +user_commands +vertsplit
+virtualedit +visual +visualextra +viminfo +vreplace +wildignore +wildmenu
+windows +writebackup +X11 +xfontset +xim +xsmp_interact +xterm_clipboard
-xterm_save
[...]
Compilation: cc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_MOTIF 
-I/usr/dt/include   -g-I/usr/perl5/5.00503/sun4-solaris/CORE
Linking: cc -L/usr/dt/lib -R /usr/dt/lib   -o vim  -lXmu -lXext -lXm -lSM -lICE
-lXt -lX11 -ltermlib -R /usr/perl5/5.00503/sun4-solaris/CORE 
/usr/perl5/5.00503/sun4-sol
aris/auto/DynaLoader/DynaLoader.a -L/usr/perl5/5.00503/sun4-solaris/CORE -lperl
-lsocket -lnsl -ldl -lm
 >% --

HTH,

--
Luc Hermitte


Re: How does vim do filename globbing (as in :e file*)

2007-03-14 Thread A.J.Mechelynck

John Wiersba wrote:

In particular, how does it handle case-sensitivity when globbing for files under cygwin.  
This question is related to another thread "Case-sensitive match for :e under 
cygwin?".  I believe vim/cygwin used to do case-sensitve filename globbing, but now 
it's doing it case-insensitively and I'd like to get it to revert to the old behavior.

:version
VIM - Vi IMproved 7.0 (2006 May 7, compiled Oct 10 2006 10:07:11)
Included patches: 1-122
Compiled by
 [EMAIL PROTECTED]
Huge version without GUI.  Features included (+) or not (-):
+arabic +autocmd -balloon_eval -browse ++builtin_terms +byte_offset +cindent
-clientserver -clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments
+cryptv +cscope +cursorshape +dialog_con +diff +digraphs -dnd -ebcdic
+emacs_tags +eval +ex_extra +extra_search +farsi +file_in_path +find_in_path
+folding -footer +fork() +gettext -hangul_input +iconv +insert_expand +jumplist
 +keymap +langmap +libcall +linebreak +lispindent +listcmds +localmap +menu
+mksession +modify_fname +mouse -mouseshape +mouse_dec -mouse_gpm
-mouse_jsbterm +mouse_netterm +mouse_xterm +multi_byte +multi_lang -mzscheme
-netbeans_intg -osfiletype +path_extra -perl +postscript +printer +profile
-python +quickfix +reltime +rightleft -ruby +scrollbind +signs +smartindent
-sniff +statusline -sun_workshop +syntax +tag_binary +tag_old_static
-tag_any_white -tcl +terminfo
 +termresponse +textobjects +title -toolbar
+user_commands +vertsplit +virtualedit +visual +visualextra +viminfo +vreplace
+wildignore +wildmenu +windows +writebackup -X11 -xfontset -xim -xsmp
-xterm_clipboard -xterm_save
   system vimrc file: "$VIM/vimrc"
 user vimrc file: "$HOME/.vimrc"
  user exrc file: "$HOME/.exrc"
  fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -g -O2
Linking:
gcc   -L/usr/local/lib -o vim.exe   -lncurses  -liconv -lintl


This is a Unix-like Vim for Cygwin, which requires POSIX paths (as opposed to 
Dos-like paths) and needs the cygwin1.dll. I /think/ that such a Vim version 
will do all of its file-globbing with the exception of ** by "subcontracting" 
it to some Unix shell such as bash. I'm not 100% sure of that and I don't 
remember where I think I saw it.


This leads me to a question: isn't there a setting in Cygwin bash to set 
whether you want case-sensitive or case-insensitive matching and globbing on 
the underlying vfat or NTFS filesystem?



Best regards,
Tony.
--
Remember that whatever misfortune may be your lot, it could only be
worse in Cleveland.
-- National Lampoon, "Deteriorata"


How does vim do filename globbing (as in :e file*)

2007-03-14 Thread John Wiersba
In particular, how does it handle case-sensitivity when globbing for files 
under cygwin.  This question is related to another thread "Case-sensitive match 
for :e under cygwin?".  I believe vim/cygwin used to do case-sensitve filename 
globbing, but now it's doing it case-insensitively and I'd like to get it to 
revert to the old behavior.

:version
VIM - Vi IMproved 7.0 (2006 May 7, compiled Oct 10 2006 10:07:11)
Included patches: 1-122
Compiled by
 [EMAIL PROTECTED]
Huge version without GUI.  Features included (+) or not (-):
+arabic +autocmd -balloon_eval -browse ++builtin_terms +byte_offset +cindent
-clientserver -clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments
+cryptv +cscope +cursorshape +dialog_con +diff +digraphs -dnd -ebcdic
+emacs_tags +eval +ex_extra +extra_search +farsi +file_in_path +find_in_path
+folding -footer +fork() +gettext -hangul_input +iconv +insert_expand +jumplist
 +keymap +langmap +libcall +linebreak +lispindent +listcmds +localmap +menu
+mksession +modify_fname +mouse -mouseshape +mouse_dec -mouse_gpm
-mouse_jsbterm +mouse_netterm +mouse_xterm +multi_byte +multi_lang -mzscheme
-netbeans_intg -osfiletype +path_extra -perl +postscript +printer +profile
-python +quickfix +reltime +rightleft -ruby +scrollbind +signs +smartindent
-sniff +statusline -sun_workshop +syntax +tag_binary +tag_old_static
-tag_any_white -tcl +terminfo
 +termresponse +textobjects +title -toolbar
+user_commands +vertsplit +virtualedit +visual +visualextra +viminfo +vreplace
+wildignore +wildmenu +windows +writebackup -X11 -xfontset -xim -xsmp
-xterm_clipboard -xterm_save
   system vimrc file: "$VIM/vimrc"
 user vimrc file: "$HOME/.vimrc"
  user exrc file: "$HOME/.exrc"
  fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -g -O2
Linking:
gcc   -L/usr/local/lib -o vim.exe   -lncurses  -liconv -lintl




 

8:00? 8:25? 8:40? Find a flick in no time 
with the Yahoo! Search movie showtime shortcut.
http://tools.search.yahoo.com/shortcuts/#news


Re: Case-sensitive match for :e under cygwin?

2007-03-14 Thread John Wiersba
I'm not positive how vim is globbing for files.  If it does its own internal 
globbing, then there must be a switch for case-sensitive globbing, at least in 
the C code.  Probably turned off when it detects it's running on Windows.  
However, since this is a cygwin version, it shouldn't do that, since cygwin 
supports case-sensitive filenames (in a sort of hybrid way).  

I'm hoping that this internal switch exists and is exposed in some way (during 
compilation of vim or during runtime) so that I can turn off this behavior.  I 
believe that older versions of vim complied under cygwin did NOT have this 
behavior, because I never noticed it until now when I just recently updated by 
cygwin software which was a year (or more?) old.

- Original Message 
From: fREW <[EMAIL PROTECTED]>
To: John Wiersba <[EMAIL PROTECTED]>
Cc: vim@vim.org
Sent: Tuesday, March 13, 2007 11:54:49 PM
Subject: Re: Case-sensitive match for :e under cygwin?

I hope I am not speaking prematurely here, but I really think that
this has more to do with the underlying Windows Filesystem stuff.  As
you probably know the files in windows are NOT case sensitive and I
think that vim is probably using some form of Filesystem globbing,
which would find both file1 and FILE2.

On the other hand I remember reading about a cygwin feature that would
allow you to have funky filenames not supported by windows in a cygwin
"partition"  (just escapes in the filenames really) that might change
things.

This is where I read about the cygwin filename stuff:
http://gentoo-wiki.com/HOWTO_Gentoo_on_Cygwin#.22Managed.22_mounts

I hope that helps!

-fREW

-- 
-fREW





 

The fish are biting. 
Get more visitors on your site using Yahoo! Search Marketing.
http://searchmarketing.yahoo.com/arp/sponsoredsearch_v2.php


Re: @=

2007-03-14 Thread Charles E Campbell Jr

Michael Phillips wrote:


Would someone please explain the usage of @=.  I am getting confuse from the
help file.
 

Since TimC gave a good explanation, I won't attempt to repeat it.  
However, if you're wanting to do Boolean-logic pattern matching, please 
check out LogiPat, available at my website:


 http://mysite.verizon.net/astronaut/vim/index.html#LOGIPAT

or at

 http://vim.sourceforge.net/scripts/script.php?script_id=1290

Examples:

   :LogiPat "abc"
   will search for lines containing the string "abc"

   :LogiPat !"abc"
   will search for lines which don't contain the string "abc"

   :LogiPat "abc"|"def"
  will search for lines which contain either the string
   "abc" or the string "def"

   :LogiPat !("abc"|"def")
   will search for lines which don't contain either
   of the strings "abc" or "def"

   :LogiPat "abc"&"def"
   will search for lines which contain both of the strings
   "abc" and "def"

   :let pat= LogiPat('!"abc"')
   will return the regular expression which will match
   all lines not containing "abc".  The double quotes
   are needed to pass normal patterns to LogiPat, and
   differentiate such patterns from boolean logic
   operators. 


Regards,
Chip Campbell



Re: Clearing keymap does not clear the prompt message?

2007-03-14 Thread A.J.Mechelynck

Yongwei Wu wrote:

This behaviour shows up in both vim and gvim. I tested on Windows.

When I choose a keymap using either the menu or "set keymap=...", and
later clear it with the menu or "set keymap=", the prompt in insert
mode is still "-- INSERT (lang) --".

Is there a reason for this behaviour? I would expect the prompt
changes back to "-- INSERT --".

Best regards,

Yongwei



The prompt -- INSERT (lang) -- is due to the fact that clearing the 'keymap' 
option doesn't clear the 'iminsert' option, which had been set to 1 
automatically when a nonempty 'keymap' had been set.


To enable keymaps for the current editfile, use

:setlocal keymap=

To disable them, use

:setlocal iminsert=0 keymap=


Best regards,
Tony.
--
hundred-and-one symptoms of being an internet addict:
110. You actually volunteer to become your employer's webmaster.


Clearing keymap does not clear the prompt message?

2007-03-14 Thread Yongwei Wu

This behaviour shows up in both vim and gvim. I tested on Windows.

When I choose a keymap using either the menu or "set keymap=...", and
later clear it with the menu or "set keymap=", the prompt in insert
mode is still "-- INSERT (lang) --".

Is there a reason for this behaviour? I would expect the prompt
changes back to "-- INSERT --".

Best regards,

Yongwei

--
Wu Yongwei
URL: http://wyw.dcweb.cn/


Re: match html tag

2007-03-14 Thread Akbar

On 3/14/07, A.J.Mechelynck <[EMAIL PROTECTED]> wrote:


matchit. It is distributed with Vim but not installed by default, because it
conflict with the "vi" use of the % key. To install it, use the following
shell commands in an xterm or Dos Box:

- On Unix/Linux:

cd $HOME
mkdir -vp .vim/plugin
mkdir -vp .vim/doc
cd .vim/plugin
ln -vs /usr/local/share/vim/vim70/macros/matchit.vim
cd ../doc
ln -vs /usr/local/share/vim/vim70/macros/matchit.txt
vim --cmd "helptags . |quit"



Hey, that works.. thank you..


Re: gvim hangs when _vimrc loaded and with syntax on

2007-03-14 Thread A.J.Mechelynck

marc wrote:
Strange this. My gvim 7 setup on XP has been working fine for as long as 
v7 has been available. I'm currently on 7.0.178.


Other than that described below, gvim is working fine. If I never load 
_vimrc, then nothing appears to be wrong.


The symptoms are that when I load _vimrc into a buffer, and _vimrc 
contains


  syntax on

then vim hangs. The vim window displays (the GUI opens), but the vim 
window is empty, although the status line shows the file and 1L, 11C. 
Since I'm now testing with a _vimrc containing only


  syntax on

it appears to 'stuck' at EOF. When I try the same with my regular 
_vimrc, vim gets stuck at 158L, 6028C, which is also weird (although the 
line count it fine).


The swp file is created in these scenarios. Looking at the process 
monitors, it is not consuming any resources once it hangs.


I have tried deleting _vimrc and recreating it (with vim). but as soon 
as I save it with the 'syntax on' line and reload it, it hangs.


If I comment out the 'syntax on' line and load vim, then all is well - 
including editing _vimrc. However, I then need to set 'syntax on' 
manually. This works okay. However, if I do this, then later load 
_vimrc, vim hangs.


Finally, I tried a clean install on another machine and the same thing 
happens - although it previously contained a copy of currently broken 
setup.


Any ideas?



Here are a few "ideas". Nothing precise yet, just a few hints.

By "loading" the vimrc, do you mean ":source ~/_vimrc" or ":edit ~/_vimrc"?

When Vim appears to hang:
- does it beep if you pess Esc repeatedly?
- If it does, then does something happen if you hit Ctrl-L after the beep?

If you load Vim without a vimrc (using "vim -u NONE"), what does it reply in 
answer to:

  :echo $HOME
is that the directory where your _vimrc is located?
  :echo $VIM
  :echo $VIMRUNTIME
is that your installation directory, containing files such as 
filetype.vim, vimrc_example.vim, menu.vim, and directories such as plugin/, 
ftplugin/, syntax/, doc/ etc.?

  :scriptnames
there should be really few of them

What are the size in bytes, timestamp and version of 
"$VIMRUNTIME/syntax/syntax.vim"? (with $VIMRUNTIME as seen above)


Does your vimrc set a colorscheme? If it does, does it change something if you 
comment-out the ":colorscheme" line?



Best regards,
Tony.
--
"A witty saying proves nothing."
-- Voltaire
.


Re: gvim hangs when _vimrc loaded and with syntax on

2007-03-14 Thread Greg Dunn

The symptoms are that when I load _vimrc into a buffer, and _vimrc
contains

  syntax on


Does this thread help:

http://tech.groups.yahoo.com/group/vim/message/76286

Essentially, vim is finding an incompatible tcl84.dll in your path
(probably from cygwin, if you have that installed).  Assuming you
don't need tcl support, putting an empty file named tcl84.dll earlier
in the path should fix things up.

-- Greg


gvim hangs when _vimrc loaded and with syntax on

2007-03-14 Thread marc
Strange this. My gvim 7 setup on XP has been working fine for as long as 
v7 has been available. I'm currently on 7.0.178.

Other than that described below, gvim is working fine. If I never load 
_vimrc, then nothing appears to be wrong.

The symptoms are that when I load _vimrc into a buffer, and _vimrc 
contains

  syntax on

then vim hangs. The vim window displays (the GUI opens), but the vim 
window is empty, although the status line shows the file and 1L, 11C. 
Since I'm now testing with a _vimrc containing only

  syntax on

it appears to 'stuck' at EOF. When I try the same with my regular 
_vimrc, vim gets stuck at 158L, 6028C, which is also weird (although the 
line count it fine).

The swp file is created in these scenarios. Looking at the process 
monitors, it is not consuming any resources once it hangs.

I have tried deleting _vimrc and recreating it (with vim). but as soon 
as I save it with the 'syntax on' line and reload it, it hangs.

If I comment out the 'syntax on' line and load vim, then all is well - 
including editing _vimrc. However, I then need to set 'syntax on' 
manually. This works okay. However, if I do this, then later load 
_vimrc, vim hangs.

Finally, I tried a clean install on another machine and the same thing 
happens - although it previously contained a copy of currently broken 
setup.

Any ideas?

-- 
Cheers,
Marc



Re: How to paste while keep the cursor at the same place?

2007-03-14 Thread Raphael Bauduin

On 3/14/07, A.J.Mechelynck <[EMAIL PROTECTED]> wrote:

Albie Janse van Rensburg wrote:
> Raphael Bauduin wrote:
>> Is it possible to jump to a mark at the exact same position in the
>> line as when the mark was set? When I jump to a mark I always get back
>> to the first character of the line.
> You are using ' instead of  `
>
> On my keyboard, ` is on the same key as ~.  ` is used to jump to a mark
> characterwise, whereas ' does so line-wise.
>

On mine (which is an AZERTY fr-BE layout) the apostrophe is lowercase 4 while
the backtick is AltGr+µ (i.e. the Greek letter mu with AltGr modifier)
followed by space. (The same key, when followed by one of the letters aeinouwy
instead of a space, would add a grave accent to the letter.)



Thanks albie and tony.

I'm also using a fr-BE, so I guess I'd better set an alternate mapping
to make it easily accessible :-)

Raph






Best regards,
Tony.
--
I gave up Smoking, Drinking and Sex.  It was the most *horrifying* 20
minutes of my life!




--
Web database: http://www.myowndb.com
Free Software Developers Meeting: http://www.fosdem.org


Re: How to paste while keep the cursor at the same place?

2007-03-14 Thread A.J.Mechelynck

Albie Janse van Rensburg wrote:

Raphael Bauduin wrote:

Is it possible to jump to a mark at the exact same position in the
line as when the mark was set? When I jump to a mark I always get back
to the first character of the line.

You are using ' instead of  `

On my keyboard, ` is on the same key as ~.  ` is used to jump to a mark 
characterwise, whereas ' does so line-wise.




On mine (which is an AZERTY fr-BE layout) the apostrophe is lowercase 4 while 
the backtick is AltGr+µ (i.e. the Greek letter mu with AltGr modifier) 
followed by space. (The same key, when followed by one of the letters aeinouwy 
instead of a space, would add a grave accent to the letter.)


Best regards,
Tony.
--
I gave up Smoking, Drinking and Sex.  It was the most *horrifying* 20
minutes of my life!


Re: Maximize gvim at startup

2007-03-14 Thread A.J.Mechelynck

Mark Woodward wrote:

Hi Shawn,

On Tue, 2007-03-13 at 09:28 -0400, Mr. Shawn H. Corey wrote:

Hi,

I'm running Ubuntu 6.10 on a PowerBook 4 under GNOME. Is there any 
command I can put inn my .gvimrc that will maximize the window at 
startup? I tried:


   :autocmd GUIEnter * simalt 

But simalt does not work in Linux.

I may not know much about GUIs but ever one I read so far has an API 
call that maximizes the window. So, what's the best way to do this?





open gvim
hit the maximise button (top right hand corner)
from within vim:
  :set lines?
  :set columns?

you should get 2 values, lets say 50 and 100.

in your gvimrc
set lines=50
set columns=100

cheers,



This will work; but you must remember to change it again whenever you change 
the resolution of your graphics display, or the name and size of your 'guifont'.


If you use different 'guifont' settings for different projects (for instance I 
use a much larger font for Chinese than for Latin), then if you don't want to 
rely to the auto-resizing of sizes greater than the viewport, the 'lines' and 
'columns' settings will also be different.



Best regards,
Tony.
--
It's a very *UN*lucky week in which to be took dead.
-- Churchy La Femme


Re: Maximize gvim at startup

2007-03-14 Thread Mark Woodward
Hi Shawn,

On Tue, 2007-03-13 at 09:28 -0400, Mr. Shawn H. Corey wrote:
> Hi,
> 
> I'm running Ubuntu 6.10 on a PowerBook 4 under GNOME. Is there any 
> command I can put inn my .gvimrc that will maximize the window at 
> startup? I tried:
> 
>:autocmd GUIEnter * simalt 
> 
> But simalt does not work in Linux.
> 
> I may not know much about GUIs but ever one I read so far has an API 
> call that maximizes the window. So, what's the best way to do this?
> 
> 

open gvim
hit the maximise button (top right hand corner)
from within vim:
  :set lines?
  :set columns?

you should get 2 values, lets say 50 and 100.

in your gvimrc
set lines=50
set columns=100

cheers,

-- 
Mark


Re: How to paste while keep the cursor at the same place?

2007-03-14 Thread A.J.Mechelynck

Raphael Bauduin wrote:

On 3/14/07, Gary Johnson <[EMAIL PROTECTED]> wrote:

On 2007-03-13, Peng Yu <[EMAIL PROTECTED]> wrote:
> Hi,
>
> Suppose I use p to paste something, the cursor always goes to the end
> of the pasted text. Is there any other key to paste will keep the
> cursor before the pasted text?

See

:help `[



Is it possible to jump to a mark at the exact same position in the
line as when the mark was set? When I jump to a mark I always get back
to the first character of the line.


Let's say you have set the x mark using the mx command. To go back to the 
exact same cursor location, use `x (where ` is a backtick, i.e. something more 
or less like a grave accent with no letter under it: 0x60), not an apostrophe. 
Using 'x (with an apostrophe, 0x27) would bring you back to the first nonblank 
on the same line instead. `x (with backtick) is a characterwise motion, 'x 
(with apostrophe) is linewise.




Even '< described as "To the first character of the last selected
Visual area in the current buffer" puts me at the start of the line.

Thanks

Raph


Here too, `< (with backtick) goes characterwise to the start of the (latest) 
visual area while '< (with apostrophe) goes linewise to the first nonblank in 
the same line.


See ":help mark-motions".


Best regards,
Tony.
--
In a world without walls and borders, who needs windows and gates?


Re: How to paste while keep the cursor at the same place?

2007-03-14 Thread Albie Janse van Rensburg

Raphael Bauduin wrote:

Is it possible to jump to a mark at the exact same position in the
line as when the mark was set? When I jump to a mark I always get back
to the first character of the line.

You are using ' instead of  `

On my keyboard, ` is on the same key as ~.  ` is used to jump to a mark 
characterwise, whereas ' does so line-wise.


--
Albie Janse van Rensburg (neonpill)

Registered Linux User 438873 | 


Re: How to paste while keep the cursor at the same place?

2007-03-14 Thread Raphael Bauduin

On 3/14/07, Gary Johnson <[EMAIL PROTECTED]> wrote:

On 2007-03-13, Peng Yu <[EMAIL PROTECTED]> wrote:
> Hi,
>
> Suppose I use p to paste something, the cursor always goes to the end
> of the pasted text. Is there any other key to paste will keep the
> cursor before the pasted text?

See

:help `[



Is it possible to jump to a mark at the exact same position in the
line as when the mark was set? When I jump to a mark I always get back
to the first character of the line.

Even '< described as "To the first character of the last selected
Visual area in the current buffer" puts me at the start of the line.

Thanks

Raph




You could either type `[ after the p to move the cursor, or you
could remap p like this

:noremap p p`[

to have it behave that way all the time.

HTH,
Gary

--
Gary Johnson | Agilent Technologies
[EMAIL PROTECTED] | Mobile Broadband Division
 | Spokane, Washington, USA




--
Web database: http://www.myowndb.com
Free Software Developers Meeting: http://www.fosdem.org


complete=custom for path including spaces

2007-03-14 Thread Raphael Bauduin

Hi,

I'm writing a command with a custom completion, and it works fine,
except when there's a space in the "path" to complete.

For example, without spaces everything works:
  :Radiant edit pages/ho
will complete to
  :Radiant edit pages/home/
which I can further complete:
  :Radiant edit pages/home/fi
to
  :Radiant edit pages/home/first-post/

If there's a space, it doesn't work:
  :Radiant edit pages/Ho
is completed to
  :Radiant edit pages/Home\ Page/
But now, this
  :Radiant edit pages/Home\ Page/A
doesn't complete it, although my completion function returns what is
expected as completion:
  pages/Home\ Page/About
  pages/Home\ Page/Articles

What am I missing here?

Raph

--
Web database: http://www.myowndb.com
Free Software Developers Meeting: http://www.fosdem.org