Re: Appending to Paste (*) Register

2007-05-15 Thread zzapper
"Yegappan Lakshmanan" <[EMAIL PROTECTED]> wrote in
news:[EMAIL PROTECTED]: 

> Hi,
> 
> On 5/14/07, zzapper <[EMAIL PROTECTED]> wrote:
>> Hi
>> I believe that the problem of Appending to Paste (*) Register was one
>> of the points Bram was looking at (problem is no uppercase for a
>> symbol) 
>>
>> Was there
>>
> 
> In Vim7 and above, you can append the output of an ex command to the
> clipboard register '*' using the following command:
> 
>   :redir @*>>
> 
> - Yegappan
> 
>From the doc how are the following different?
:redi[r] @*>
:redi[r] @+>Redirect messages to the selection or clipboard. 
For
backward compatibility, the ">" after the register
name can be omitted. See |quotestar| and |quoteplus|.
{not in Vi}
:redi[r] @*>>   
:redi[r] @+>>   Append messages to the selection or clipboard.
        {not in Vi}


Anyway I was looking for something like

:g/fred/y A  append to register a but for the clipboard register *



-- 
zzapper
http://www.rayninfo.co.uk/vimtips.html



Appending to Paste (*) Register

2007-05-14 Thread zzapper
Hi
I believe that the problem of Appending to Paste (*) Register was one of the 
points Bram was looking at (problem is no uppercase for a symbol)

Was there/will there be any progress?

Here's a hack I use

let @w=":redir @*^M:g//^M:redir END"  

-- 
zzapper
http://www.rayninfo.co.uk/vimtips.html



RE: Best way to maintain a 'library' of recorded keystrokes?

2007-04-27 Thread zzapper
"Halim, Salman" <[EMAIL PROTECTED]> wrote in 
news:[EMAIL PROTECTED]:

>> 
>>   > What is the best way to maintain a set of previously recorded
>>   > keystroke sequences? I constantly make use of the record feature
>>   > within one vi session. But some of the sequences I'd like to
>>   > preserve. I realize they get saved in a named register, but that
>>   > register will get overwritten over time, and I have need to
>>   > recall previous instances of the register.
>>   >
> 
I have the following in my .vimrc

" preload a register, just do @y to execute vim command on current line
let @y='"[EMAIL PROTECTED]' " execute command in text
let @m=":'a,'bs#"   " substitute between 2 markers
let @n="r1jr2jr3jr4jr5jr6jr7jr8jr9jr0"  " number a column 1-10
let @d="rSjrMjrTjrWjrHjrFjrSjrS"" Days of Week Columniser
let @p=":redir @*"  " start redirect to paste buffer
let @e=":redir END"     " end redirect
let @s=":%!sort -u" " sortfile unique
let @t="gUlW"   " Titlize words in a sentence
let @z=":bufdo %s//&/gic

HTH


-- 
zzapper
http://www.rayninfo.co.uk/vimtips.html



Re: button "t" useless?

2007-04-26 Thread zzapper
Arun Easi <[EMAIL PROTECTED]> wrote in news:Pine.GHP.4.64.0704260850470.4589
@mammoth.cup.hp.com:

> On Thu, 26 Apr 2007, zzapper wrote:
> 
>> In fact I've found that there is usually (always?) a subtle advantage in
>> using one or other of a command which apparently does the same thing, and
>> that in different circumstances one or the other will be superior.
>>
>> eg
>>
>> When the cursor is in the middle of a word you wish to delete
>>
>> diw has a distinct advantage over bdw
>>
>> But what is it?
>>
> 

The sometime advantage is that diw/daw is dottable so you can j. down an 
uneven list. 


-- 
zzapper
http://www.rayninfo.co.uk/vimtips.html



Re: button "t" useless?

2007-04-26 Thread zzapper
zzapper <[EMAIL PROTECTED]> wrote in
news:[EMAIL PROTECTED]: 

> alebo <[EMAIL PROTECTED]> wrote in
> news:[EMAIL PROTECTED]: 
> 
>> 
> In fact VIM has many features that appear redundant but then one day
> (perhaps after many years) you realise their utility.
> 
In fact I've found that there is usually (always?) a subtle advantage in 
using one or other of a command which apparently does the same thing, and 
that in different circumstances one or the other will be superior.

