Skip to search.

Breaking News Visit Yahoo! News for the latest.

×Close this window

vim · Vim (Vi IMproved) text editor users list

The Yahoo! Groups Product Blog

Check it out!

Group Information

? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Real people. Real stories. See how Yahoo! Groups impacts members worldwide.

Messages

Advanced
Messages Help
Messages 34889 - 34918 of 137836   Oldest  |  < Older  |  Newer >  |  Newest
Messages: Show Message Summaries Sort by Date ^  
#34889 From: kbosau@...
Date: Tue Dec 3, 2002 3:36 am
Subject: Mapping with count
kbosau@...
Send Email Send Email
 
Hi,

I'd like to create a normal mode mapping one
can control by a number that has to be typed
in prior to hitting the mapped key...

function! f()
   Do something dependent of the
   value of the number that has
   been typed prior to hitting 'z'
endfunction

nmap z :call f()<Cr>

for instance should define a normal mode
command '34z'.

How can I achieve this?

Thanks in advance!

Klaus

#34890 From: Joergen Haegg <jorgen.hagg@...>
Date: Tue Dec 3, 2002 4:12 am
Subject: Re: problem using vim & perl 5.8.0
jorgen.hagg@...
Send Email Send Email
 
> >>  I'm trying to use perl in vim, but after upgrading to perl 5.8.0
> >>  vim dies.

Here is a stack trace:

:perl print "$curbuf\n"
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 16384 (LWP 20680)]
0x402cc81d in Perl_sv_setsv_flags () from /usr/lib/libperl.so.5.8
(gdb) where
#0  0x402cc81d in Perl_sv_setsv_flags () from /usr/lib/libperl.so.5.8
#1  0x08131940 in cur_val (iv=135726536, sv=0x1) at if_perl.xs:505
#2  0x402b942d in Perl_magic_getuvar () from /usr/lib/libperl.so.5.8
#3  0x402b475c in Perl_mg_get () from /usr/lib/libperl.so.5.8
#4  0x402cb78c in Perl_sv_2pv_flags () from /usr/lib/libperl.so.5.8
#5  0x402c13e3 in Perl_pp_concat () from /usr/lib/libperl.so.5.8
#6  0x402c1091 in Perl_runops_standard () from /usr/lib/libperl.so.5.8
#7  0x40268574 in Perl_eval_sv () from /usr/lib/libperl.so.5.8
#8  0x08131e89 in ex_perl (eap=0xbffff5a8) at if_perl.xs:601
#9  0x08090c61 in do_one_cmd (cmdlinep=0xbffff658, sourcing=0,
     cstack=0xbffff670, getline=0x809b348 <getexline>, cookie=0x0)
     at ex_docmd.c:1880
#10 0x0808f740 in do_cmdline (cmdline=0x0, getline=0x809b348 <getexline>,
     cookie=0x0, flags=0) at ex_docmd.c:786
#11 0x080da01a in nv_colon (cap=0xbffff804) at normal.c:4461
#12 0x080d5c81 in normal_cmd (oap=0xbffff86c, toplevel=1) at normal.c:1043
#13 0x080b516f in main_loop (cmdwin=0) at main.c:2047
#14 0x080b4ee2 in main (argc=0, argv=0xbffffa04) at main.c:1897
(gdb)

#34891 From: Erik Christiansen <erik@...>
Date: Tue Dec 3, 2002 5:12 am
Subject: Re: [PATCH] New option for breaking hard links when saving files
erik@...
Send Email Send Email
 
On Sat, Nov 30, 2002 at 08:11:22PM +0100, Guillermo Ontañón wrote:
> The patch below adds a new option to Vim called 'breakhlinks', with this
> option activated, Vim will check if the file to be saved is a hard link,
> if so, it will break the link.

    Looks very useful.

    Have you considered a more general 'breaklinks'? e.g. If the original
source is in /usr/local/src, and the working "copy" is in ~, then hard
links will fail, with "Invalid cross-device link"

    GNU cp will make either a hard or symlinked "copy", given -l or -s.

    Also, from the manpage for another related utility:

>>>
    lndir - create a shadow directory of symbolic links to another
            directory tree.

    ...

    You  create a shadow directory containing links to the real source,
    which  you  will  have  usually mounted  from  a  remote machine.
<<<

    If the file in the original source is deliberately deleted, is it
better to have a detectable:

    xxxxx: broken symbolic link to /usr/local/src/super_app/xxxxx

or the orphan _real_ copy that results if a hardlink is used?
(Assuming link count was 2)

    Hope these ruminations are interesting, bordering on helpful. :)

Regards,
Erik

#34892 From: Piet Delport <pjd@...>
Date: Tue Dec 3, 2002 5:27 am
Subject: Re: some vim standard ? (stdlib.vim)
pjd@...
Send Email Send Email
 
