simple map question for changing window size

2006-06-25 Thread Johannes Schwarz
Hi all,

I want to have mappings for resizing splitted windows.

For increasing and decreasing the width the following mappings are
working:

nmap + >
nmap - < 

But the mapping for increasing and decreasing the heights don't work:
nmap  +
nmap  -


I think I have to escape the + and - somehow and I looked in the help
already, but still I have no clue how to do it.


Joe


Re: after :vert sba hide all windows again except the active on

2006-06-22 Thread Johannes Schwarz


>>> Jürgen Krämer <[EMAIL PROTECTED]> 22.06.2006 10:22 >>>


>Hi,

>Johannes Schwarz wrote:

>> I just realized the :sba   or even better the  :vert sba   command.
>> 
>> Is it possible to hide all windows again except the active one, which
>> the cursor is in?

>have a look at

>  :help :only

This is exactly what I was looking for.

>> And another question:
>> When I set the all windows to "scrollbind" and make jump to a special
>> line, I want each window to show that line and not the offset to the
>> original line.
>> One solution is to do  :windo normal gg  and then  :windo set
>> scrollbind   but is there an easier way?
>
>Does
>
>  :set scrollopt+=jump
>
>help?

No, it still jumps only to the offset of the original line, but I can live with 
:window normal gg

Thanx a lot for your help

Ciao

Johannes




after :vert sba hide all windows again except the active on

2006-06-22 Thread Johannes Schwarz
I just realized the :sba   or even better the  :vert sba   command.

Is it possible to hide all windows again except the active one, which
the cursor is in?

And another question:
When I set the all windows to "scrollbind" and make jump to a special
line, I want each window to show that line and not the offset to the
original line.
One solution is to do  :windo normal gg  and then  :windo set
scrollbind   but is there an easier way?




URL-Encoding

2006-06-14 Thread Johannes Schwarz
Is there a builtin url-encoding function available in vim? 

Or has s.o. wrote a script already?

thanx

Joe




WIKA Alexander Wiegand GmbH & Co. KG
Johannes Schwarz
International Consulting & E-Commerce
phone:+49 (0)9372 132 657
fax:+49 (0)9372 132 197
cell-phone: +49 (0)176 21317963
e-mail:[EMAIL PROTECTED]
internet: http://www.wika.de 



Antw: Re: Loop through all lines in a file

2006-06-01 Thread Johannes Schwarz
First of all I want to thank everyone, who contributes to this list.
It's one of the best lists I know of.

The response time is so quick and the quality of the answer are really
great  ...  thank you really much. 

In the meantime I found a solution myself:

let s:lnr=line(".")
let s:image=getline(s:lnr)
while (strlen(s:image) != 0) 
let s:lnr=s:lnr+1
let s:image=getline(s:lnr)
endwhile

Compared to your suggested solutions it's not that good (but anyway I'm
poud of myself ;-)

I'm not that familiar with the global commands yet, maybe I have to
read the documentation again.


 >>> Benji Fisher <[EMAIL PROTECTED]> 01.06.2006 14:41:38 >>>
> On Thu, Jun 01, 2006 at 01:43:48PM +0200, Johannes Schwarz wrote:
> > Hello,
> > 
> > I'm trying to write my first vim-plugin, but I got stucked.
> > 
> > I managed to execute an external command, which gives me back a
list of
> > filenames.
> > One filename per line.
> > 
> > For each of the filenames I want to execute another command. 
> > I tried it with code:
> > 
> > let line=getline(".")
> > while (strlen(line)!=0)
> > "do sth. here -- construct the external command and so on
> > j
> > let line=getline(".")
> > endwhile
> 
> Remember that a vim script (including a plugin) is a list of
> commands in Command-Line (Ex) mode, not Normal mode. So that j means
> :j[oin], not "move the cursor down one line." If you change "j" to
"+"
> it will be a step in the right direction.
> 
> > When I execute the code, it runns into an infinite loop, because
the
> > lines are joined together with each loop
> > 
> > file:
> > text1.txt
> > text2.txt
> > text3.txt
> > 
> > after interrupting the loop the looks like
> > text1.txt text2.txt text3.txt
> 
> That's right.
> 
> > it seems j is interpreted as a J (join line) here.
> > And by the way, I think this is a bad solution anyway. 
> > Can someone give me a hint how to do it in a clean way?
> 
> Either
> 
> :g/./
> 
> or
> 
> let linenr = 0
> while linenr < line("$")
> let linenr += 1" The += construction requires vim 7.0 .
> let line = getline(linenr)
> " ...
> endwhile
> 
> HTH--Benji Fisher
> 



Loop through all lines in a file

2006-06-01 Thread Johannes Schwarz
Hello,

I'm trying to write my first vim-plugin, but I got stucked.

I managed to execute an external command, which gives me back a list of
filenames.
One filename per line.

For each of the filenames I want to execute another command. 
I tried it with code:

let line=getline(".")
while (strlen(line)!=0)
  "do sth. here -- construct the external command and so on
  j
  let line=getline(".")
endwhile

When I execute the code, it runns into an infinite loop, because the
lines are joined together with each loop

file:
text1.txt
text2.txt
text3.txt

after interrupting the loop the looks like
text1.txt text2.txt text3.txt

it seems j is interpreted as a J (join line) here.
And by the way, I think this is a bad solution anyway. 
Can someone give me a hint how to do it in a clean way?


execute macro in bufdo command

2006-05-31 Thread Johannes Schwarz
Hi all,

I recorded a macro (search for line and paste 3 lines out of the
clipboard"*p  )

I want to execute the macro in 15 different buffers and tried it with
the bufdo - Command, without success

:bufdo  @a | update

Vim prints 30 lines (every first line the filename and every second
line the search-criterium), then it waits for me pressing a key. 
But nothing changed in the files.

Does someone can give me a hint?