eg

When the cursor is in the middle of a word you wish to delete

diw has a distinct advantage over bdw

But what is it?


-- 
zzapper
http://www.rayninfo.co.uk/vimtips.html



Re: button "t" useless?

2007-04-25 Thread zzapper
alebo <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]:

> 
> Whats the reason vim has the function t
> which does the same as f, only moving to the character
> before? It seems useless to me; you can use f insted
> of t always, or...?
Alebo,
If you just use f & t to move then I agree, however if you use f & t with a 
modifier eg ct" df>  (change and delete) then the difference becomes very 
useful.

In fact VIM has many features that appear redundant but then one day (perhaps 
after many years) you realise their utility.


-- 
zzapper
http://www.rayninfo.co.uk/vimtips.html



Re: how to setup gvim as view source editor for Opera?

2007-03-18 Thread zzapper
Taylor Venable <[EMAIL PROTECTED]> wrote in 
news:[EMAIL PROTECTED]:

>> > 
>> > For Opera, open the preferences, click on the "Advanced" tag, then
>> > choose "Programs" from the list on the left.  At the bottom of the
>> > right-hand side, there's the option to set the source viewer
>> > program.
>> ## Couldn't see it for looking!###
> 
Yes that's where it is thanks
What I meant by above was that I was annoyed with myself that I hadn't seen 
it myself



-- 
zzapper
http://www.rayninfo.co.uk/vimtips.html



Re: how to setup gvim as view source editor for Opera?

2007-03-17 Thread zzapper
Taylor Venable <[EMAIL PROTECTED]> wrote in 
news:[EMAIL PROTECTED]:

> On Sat, 17 Mar 2007 15:01:17 + (UTC)
> zzapper <[EMAIL PROTECTED]> wrote:
> 
>> I've forgotten how to setup gvim as view source editor for Opera (got
>> a new Vista PC). Also can anyone recommend the best solution for
>> FireFox, I've only got the one where viewing source with vim is an
>> additional option
> 
> For Opera, open the preferences, click on the "Advanced" tag, then
> choose "Programs" from the list on the left.  At the bottom of the
> right-hand side, there's the option to set the source viewer program.
## Couldn't see it for looking!###
> 
> In Firefox, type "about:config" into the URL bar and hit ENTER.  Type
> "source" in the filter box and hit ENTER.  Double-click on the entry
> for "view_source.editor.external" so its value changes to "true".  Then
> double-click on the entry for "view_source.editor.path" and enter the
> path to your Vim in there.  Then close the tab.  That should do it!
> 
### Excellent###
Thanks

-- 
zzapper
http://SuccessTheory.com/tips/ vim, zsh & success tips




how to setup gvim as view source editor for Opera?

2007-03-17 Thread zzapper
Hi,
I've forgotten how to setup gvim as view source editor for Opera (got a new 
Vista PC). Also can anyone recommend the best solution for FireFox, I've only 
got the one where viewing source with vim is an additional option


-- 
zzapper
http://SuccessTheory.com/tips/ vim, zsh & success tips




RE: Pasting into gvim from word: ' turns into �

2007-02-12 Thread zzapper
Steve Hall <[EMAIL PROTECTED]> wrote in 
news:[EMAIL PROTECTED]
ecureserver.net:

> From: ben lieb, Fri, February 09, 2007 11:58 am
>> 
>> I asked this question before, but it wasn't really resolved. I often
>> have to paste from Word for Windows into vim/gvim (cygwin).
>> 
>> Some characters don't transfer properly. Most annoyingly is that a
>> single quote ( ' ) turns into this: ¿
>> 
>> Is there an easy way around this?
> 
> It could just be a font issue, make sure your gvim font supports
> non-ASCII characters. (I find Courier New or Andale Mono provide
> extensive support.)
> 

Hi I use

map!   :let @* = substitute(@*,'[^[:print:]]',' ','g')"*p
map :let @* = substitute(@*,'[^[:print:]]',' ','g')"*p

Which filters most but not all the crud

BTW if anyone knows how to add extra characters to the filter '[^
[:print:]]'