On Sun, 01 Dec 2002 at 22:34:56 -0500, Steve Hall wrote:
>
> Vim help is sprinkled with some of these but a "Vim Standard Library
> Guidelines" doc might be a good place to start. Here's a few of mine:
>
[...]
>
> * Never use Vim's abbreviated forms for commands or options. Always
>   use the full name since code readability is paramount!

Sometimes the abbreviated forms are more readable, IMHO.

Examples:  :abbrev, :exec, :hi, :e, and friends

> * Always use spaces around operators and concatenation symbols.

This one also depends... sometimes it's more readable to cluster a small
group of related operators together without spaces, to keep them from
visually interfering with other operators.

--
Piet Delport
Today's subliminal thought is:

#34893 From: Luc Hermitte <hermitte@...>
Date: Tue Dec 3, 2002 6:17 am
Subject: Re: some vim standard ? (stdlib.vim)
hermitte@...
Send Email Send Email
 
* On Sun, Dec 01, 2002 at 10:02:19PM -0500, Sylvain Viart
<viart.sylvain@...> wrote:
> I've seen user documentation and that's very good. :)
>
> But I never seen developer documentation. And that's pretty normal,
> because script are rarely developed to be shared at development level.
> That's my opinion for now, I may be wrong.

It depends. The rare plugins exposing functions to developpers often
have a documentation aimed at developpers. Somehow they are API plugins.

Other plugins don't have documentation about their functions as they are
not API-plugins. However, sometimes internal considerations are embedded
within the code for those who may wish to look at the code.

> > > May be a libbuilder would be a solution.
> > > Would it solve everyone preference ?
> > everyone preferences ? ... hardly I `think'.
> >
> Could you give me case where a libbuilder will fail to solve people's
> problem about code inclusion / sharing ?

I have misunderstood you. On an application level, supporting every
possible preference is quite impossible.
On an API level, what is a preference ?
Why does it concern the user ? Who is the user ? The VimL developper or
the end-user ?

It is very fuzzy.
The latest plugin I wrote (ui-functions.vim) defines several functions
aimed at plugin writers (or template-files writers). I think I can say
ui-functions.vim is an API-plugin.

At this time, the functions wraps VimL functions like |confirm()| to
interact with the user in :
- a gui-way (default behaviour when "has('gui_running')" is true)
- a text-ui-way (otherwise)
Depending on the current session characteristics or options set by the
end user, one of these two ways will be used.

Then, as I had a problem with |statusline|, I exposed it on this list.
Two other 'ways' were evoked. And I have two others in mind.
Unless I expose hooks, my functions can only propose a _finite_ number
of ways.


> Of course the libbuilder need also an input strategy. It's not our
> problem for now, we are just guessing.

Just curious, have you checked |libcall()| ?

> > A tour on SF shows us a tendency to reinvent the wheel because of a
> > little something missing, or too many things unwanted, etc.
> Yes, that's true. But I'm speaking at API level not application level.

It is the same problem.

> [...]
> An interesting question raise:
> Is vim designed to enable code share/reuse ?

It is not really efficient or neat, but possible.

For instance, as I do have several 'API'-plugins used by other scripts I
wrote, I often need to check dependencies are respected. As I can not
define a script that will check other scripts are installed (... snake
that bites its tail), every time I end up with:
- a function that display error messages (gui or text depending on
   current session)
- a function that check a thing is defined (command, function, or
   variable), if not try to source the file that is supposed to define
   the thing (with runtime), it the thing is still not defined, then
   an error message is displayed.
- several calls to the dependencies-checker function.

[Now, I'm thinking, this is a very good candidate for a template-file.]

> The difficulty to write a function which would give the name of the
> sourced script in which a function was written may be a clue...

Try:
     let s:script_name = expand('<sfile>')
     function ScriptName()
	 return s:script_name
     endfunction


Anyway, there are many low level stuff (ie aimed at plugin writters)
that I miss. So any step in this direction would be great.

Luck.

--
Luc Hermitte, qui se doutait bien tu parlais aussi français.   ~_^
http://hermitte.free.fr/vim/

#34894 From: Jürgen Krämer <jkraemer@...>
Date: Tue Dec 3, 2002 7:05 am
Subject: Re: writing a string after every nth character
jkraemer@...
Send Email Send Email
 
Hi,

Brett Pershing Stahlman wrote:

[quoting corrected]

> ----- Original Message -----
> From: Jürgen Krämer <jkraemer@...>
>
>> :%s/\d\{4\}/&test/g
>
> Unless I'm mistaken, there should not be a \ before the closing curly brace;

no, it's optional.

Regards,
Jürgen


--
Jürgen Krämer                                   Softwareentwicklung
Habel GmbH                                      mailto:jkraemer@...
Hinteres Öschle 2                               Tel: (0 74 61) 93 53 15
78604 Rietheim-Weilheim                         Fax: (0 74 61) 93 53 99

#34895 From: Mirko Gerdau <vim-mail@...>
Date: Tue Dec 3, 2002 9:47 am
Subject: sources for OS/390 Unix
vim-mail@...
Send Email Send Email
 
Does anybody know where to find vim sources for OS/390 Unix System
Services (aka OMVS).
The problem: USS uses EBCDIC but no ASCII codepages

thanx
Mirko

gerdau@...
SDF - Public Access Unix System

#34896 From: Walter Briscoe <wbriscoe@...>
Date: Tue Dec 3, 2002 8:09 am
Subject: Copying "vimdiff" output to the Win32 clipboard
wbriscoe@...
Send Email Send Email
 
This article describes copying vim -d screens to the Win32 clipboard.
It depends on a program to configure the size of a "shell" window. It
works with cmd.exe in W2K. It probably works in other variants of NT
including XP. I have not tested this. On W9X, it works with a flawed
port of cmd.exe which Microsoft used to publish. All the relevant
software can be found via
http://www.neuro.gatech.edu/users/cwilson/cygutils/consize/index.html
It should also work with bash on W9X. It does NOT work with a W9X
COMMAND.COM or other 16 bit shells.

The following WIDE listing was prepared with something like the
following recipe:
1) Download and install consize from the URL above. It is supplied
as both source code and a couple of executables in different formats.
2) In a cmd.exe window, run the following command to set up a 160
column 10 line window
   consize 10 160
consize puts horizontal and vertical scrollbars on the window as needed
I set up a 10 line window to economize on bandwidth.
Windows can be up to 32767 by 32767.
3) Again in the cmd.exe window, Run vim -d 0Make_ivc.mak Make_ivc.mak
4) Still in the cmd.exe window, Select All and Copy.
5) Paste in my email preparation program without wrapping lines

+ +-- 24 lines: # Microsoft Developer Studio Generated NMAKE File, Forma|+ +--
24 lines: # Microsoft Developer Studio Generated NMAKE File, Form
   # 5) Optimisation is not supported by disabled versions of VC. This r+|  # 5)
Optimisation is not supported by disabled versions of VC. This +
   #    messages for Release builds like:                                |  #   
messages for Release builds like:
   #      Command line warning D4025 : overriding '/O2' with '/Od'       |  #
Command line warning D4025 : overriding '/O2' with '/Od'
   # 6) nmake 1.62 and later support batch compilation. I was unable to +|  # 6)
nmake 1.62 and later support batch compilation. I was unable to+
   #    in a manner acceptable to earlier IDEs.                          |  #   
in a manner acceptable to earlier IDEs.
   #                                                                     |  #
   ----------------------------------------------------------------------|
0Make_ivc.mak [RO]                                    1,1            Top
Make_ivc.mak [RO]                                    1,1            Top
"Make_ivc.mak" [readonly] 637L, 17577C

Late last week, I wanted to do something like this in an email.
sdiff did not suit my purposes. I found I had to compose the view by hand
in another copy of vim. I then took more than an hour to find this
program. I was looking for "slidebar" rather than "scrollbar". It gives
me an idea - marry a thesaurus and a search engine.

Later - Much Later :) - window expansion can be done in a cmd.exe window:
1) Right click on title bar and click "Properties".
2) In Layout tab, set Screen Buffer Size Width and Height.
Oops!
--
Walter Briscoe

#34897 From: "Dan Sharp" <dwsharp@...>
Date: Tue Dec 3, 2002 1:48 pm
Subject: Re: sources for OS/390 Unix
dwsharp@...
Send Email Send Email
 
>From: Mirko Gerdau <vim-mail@...>
>
>Does anybody know where to find vim sources for OS/390 Unix System Services
>(aka OMVS).
>The problem: USS uses EBCDIC but no ASCII codepages

Support is already in the current sources.  Look at README_os390.txt for
details, or do :he os390 for more current information.

Dan Sharp

_________________________________________________________________
MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*.
http://join.msn.com/?page=features/virus

#34898 From: Stefan Verhaegh <sjs.verhaegh@...>
Date: Tue Dec 3, 2002 2:45 pm
Subject: asking for help with research on open source software
sjs.verhaegh@...
Send Email Send Email
 
dear vim users and developers,

as a student of the faculty of Science and Technology Studies at the dutch
University of Maastricht (www.unimaas.nl) I'm writing my master thesis
about open source software development.

I've been reading truckloads of theoretical literature, but I found I also
needed a practical case to study, for which I chose Vim. Up till now I've
interviewed Bram Moolenaar about his part of developing Vim and I've
browsed the email archives of the Vim mailing lists.

What I would like to do next, is to interview additional vim users and
developers by mail, to gain more inside into the interaction between users
(more and less skilled) and developers exchanging tips, bug reports,
scripts, and source code.

I'm not going to do a huge quantative study like the Floss-study on open
source (www.infonomics.nl/FLOSS/), as I'm more interested in
qualitative personal accounts about peoples' daily use of vim and
how they obtain help or share information with others.

So who would like to share some thoughts with me by mail about their usage
of Vim and the Vim mailing list? I'm looking for about ten people who are
willing to answer some questions from me for about the next two weeks
(untill 18 december). When I've collected enough material, I'll post my
generalized conclusions back to the main Vim mailing list to offer other
people a change to react on my findings.

Once I've finished my master thesis, I'll make an electronic version
available on the internet for downloading (somewhere in March 2003).

Hopefully you can help me understand the fascinating world of open source
software a little bit better. You can contact me by mail for additional
information or for helping me with my casestudy on Vim.


With kind regards,


Stefan Verhaegh

#34899 From: Thomas Adam <thomas_adam16@...>
Date: Tue Dec 3, 2002 2:55 pm
Subject: Re: asking for help with research on open source software
thomas_adam16@...
Send Email Send Email
 
Hey Stefan,

Sounds like a VERY interesting thesis. You can
definitely count on my input, in any shape or form!!

Kind Regards,

Thomas Adam (19 years old)

  --- Stefan Verhaegh <sjs.verhaegh@...>
wrote: > dear vim users and developers,
>
> as a student of the faculty of Science and
> Technology Studies at the dutch
> University of Maastricht (www.unimaas.nl) I'm
> writing my master thesis
> about open source software development.
>
> I've been reading truckloads of theoretical
> literature, but I found I also
> needed a practical case to study, for which I chose
> Vim. Up till now I've
> interviewed Bram Moolenaar about his part of
> developing Vim and I've
> browsed the email archives of the Vim mailing lists.
>
> What I would like to do next, is to interview
> additional vim users and
> developers by mail, to gain more inside into the
> interaction between users
> (more and less skilled) and developers exchanging
> tips, bug reports,
> scripts, and source code.
>
> I'm not going to do a huge quantative study like the
> Floss-study on open
> source (www.infonomics.nl/FLOSS/), as I'm more
> interested in
> qualitative personal accounts about peoples' daily
> use of vim and
> how they obtain help or share information with
> others.
>
> So who would like to share some thoughts with me by
> mail about their usage
> of Vim and the Vim mailing list? I'm looking for
> about ten people who are
> willing to answer some questions from me for about
> the next two weeks
> (untill 18 december). When I've collected enough
> material, I'll post my
> generalized conclusions back to the main Vim mailing
> list to offer other
> people a change to react on my findings.
>
> Once I've finished my master thesis, I'll make an
> electronic version
> available on the internet for downloading (somewhere
> in March 2003).
>
> Hopefully you can help me understand the fascinating
> world of open source
> software a little bit better. You can contact me by
> mail for additional
> information or for helping me with my casestudy on
> Vim.
>
>
> With kind regards,
>
>
> Stefan Verhaegh
>
>

=====
Thomas Adam

"The Linux Weekend Mechanic" -- www.linuxgazette.com

__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com

#34900 From: Stefan Verhaegh <sjs.verhaegh@...>
Date: Tue Dec 3, 2002 3:38 pm
Subject: Re: asking for help with research on open source software
sjs.verhaegh@...
Send Email Send Email
 
Dear Thomas,

thanks for your FAST repons (which I guess is also one of the
characteristics of the Vim mailinglist).

Because I respect the privacy of the people who want to help with my
research, I'll post the next emails only to you, and not to the whole
list. Unless ofcourse you explicitly want to continue this email
conversation on the Vim list (but perhaps all the other people out there
are not waiting for that to happen....)

On the other hand it's also nice when people can respond to each other. So
in a later stage I'll put some findings and questions in a general email to the
whole mailinglist.

For the same privacy reasons I'm only going to quote
you anonymously in my master thesis.

Allright, enough about methodology. But if there are questions left,
please ask.


(1) One of the first things I'm interested in is peoples' actual use of
Vim.

Could you perhaps tell me something more about your (daily) Vim usage?
How did you discover Vim?
Why did you start using Vim (and not an other editor like emacs)?
What do you use Vim for?
In what way does it make a difference to you personally that Vim is open
source charityware?
Would you also be working with Vim, if it was a closed proprietary
product?


(2) I'm also interested in the way people use the Vim mailing list.

Could you tell me something more about your personal experience with the
Vim mailinglist?
How would you describe the Vim community?
How important is the Vim community to you regarding your own Vim usage?


Thanks again for your fast respons!

Stefan

#34901 From: "Jing Xue" <misclists@...>
Date: Tue Dec 3, 2002 4:38 pm
Subject: Re: write permission
misclists@...
Send Email Send Email
 
----- Original Message -----
From: "Antoine J. Mechelynck" <antoine.mechelynck@...>
Date: Sun, 17 Nov 2002 10:21:37 +0100
To: <vim@...>
Subject: Re: write permission


>
> That's under Unix (including Unix-like systems like Linux or cygwin). Under
> DOS or Windows it's not so clean: Try to create a workfile (a file for which
> the OS gives you a name which is guaranteed not to exist yet). If the
> open-output fails, it means you cannot write to the current directory
> (either read-only, or no free entries and disk full).

Hmmm, for Win2K (NT as well I believe), this works, too, which would actually
avoid from creating a temp file:

dir /AR|findstr /R /C:"\ \.$"

HTH
-J.X.

--
_______________________________________________
Sign-up for your own FREE Personalized E-mail at Mail.com
http://www.mail.com/?sr=signup

One click access to the Top Search Engines
http://www.exactsearchbar.com/mailcom

#34902 From: "Jeremy Brand, B.S." <jeremy@...>
Date: Tue Dec 3, 2002 8:04 pm
Subject: Re: Compile on Redhat 8
jeremy@...
Send Email Send Email
 
Thus spake Benji Fisher:

> Antoine J. Mechelynck wrote:
> > James Wanliss <James.Wanliss@...> wrote:
> >
> >>Hello,
> >>
> >>I have a question regarding compile of 6.0 and 6.1-I am unable to compile
> >>these codes for use of gvim on Redhat 8.0.
> [snip]
> >
> > Jeremy Brand, B.S. <jeremy@...> has pre-compiled RPM archives with
> > vim 6.1 for RedHat. I found the following in my "collection of past Vim
> > postings" but I'm not sure whether it's the latest posting on that subject.
> >
> > Tony.
> >
> > <quote>
> > Download URL
> >
> >   http://nirvani.org/software/vim/
>
>       I think there are problems with gcc 3.x, and these are addressed
> in some of the patches for vim 6.1.  So, if you do not want to use the
> RPM's, get the patches or get the source from CVS.

It might also be a configuration problem on your machine.  My RPMs build
just fine on RedHat 8 with gcc 3.2.  I just re-tested them to make sure.

However, I don't distribute RPMs for RedHat 8 soley, because I distribute
ones that work on RedHat 7 & 8.

If you still want to try and compile VIM on your redhat 8 box and are
convinced it has something to do with GCC 3.2, try using /usr/bin/gcc296
as your $CC replacement in the proper makefiles and friends. A usually
easier _quick fix_ is it `link -s /usr/bin/gcc296 /bin/gcc`, then when you
are done building, remove the link /bin/gcc - This works, because most
people have /bin in their $PATH before /usr/bin.

Jeremy
--
http://nirvani.org/software/vim/

#34903 From: Steve Litt <slitt@...>
Date: Tue Dec 3, 2002 8:39 pm
Subject: EX paste command?
slitt@...
Send Email Send Email
 
Hi all,

I'm writing a simple script. Two consecutive lines each, mutually
exclusively, contain either "create" or "destroy". I want to make sure the
line saying "create" comes first, and I want to do it from an EX script. I
know if I could do a paste from the colon prompt I've got it made:

:.g/destroy/g
:paste

Trouble is, I can't find a paste command that works from the colon prompt,
and I've spent a half hour crawling thru help. Anyone know how to do a paste
from the colon prompt?

Thanks

SteveT

--
Steve Litt
Author:
    * Universal Troubleshooting Process courseware
    * Troubleshooting Techniques of the Successful Technologist
    * Rapid Learning: Secret Weapon of the Successful Technologist
Webmaster
    * Troubleshooters.Com
    * http://www.troubleshooters.com

(Legal Disclaimer) Follow these suggestions at your own risk.

#34904 From: "Tim Chase" <gumnos@...>
Date: Tue Dec 3, 2002 8:41 pm
Subject: Re: EX paste command?
gumnos@...
Send Email Send Email
 
> Trouble is, I can't find a paste command that works from the colon
prompt,
> and I've spent a half hour crawling thru help. Anyone know how to do a
paste
> from the colon prompt?

sounds like you're looking for

:he :put

right?

-tim

#34905 From: "Dave Roberts" <dave.roberts@...>
Date: Tue Dec 3, 2002 9:06 pm
Subject: RE: EX paste command?
dave.roberts@...
Send Email Send Email
 
You can use the 'normal' command to swap two lines if necessary.

Use '\<' and '\>' to make sure the words are not part of a longer word.

:g/\<destroy\>.*\n.*\<create\>/normal ddp

Causes:

----------------------------------------
This line contains the word "destroy"
This line contains the word "create"

do not destroy this line
if we create this line then all is well

this created the destroy
are we destroying the create?
----------------------------------------

to become:

----------------------------------------
This line contains the word "create"
This line contains the word "destroy"

if we create this line then all is well
do not destroy this line

are we destroying the create?
this created the destroy
----------------------------------------

Note: Due to the way :g works, this will also work if there are no blank
lines.  It will only swap two lines that have the word destroy first.

- Dave

-----Original Message-----
From: Steve Litt [mailto:slitt@...]
Sent: Tuesday, December 03, 2002 3:39 PM
To: vim@...
Subject: EX paste command?


Hi all,

I'm writing a simple script. Two consecutive lines each, mutually
exclusively, contain either "create" or "destroy". I want to make sure the
line saying "create" comes first, and I want to do it from an EX script. I
know if I could do a paste from the colon prompt I've got it made:

:.g/destroy/g
:paste

Trouble is, I can't find a paste command that works from the colon prompt,
and I've spent a half hour crawling thru help. Anyone know how to do a paste
from the colon prompt?

Thanks

SteveT

--
Steve Litt
Author:
    * Universal Troubleshooting Process courseware
    * Troubleshooting Techniques of the Successful Technologist
    * Rapid Learning: Secret Weapon of the Successful Technologist
Webmaster
    * Troubleshooters.Com
    * http://www.troubleshooters.com

(Legal Disclaimer) Follow these suggestions at your own risk.

#34906 From: "Soren Andersen" <soren_andersen@...>
Date: Tue Dec 3, 2002 11:15 pm
Subject: Getting help on new plugin added?
soren_andersen@...
Send Email Send Email
 
Hello,

Sorry if this is a terribly basic Q.

I've just installed some new plugins in $VIM/vimfiles/ftplugin/

(mail/mail_set.vim) and I wonder how to get help? There is some kind of
help content written in the plugin iself. No external .txt help doc, so
AFAIU there's no use in running :maketags is there? The plugin mentions
something called "BuildHelp" as in

#  if (exists('*BuildHelp')

but :he BuildHelp and searching online at vim.sf.net brings up no clues
about "BuildHelp".

   Thanks,
    Soren A
--
http://fastmail.fm - Or how I learned to stop worrying and
                       love email again

#34907 From: Hari Krishna Dara <hari_vim@...>
Date: Wed Dec 4, 2002 2:20 am
Subject: regex help: finding protected spaces
hari_vim@...
Send Email Send Email
 
I need to find all the spaces that are protected by a back-slash. A simple
regular expression such as '\\\@<= ' will not work because I may have something
like '\\ ' which is not a valid match. How can I construct the regex for a
generic case?  Any help will be appreciated.

Thank you,
Hari

__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

#34908 From: Oliver Fuchs <oliverfuchs1@...>
Date: Wed Dec 4, 2002 4:34 am
Subject: Re: Getting help on new plugin added?
oliverfuchs1@...
Send Email Send Email
 
On Tue, 03 Dec 2002, Soren Andersen wrote:

> Hello,
>
> Sorry if this is a terribly basic Q.
>
> I've just installed some new plugins in $VIM/vimfiles/ftplugin/
>
> (mail/mail_set.vim) and I wonder how to get help? There is some kind of
> help content written in the plugin iself. No external .txt help doc, so
> AFAIU there's no use in running :maketags is there? The plugin mentions
> something called "BuildHelp" as in
>

Hi,

:h add-filetype-plugin shows you:

[...]
FILETYPE PLUGINS 	 *add-filetype-plugin* *ftplugins*
The Vim distribution comes with a set of plugins for different filetypes that
you can start using with this command: >
	 :filetype plugin on
That's all!  See |vimrc-filetype|.
[...]

The mail_set.vim ftplugin should show you itself what it will do.
For example the mail.vim ftplugin does this:

[...]
" Don't use modelines in e-mail messages, avoid trojan horses
setlocal nomodeline
" many people recommend keeping e-mail messages 72 chars wide
setlocal tw=72
" Set 'formatoptions' to break text lines and keep the comment leader ">".
setlocal fo+=tcql
" Add mappings, unless the user didn't want this.
[...]

Oliver
--
... don't touch the bang bang fruit

#34909 From: "Thomas S. Urban" <scottu@...>
Date: Wed Dec 4, 2002 5:41 am
Subject: Re: regex help: finding protected spaces
scottu@...
Send Email Send Email
 
On Tue, Dec 03, 2002 at 18:20:42 -0800, Hari Krishna Dara sent 0.4K bytes:
>
> I need to find all the spaces that are protected by a back-slash. A simple
> regular expression such as '\\\@<= ' will not work because I may have
something
> like '\\ ' which is not a valid match. How can I construct the regex for a
> generic case?  Any help will be appreciated.

How about this:

   /\(^\|[^\\]\)\(\\\\\)*\\ /e

which, strangely, seems to work on one version of vim I have (6.1.254)
but not on another (6.1.263).


Replacing the * with a \{-} (non greedy equivalent of *) doesn't seem to
help.


The /e at the end takes you to the space.  Replacing it with /e-1 will
take you to the escaping backspace.


HTH
Scott

--
A couch is as good as a chair.

#34910 From: BStrohhaecker@...
Date: Wed Dec 4, 2002 7:08 am
Subject: Re: regex help: finding protected spaces
BStrohhaecker@...
Send Email Send Email
 
Von: Hari Krishna Dara [mailto:hari_vim@...]
Gesendet: Mittwoch, 4. Dezember 2002 03:21

> I need to find all the spaces that are protected by a back-slash. A
> simple regular expression such as '\\\@<= ' will not work because I
> may have something like '\\ ' which is not a valid match. How can I
> construct the regex for a generic case?  Any help will be appreciated.

How about using a simple '[^\\]\\ '?

If needed you can add the special case StartOfLine:
'\%(^\|[^\\]\)\\ '

Additionally use '\zs' to set the start of the match:
'\%(^\|[^\\]\)\\\zs ' rsp. '\%(^\|[^\\]\)\zs\\ '

Bernd

#34911 From: Sean Richards <sean64@...>
Date: Wed Dec 4, 2002 8:20 am
Subject: <cword> on cmdline
sean64@...
Send Email Send Email
 
Hi,

Trying to get <cword> to work on the command line. I want to write a
vim function to search and replace across all open buffers. I started
out playing with <cword>.

:echo expand('<cword>')

puts the cursor word onto the command line. But I cannot seem to use it
in a search and replace. I am trying to use a command like this but it
is not working :(

:bufdo! %s/expand('<cword>')/foobar/ge

Any solutions and/or better ideas appreciated

Cheers,  Sean

#34912 From: Jürgen Krämer <jkraemer@...>
Date: Wed Dec 4, 2002 8:40 am
Subject: Re: <cword> on cmdline
jkraemer@...
Send Email Send Email
 
Hi,

Sean Richards wrote:
>
> :echo expand('<cword>')
>
> puts the cursor word onto the command line. But I cannot seem to use it
> in a search and replace. I am trying to use a command like this but it
> is not working :(
>
> :bufdo! %s/expand('<cword>')/foobar/ge

:exe 'bufdo! %s/' . expand('<cword>') . '/foobar/ge'

(untested)

Regards,
Jürgen

--
Jürgen Krämer                                   Softwareentwicklung
Habel GmbH                                      mailto:jkraemer@...
Hinteres Öschle 2                               Tel: (0 74 61) 93 53 15
78604 Rietheim-Weilheim                         Fax: (0 74 61) 93 53 99

#34913 From: Sean Richards <sean64@...>
Date: Wed Dec 4, 2002 9:25 am
Subject: Re: <cword> on cmdline
sean64@...
Send Email Send Email
 
J?rgen Kr?mer wrote:

> Hi,

> Sean Richards wrote:
> >
> >:echo expand('<cword>')
> >
> >puts the cursor word onto the command line. But I cannot seem to use it
> >in a search and replace. I am trying to use a command like this but it
> >is not working :(
> >
> >:bufdo! %s/expand('<cword>')/foobar/ge

> :exe 'bufdo! %s/' . expand('<cword>') . '/foobar/ge'

> (untested)

Hi Jurgen,

Now tested and works perfectly :) Thankyou !

Cheers,  Sean

#34914 From: "Charles E. Campbell" <cec@...>
Date: Wed Dec 4, 2002 2:23 pm
Subject: Re: regex help: finding protected spaces
cec@...
Send Email Send Email
 
On Tue, Dec 03, 2002 at 06:20:42PM -0800, Hari Krishna Dara wrote:
> I need to find all the spaces that are protected by a back-slash. A
> simple regular expression such as '\\\@<= ' will not work because I
> may have something like '\\ ' which is not a valid match. How can I
> construct the regex for a generic case?  Any help will be appreciated.
  ---------------------------------------------------------------------

     /\\\@<!\(\\\\\)*\\ /

Translated:

     Any even number of backslashes, including zero, followed by a
     backslash then a space, matches.

Matches
     |\ |
     |\\\\\ |
     |\\\\\\\\\ |

Doesn't Match
     |\\\\ |
     |\\\\\\\\ |
     |\\\\\\\\\\\\ |

Regards,
C Campbell

--
         Charles E Campbell, Jr, PhD            _   __   __
         Goddard Space Flight Center           / /_/\_\_/ /
         cec@...      /_/  \/_//_/
   PGP public key: http://www.erols.com/astronaut/pgp.html

#34915 From: "Charles E. Campbell" <cec@...>
Date: Wed Dec 4, 2002 2:27 pm
Subject: Re: Mapping with count
cec@...
Send Email Send Email
 
On Tue, Dec 03, 2002 at 04:36:01AM +0100, kbosau@... wrote:
> I'd like to create a normal mode mapping one
> can control by a number that has to be typed
> in prior to hitting the mapped key...

ex. map \F <right>
     20\F

     The problem is: you can't get ahold of the repeat number.
     Instead the mapping will be repeated as in this example,
     20 times.

     You can grab the repeat value with calls to functions:

         :20 call SomeFunction()

Regards,
C Campbell

--
         Charles E Campbell, Jr, PhD            _   __   __
         Goddard Space Flight Center           / /_/\_\_/ /
         cec@...      /_/  \/_//_/
   PGP public key: http://www.erols.com/astronaut/pgp.html

#34916 From: Steve Litt <slitt@...>
Date: Wed Dec 4, 2002 3:09 pm
Subject: Re: EX paste command?
slitt@...
Send Email Send Email
 
Thanks to all of you who responded and offered the :put command and the
:normal command. Either one of these commands will indeed solve my problem.
Thank you so much

Steve

--
Steve Litt
Author:
    * Universal Troubleshooting Process courseware
    * Troubleshooting Techniques of the Successful Technologist
    * Rapid Learning: Secret Weapon of the Successful Technologist
Webmaster
    * Troubleshooters.Com
    * http://www.troubleshooters.com

(Legal Disclaimer) Follow these suggestions at your own risk.


On Wednesday 04 December 2002 02:38 am, Ofer Roter wrote:
> Steve Litt wrote:
> > Hi all,
> >
> > I'm writing a simple script. Two consecutive lines each, mutually
> > exclusively, contain either "create" or "destroy". I want to make sure
> > the line saying "create" comes first, and I want to do it from an EX
> > script. I
> >
> > know if I could do a paste from the colon prompt I've got it made:
> > :.g/destroy/g
> > :paste
> >
> > Trouble is, I can't find a paste command that works from the colon
> > prompt, and I've spent a half hour crawling thru help. Anyone know how to
> > do a paste from the colon prompt?
> >
> > Thanks
> >
> > SteveT
>
> Maybe the :t :m and :put command can help you.
>
> Look at
>
> help :t
> help :m
> help :put
>
> HTH,
>    Ofer.

#34917 From: Benji Fisher <benji@...>
Date: Wed Dec 4, 2002 3:13 pm
Subject: Re: Mapping with count
benji@...
Send Email Send Email
 
Charles E. Campbell wrote:
> On Tue, Dec 03, 2002 at 04:36:01AM +0100, kbosau@... wrote:
>
>>I'd like to create a normal mode mapping one
>>can control by a number that has to be typed
>>in prior to hitting the mapped key...
>
>
> ex. map \F <right>
>     20\F
>
>     The problem is: you can't get ahold of the repeat number.
>     Instead the mapping will be repeated as in this example,
>     20 times.
>
>     You can grab the repeat value with calls to functions:
>
>         :20 call SomeFunction()

       Mappings cannot handle counts, nor registers, but user-defined
commands can.

:help :command
/Range handling
/Special cases

HTH 			 --Benj Fisher

#34918 From: Jürgen Krämer <jkraemer@...>
Date: Wed Dec 4, 2002 2:58 pm
Subject: Re: Mapping with count
jkraemer@...
Send Email Send Email
 
Hi,

Charles E. Campbell wrote:
> On Tue, Dec 03, 2002 at 04:36:01AM +0100, kbosau@... wrote:
>
>>I'd like to create a normal mode mapping one
>>can control by a number that has to be typed
>>in prior to hitting the mapped key...
>
>
> ex. map \F <right>
>     20\F
>
>     The problem is: you can't get ahold of the repeat number.
>     Instead the mapping will be repeated as in this example,
>     20 times.

another problem: the count is only applied to the first complete
command inside the right hand side of the mapping, e.g.

    map \F <right><right>
    20\F

would move the cursor only by 21 characters, not 40.

Regards,
Jürgen


--
Jürgen Krämer                                   Softwareentwicklung
Habel GmbH                                      mailto:jkraemer@...
Hinteres Öschle 2                               Tel: (0 74 61) 93 53 15
78604 Rietheim-Weilheim                         Fax: (0 74 61) 93 53 99

Messages 34889 - 34918 of 137836   Oldest  |  < Older  |  Newer >  |  Newest
Add to My Yahoo!      XML What's This?

Copyright © 2010 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines NEW - Help