please let me know


-- 
zzapper
http://successtheory.com/tips/ Vim, Zsh, MySQL Tips



Re: Tip karma storms

2007-01-23 Thread zzapper
Charles E Campbell Jr <[EMAIL PROTECTED]> wrote in
news:[EMAIL PROTECTED]: 

> Hello!
> 
> The following is a note that I sent to Scott Johnston; perhaps people 
> have woken up and decided in large groups that they really like my 
> tips,  :) but:
> 
> For the third time since January 15, I've seen "tip storms" in karma 
> rating changes.
> Here's the latest one (Jan 22, 2007):
> 
> Karma/Raters/Downloads:
>  dK/dR/  dD:  K / R /  D
>   tip changed by 20/ 5/  17:  96/ 33/5988 How to initialize plugins
> 
> I noticed this karma-increase-storm for a bunch of other tips, too.
> 
> I figure either its a vandal or perhaps the tip-note cleaning process 
> has a bug affecting karma ratings.
> If its a vandal, I have no idea what can be done about it, but I thought
> I'd pass the info along.  He suggested I let you know.
> 
> 

Chip,
I too have noticed this, it may be due to Google providing "free" adverts to 
individual VIM tips (those ads to right of search results). I have have 
noticed on at least two occasions a google Ad for my tip 305 "Best of 
Vimtips" . Vim may hopefully be reaching parts never before cleaned, whoops 
where was I, I mean reaching a new set of potential users.

zzapper





-- 
zzapper
http://successtheory.com/tips/ Vim, Zsh, MySQL Tips



Re: Hello world & vim related software

2007-01-07 Thread zzapper
Adrien BUSTANY <[EMAIL PROTECTED]> wrote in news:45A01454.5030100
@mymadcat.com:

> [ This message is an ad for a GPLed software I wrote for my everyday vim
> usage. You've been warned :-) ]
> Hi there,
> Since the day I discovered sessions with vim I cannot live without them.
> I wanted a quick way to launch gvim -S mysessionfile and couldn't find
> one, so I developed a little app based on GTK 2.10 which answers my needs.
> The app sits in the tray (I believe it's freedesktop compatible though
> I'm not sure). You can use it to register where your vim session files
> are, and then it makes them available through a simple popup menu. That
> way, all your projects will stand one click away :)
> The homepage is http://mymadcat.com/vimsessions/

I've never really used sessions much (for no particular reason)  I'd probably 
use an alias (Cygwin on win32)

eg
alias vproj='gvim x[1-3].php doc.txt'

-- 
zzapper
http://successtheory.com/tips/ Vim, Zsh, MySQL Tips



Re: GVIM 7-0-178 seizing up

2006-12-19 Thread zzapper
"Greg Dunn" <[EMAIL PROTECTED]> wrote in
news:[EMAIL PROTECTED]: 

> On 12/19/06, zzapper <[EMAIL PROTECTED]> wrote:
>> Hi
>> http://downloads.sourceforge.net/cream/gvim-7-0-178.exe?modtime=116557
>> 8469 &big_mirror=0
>>
>> Downloaded above by following links from vim.org
>>
>> It works fine with most files but cannot edit .vimrc (unless I rename
>> .vimrc to say fred)
>> it shows the menu "read only, edit anyway etc then seizes.
>>
>> I expect I'm posting this in the wrong forum, but where?
>>
>> --
>> http://successtheory.com/tips/ Vim, Zsh, MySQL Tips
>>
>>
> 
> Does it freeze when you try to edit other .vim files?  I had a similar
> problem a while back using the install available from the Cream site,
> see if these threads help you out:
> 
> http://tech.groups.yahoo.com/group/vim/message/74219
> http://tech.groups.yahoo.com/group/vimdev/message/45215
> 
Eureka Greg
in /vimfiles/syntax/vim.vim 
I deleted the if('tcl')... endif section 
and Bob's your Aunty it worked


-- 
zzapper
http://successtheory.com/tips/ Vim, Zsh, MySQL Tips



RE: GVIM 7-0-178 seizing up

2006-12-19 Thread zzapper
Steve Hall <[EMAIL PROTECTED]> wrote in
news:[EMAIL PROTECTED]
.secureserver.net: 

> From: zzapper , Tue, December 19, 2006 6:53 am
>> 
>> http://downloads.sourceforge.net/cream/gvim-7-0-178.exe?modtime=116557
>> 8469&big_mirror=0   
>> 
>> Downloaded above by following links from vim.org
>> 
>> It works fine with most files but cannot edit .vimrc (unless I
>> rename .vimrc to say fred) it shows the menu "read only, edit anyway
>> etc then seizes.
> 
> The correct name of vimrc on Windows is "_vimrc". A file with a
> preceding dot is actually not a permitted file name on Windows.
> (Although there are ways of getting one on the system.)
> 
Steve
Renamed .vimrc to _vimrc same problem. Am actually using CygWin and DO NOT 
have same problem if I edit via Windows Explorer. I utterly guestimate it's 
something to do with Vim External?  vimext.dll (which initially wouldn't 
overwrite old vim7.0 version??

zzapper



-- 
http://successtheory.com/tips/ Vim, Zsh, MySQL Tips



GVIM 7-0-178 seizing up

2006-12-19 Thread zzapper
Hi
http://downloads.sourceforge.net/cream/gvim-7-0-178.exe?modtime=1165578469
&big_mirror=0   

Downloaded above by following links from vim.org

It works fine with most files but cannot edit .vimrc (unless I rename 
.vimrc to say fred)
it shows the menu "read only, edit anyway etc then seizes.

I expect I'm posting this in the wrong forum, but where?

-- 
http://successtheory.com/tips/ Vim, Zsh, MySQL Tips



Re: Useful Tools to Assist Editing (Not just VIM)

2006-12-15 Thread zzapper
"Aaron Griffin" <[EMAIL PROTECTED]> wrote in 
news:[EMAIL PROTECTED]:


> 
> Related note, but not on topic:
> I like slimKEYS under windows for global hotkey management:
> http://slimcode.com/slimKEYS/
> 
I have updated the following page to include the "External" utility
which allows you to use VIM in other Windows Applications, tested
on MsWord Outlook, Pegasus and best of all my Web based Blog at blogger.com

http://successtheory.com/tips/vimtools.php

BTW tip: when using External, if it doesn't paste the text back into the 
application first time click "retry"

Thanks to whoever recommended external. And remember to try out the 
clipboard tool it's also life changing!!

Merry Crimbo!

-- 
http://successtheory.com/tips/ Vim, Zsh, MySQL Tips



Re: regexp substitution problem

2006-12-12 Thread zzapper
zzapper <[EMAIL PROTECTED]> wrote in news:Xns9897D2B986F7zzappergmailcom@
80.91.229.5:

>:%s/\s\+|.*
> 
> You need to backslash the +, but not the |
> 
> or simpler but possibly morally inferior
> 
:%s/\s*|.*
 
-- 
zzapper
http://successtheory.com/tips/ Vim, Zsh, MySQL Tips



Re: regexp substitution problem

2006-12-12 Thread zzapper
Bram Kuijper <[EMAIL PROTECTED]> wrote in news:457F106C.6060207
@rug.nl:

> Hi,
> 
> I am quite new to vim and just started to use regular expressions to 
> replace certain amounts of text. For example, in the following piece of 
> text I would like to keep only the first column and delete the rest:
> 
>   optimal_value_viability   | real| default 0.0
>   number_generations| integer | default 0
>   output_per_number_generations | integer | default 0
>   number_trait_loci | integer | default 0
>   number_pref_loci  | integer | default 0
>   number_viability_loci | integer | default 0
>   random_seed   | bigint  | default 0
> 
> so I execute the following regexp as a vim command:
> 
>:%s/\s+\|.*//
> 
> 
:%s/\s\+|.*

You need to backslash the +, but not the |

or simpler

:%s/\s\+|.*

With your name you should become very good at Vim!



-- 
zzapper
http://successtheory.com/tips/ Vim, Zsh, MySQL Tips



Re: www.vim.org partially unreachable

2006-12-08 Thread zzapper
Fritz Mehner <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]:

> For at least 1 day the script section of www.vim.org
> seems to be unreachable:
> 
>  Recent Script Updates   0 scripts, 0 downloads 
> 
> 
> 'more recent' shows no script,  'most downloaded' and 'top rated' show 
> an error:
> 
>   *Vim Online Error*
>   Can't open file: 'vs_scripts.MYI' (errno: 145)
> 
> F. Mehner
> 
I can confirm this error, tried by vim.sf.net as well

Tips Ok Scripts NOK


-- 
http://successtheory.com/tips/ Vim, Zsh, MySQL Tips



Thanks for Colo(u)red Syntax!

2006-12-05 Thread zzapper
Hi
Just wanted to thank those involved in colouring syntax.
I've just had a case where I foolishly "ignored" the fact that colouring 
was indicating an error! . I often have Javascript, html, mixed up with Php 
or Coldfusion and yet the colouring works.

And to think when I moved from Vi to VIM I thought that colour was for 
namby-pambies!!

-- 
http://successtheory.com/tips/ Vim, Zsh, MySQL Tips



Re: your best vim scripting tip

2006-12-03 Thread zzapper
"Yakov Lerner" <[EMAIL PROTECTED]> wrote in 
news:[EMAIL PROTECTED]:

> On 12/3/06, Kim Schulz <[EMAIL PROTECTED]> wrote:
>> On Sun, 3 Dec 2006 11:53:37 +0200
>> "Yakov Lerner" <[EMAIL PROTECTED]> wrote:
>> > Depends on your task you have at hand.
>> > Once you know the task, you can pick related script(s)
>> > from www.vim.org/scripts and learn from them.
>>
>> sure, but many of the scripts are done by script-programming-beginners
>> an includes tons of bad scripting. What I am asking for i "what would
>> you do  different if you should redo one of your first scripts -
>> programming-wise not functionallity!
> 

These scripts might be of interest:-

foo.vim : examples of Vim functions (and a few commands, etc.)

http://www.vim.org/scripts/script.php?script_id=72 

genutils : General utility functions

http://www.vim.org/scripts/script.php?script_id=197 


-- 
http://successtheory.com/tips/ Vim, Zsh, MySQL Tips



Re: Useful Tools to Assist Editing (Not just VIM)

2006-12-01 Thread zzapper
Gary Johnson <[EMAIL PROTECTED]> wrote in
news:[EMAIL PROTECTED]: 

> On 2006-12-01, Troy Piggins <[EMAIL PROTECTED]> wrote:
>> * zzapper <[EMAIL PROTECTED]> :
> 
> I've been using 'external' for quite a while and am very happy with 
> it.
> 
> http://bur.st/~benc/?p=external
> 
> I found out about it from
> 
> http://vim.sourceforge.net/tips/tip.php?tip_id=805
> 
> HTH, Gary

Gary
That's wonderful and super quick to set up
Tried it in MSWORD and Pegasus Email

I applied the patch mentioned in tip805
external.vim (vim7)
if exists(b:ECdidBufferInit)
change to 
if exists("b:ECdidBufferInit")

by rainergrohmann

s


-- 
zzapper
http://successtheory.com/tips/ Vim, Zsh, MySQL Tips



Re: Matching JUST the nth occurence of a text in a line

2006-12-01 Thread zzapper
"A.J.Mechelynck" <[EMAIL PROTECTED]> wrote in
news:[EMAIL PROTECTED]: 

> Bill McCarthy wrote:
>> On Thu 30-Nov-06 11:49pm -0600, Peter Hodge wrote:
>>> --- Bill McCarthy wrote:
 On Thu 30-Nov-06 10:24pm -0600, Peter Hodge wrote:
> --- Bill McCarthy wrote:
>> On Thu 30-Nov-06 9:20pm -0600, Peter Hodge wrote:
>> 
>>> Try:
>>>
>>>   /^.\{-}home.\{-}\zshome
>>>

/^.\{-}home.\{-}\zshome/e

Was the solution I was looking for (BTW the /e indicates where the match 
ends)

Thanks
-- 
http://successtheory.com/tips/ Vim, Zsh, MySQL Tips



Matching JUST the nth occurence of a text in a line

2006-11-30 Thread zzapper
Hi given a sample text below

home

home gg home xxx

home ggg ggg home home

home home

How do you match JUST the second "home" in any of the above lines (ie avoid 
greediness)


-- 
zzapper
http://successtheory.com/tips/ Vim, Zsh, MySQL Tips



Useful Tools to Assist Editing (Not just VIM)

2006-11-30 Thread zzapper
Hi
I've just come across a (Windows) utility which stores the last 25 things 
(clips) that you've copied and pasted. Click on the utility in your system 
tray and up pops a 5 by 5 grid.
Each pigeon hole in the grid shows enough of the clip to help you recall 
the one you want.
click in the pigeon hole and it pastes the contents.

It's called M8 Free Multi Clipboard (I think it's WONDERFUL, so here I am 
telling everyone about it)

I also use a Text Replacement Utility called ShortKeys which acts a bit 
like a VIM abbreviation ie you type a short code and it replaces the code 
with a long sequence of text or code that you use frequently eg a chunk of 
code, an address etc.

I use also use a Screenscraper which allows me to copy and paste text from 
applications that normally don't allow it.

I've done a page to describe these tools in more details.

http://successtheory.com/tips/vimtools.php

They are mostly or are all free, and there are probably many other 
alternatives (please post here if you have your own preferences). They are 
also mostly Windows but I expect there are similar *nix versions)

-- 
zzapper
Best of VimTips
http://www.vim.org/tips/tip.php?tip_id=305



Re: change case on multiple words

2006-11-29 Thread zzapper
"A.J.Mechelynck" <[EMAIL PROTECTED]> wrote in
news:[EMAIL PROTECTED]: 

> zzapper wrote:
> [...]
>> Tony
>> is \0 always same as & ?
> 
> yes, if 'magic' is TRUE, see ":help sub-replace-special". If ever you
> set 'nomagic' (not recommended), then & will replace with an &
> character while \0 still means the whole matched pattern.
> 
> Tony.
The other advantage I suppose in using \0 is that it makes your regexp more 
visible and fits in better with the memory syntax of \1..\9
-- 
zzapper
Best of VimTips
http://www.vim.org/tips/tip.php?tip_id=305



Re: change case on multiple words

2006-11-28 Thread zzapper
"A.J.Mechelynck" <[EMAIL PROTECTED]> wrote in
news:[EMAIL PROTECTED]: 


>  guu:s/\<./\u\0/g

A pastable or mappable version

:s/.*/\L&/|:s/\<./\u&/g

" .vimrc titlise a line
nmap ,t :s/.*/\L&/:s/\<./\u&/g

Tony
is \0 always same as & ?


-- 
http://successtheory.com/tips/ Vim, Zsh, MySQL Tips



Text Swapper Utility

2006-11-27 Thread zzapper
Hi,
Apparently in emacs there is a meta-command with allows you to swap text on 
either side of a non-alphanumeric character. Now I know how to do this in 
Vim with a regexp or with markers and yanking. But does anyone know of 
anything more elegant?

Also to extend to a more general case, swap any A with any Text B


-- 
http://successtheory.com/tips/ Vim, Zsh, MySQL Tips



Start new line from insert mode

2006-04-26 Thread zzapper
Hi,

I am in the middle of line in insert mode and want to break out of the line 
and start a new line (above or below)

What I want  is effectively
o   or O

But does Vim7 have a native command for this?


-- 
http://successtheory.com/tips/ Vim, Zsh, MySQL Tips



Re: vim7.0e beta tabs and buffers

2006-04-20 Thread zzapper
"Eric Arnold" <[EMAIL PROTECTED]> wrote in 
news:[EMAIL PROTECTED]:

> On 4/20/06, Silent1 <[EMAIL PROTECTED]> wrote:
>> Hi all,
>> just tried out vim7.0e on my xp machine (at home and at work, although
>> i'm setting my my new mac mini at home). I read thru the :help
>> version7 and i was wondering how tabs work with buffers. I use
>> minibuffer explorer to show the different buffers per window, i was
>> wondering if you can have different buffers per tab and send buffers
>> from one tab to another?
> 

Is it possible to make tabs default behaviour?
ie gf or :e somefile would automatically open a new tab?