html formatting in netrw

2012-03-11 Thread Efraim Yawitz
Hi,

I've looked around the help and archives, but I can't find anything about
this problem:

How do I set netrw so that when I do :e http://someurl.html, vim displays
it as raw HTML code rather than formatting it like a browser?

Thanks,

Ephraim

-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php


Re: html formatting in netrw

2012-03-11 Thread Benjamin R. Haskell

On Sun, 11 Mar 2012, Efraim Yawitz wrote:


Hi,

I've looked around the help and archives, but I can't find anything about this 
problem:

How do I set netrw so that when I do :e http://someurl.html, vim 
displays it as raw HTML code rather than formatting it like a browser?


It sounds like your g:netrw_http_cmd or g:netrw_http_xcmd is 
misconfigured or pointing to something undesirable.  Netrw shouldn't do 
what you're describing by default.  If you have `curl` or `wget` 
available, I'd add:


let g:netrw_http_cmd = 'curl'

or:

let g:netrw_http_cmd = 'wget'

to your .vimrc.  I've had problems in the past trying to get raw HTML 
out of certain versions of `links`/`elinks`.  (Both of them seem like 
bad default choices for fetching raw HTML, considering there are at 
least three different forks of `links`/`elinks`, each of which behaves 
differently.)


--
Best,
Ben

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php


How does the non matching stuff work

2012-03-11 Thread Martin Krischik
Hello,

I mastered most of regular expressions. Only with the “non matching stuff” I 
still have my problems. Say want to find all lines containing Level.FINE — but 
not those who have been commented out. First idea would be:

/\C\v(\/\/)@!.{-}/

The @! is supposed to not match - but it still does. And I don't even know why.

Regards

Martin

-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php


Re: How does the non matching stuff work

2012-03-11 Thread Martin Krischik
I should mention, I tried:

/(\/\/.*)@!/
/\C\v(\/\/)@!.*/

as well.

-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php


Re: relativenumber is very very slow.

2012-03-11 Thread Charles E Campbell Jr

Yichao Zhou wrote:

Hi everyone.
   When I write tex, I always find that typing in vim is very very lag
when the file become longer.  I used to think this is the problem of
latex's complicated syntax.  So I just ignore it.  But today I find
that after disabling 'relativenumber' or change it to 'number' make
vim behave like a rocket.  I have never enjoyed a such so smooth VIM!

Why 'relativenumber' will cause vim so lag even if I just type.  Also
I found that 'relativenumber' will cause mouse scrolling must slower
than 'number'.  I think it should not be so slow since it do not do
many thing.  There must be some bugs in vim.  At least it should give
a warning in document to tell the user this option will heavily slow
down the VIM.

   

For speeding up Latex+syntax highlighting:

  :he tex-slow
  :he tex-folding

Hope that helps,
Chip Campbell

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php


Re: How does the non matching stuff work

2012-03-11 Thread Tim Chase

On 03/11/12 12:47, Martin Krischik wrote:

I mastered most of regular expressions. Only with the “non
matching stuff” I still have my problems. Say want to find all
lines containing Level.FINE — but not those who have been
commented out. First idea would be:

/\C\v(\/\/)@!.{-}/

The @! is supposed to not match - but it still does. And I
don't even know why.


You don't give the text you're trying to match against, but 
sometimes turning on 'hls' can help you see why it's not matching 
what you think.  In your case, I _suspect_ that it doesn't match 
starting at the "//", but that the match actually begins before 
or after the "//" depending on the line because the @! merely 
asserts that the "//" can't match at the starting point of the 
match (it could match before/after).  To get the expression you 
want, I'd use


  /^\%(\%(\/\/\)\@!.\)*Level\.FINE.\{0,2}>/

which asserts that you're looking for "Level.FINE" only where 
"//" doesn't match at every position preceding it.


-tim


--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php


vim cmd arguments, know they size (0,1,...)

2012-03-11 Thread Sergey Vakulenko
Hello

could anyone say, its possible to know the number of cmd arguments
called with vim ?

i mean:

#without arguments
vim&

#with one argument
vim file.txt &

i need something like that

autocmd VimEnter* nested call BufReminderRMX_LoadEvent()

func BufReminderRMX_LoadEvent()
if vim_cmd_args == 0
do one thing
else
do other thing
endif
endfunc




-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php


Using vim as a syntax highlighter

2012-03-11 Thread powertomato

Hi,

I'm using vim in a script to generate syntax highlighted HTML files for 
source code. A very simple one to reproduce my error is:


#!/bin/bash
if [ $# -ne 2 ];then
echo 'Usage:'
echo "$0 /path/to/src /path/to/file.html"
else
vim -n $1 -cTOhtml -c"w! $2" -cq! -cq! &>/dev/null
fi

and for the sake of completenes here is the .vimrc of the user running it:

let html_use_css=1
let html_number_lines=1
let html_no_pre=1
syntax on

What I'm doing is:
 * open a file (vim -n $1)
 * generate syntax-highlighted HTML (-cTOhtml)
 * save it somewhere (-c"w! $2")
 * and quit both windows (-cq! -cq!)

While this works well I'm not quite happy with it. After adding 
"&>/dev/null" (I also tried using @vim [...]) to suppress the output the 
script takes ~3 seconds per file, idling most of the time. I think this 
is because of the ncurses library which isn't satisfied with /dev/null 
not beeing a terminal.
Is there a way to get around this (e.g. running vim quietly just 
processing through some commands or using some settings to ignore the 
case of /dev/null not beeing a terminal)?


Best regards,
Stefan

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php


Re: DirDiff Error With Spaces

2012-03-11 Thread Stephen Rasku
On Fri, Mar 9, 2012 at 22:59, John Beckett  wrote:
>
> The following works on Windows XP and Linux:
>
>  opts.vimdiff = -f "+next" "+execute 'DirDiff'
>    fnameescape(argv(0)) fnameescape(argv(1))"

I've verified that reversing the single- and double-quotes works on
Linux.  I don't have XP so I can't verify that works in that
configuration.  As such, I haven't updated the document at:


http://mercurial.selenic.com/wiki/ExtdiffExtension#Create_Custom_extdiff_Commands

...Stephen

-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php


Some keys not easily available for :map or :imap

2012-03-11 Thread Kevin O'Gorman
I'm trying to give myself a bunch of keyboard shortcuts.  I do fine with most 
keys, but F1-F4 are not recognized with any modifiers.  I suspect there's a 
problem in keymapping at some level.

I'm running under gnome 2 on Ubuntu Linux 11.04.

In my .vimrc,
:map  iHello there.
it works fine.  If I try
:map  iHi there.
it does nothing.

Now, with showkey(1) I've found that Shift-F2 emits the characters O1;2Q
And if I use this sequence in the map command, it works fine:
:map O1;2Q iFinally working.

Summary:
Modifiers on F5-F12 work fine.
F1-F4 work fine in the absence of modifiers.
Some of the combinations don't work in showkey(1) so I don't expect them to 
work in vim.  The combos that should work but don't are
S-F1 C-S-F1 M-S-F1
S-F2 C-F2 C-S-F2 M-F2 M-S-F2
S-F3 C-F3 C-S-F3 M-F3 M-S-F3
S-F4 C-F4 C-S-F4 M-S-F4

This is so odd, I don't know if my setup is mangling these characters, or if 
it's something else.

Is this true for anyone else?  Is there a solution?

-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php


Re: Some keys not easily available for :map or :imap

2012-03-11 Thread Tim Chase

On 03/11/12 19:31, Kevin O'Gorman wrote:

I'm running under gnome 2 on Ubuntu Linux 11.04.


Are you running gvim or vim, and if (non-g)vim, which terminal 
are you using?  Gnome-terminal, xterm, rxvt, or some other?


I know some of the terminal programs intercept certain key-codes.

-tim


--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php


Re: relativenumber is very very slow.

2012-03-11 Thread Yichao Zhou
What I mean is that in help of 'cursorline'
> Will make screen redrawing slower.

Since 'relativenumber' will make it slower too(but number does not),
should the document point out this?


Regards,
Yichao Zhou

On Mon, Mar 12, 2012 at 2:20 AM, Charles E Campbell Jr
 wrote:
> Yichao Zhou wrote:
>>
>> Hi everyone.
>>   When I write tex, I always find that typing in vim is very very lag
>> when the file become longer.  I used to think this is the problem of
>> latex's complicated syntax.  So I just ignore it.  But today I find
>> that after disabling 'relativenumber' or change it to 'number' make
>> vim behave like a rocket.  I have never enjoyed a such so smooth VIM!
>>
>> Why 'relativenumber' will cause vim so lag even if I just type.  Also
>> I found that 'relativenumber' will cause mouse scrolling must slower
>> than 'number'.  I think it should not be so slow since it do not do
>> many thing.  There must be some bugs in vim.  At least it should give
>> a warning in document to tell the user this option will heavily slow
>> down the VIM.
>>
>>
>
> For speeding up Latex+syntax highlighting:
>
>  :he tex-slow
>  :he tex-folding
>
> Hope that helps,
> Chip Campbell
>
> --
> You received this message from the "vim_use" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php

-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php


Re: vim cmd arguments, know they size (0,1,...)

2012-03-11 Thread Gary Johnson
On 2012-03-11, Sergey Vakulenko wrote:
> Hello
> 
> could anyone say, its possible to know the number of cmd arguments
> called with vim ?
> 
> i mean:
> 
> #without arguments
> vim&
> 
> #with one argument
> vim file.txt &

:help argc()

Regards,
Gary

-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php


Re: Using vim as a syntax highlighter

2012-03-11 Thread Gary Johnson
On 2012-03-11, powertomato wrote:
> Hi,
> 
> I'm using vim in a script to generate syntax highlighted HTML files
> for source code. A very simple one to reproduce my error is:
> 
> #!/bin/bash
> if [ $# -ne 2 ];then
> echo 'Usage:'
> echo "$0 /path/to/src /path/to/file.html"
> else
> vim -n $1 -cTOhtml -c"w! $2" -cq! -cq! &>/dev/null
> fi
> 
> and for the sake of completenes here is the .vimrc of the user running it:
> 
> let html_use_css=1
> let html_number_lines=1
> let html_no_pre=1
> syntax on
> 
> What I'm doing is:
>  * open a file (vim -n $1)
>  * generate syntax-highlighted HTML (-cTOhtml)
>  * save it somewhere (-c"w! $2")
>  * and quit both windows (-cq! -cq!)
> 
> While this works well I'm not quite happy with it. After adding
> "&>/dev/null" (I also tried using @vim [...]) to suppress the output
> the script takes ~3 seconds per file, idling most of the time. I
> think this is because of the ncurses library which isn't satisfied
> with /dev/null not beeing a terminal.
> Is there a way to get around this (e.g. running vim quietly just
> processing through some commands or using some settings to ignore the
> case of /dev/null not beeing a terminal)?

Use the -E and -s options, e.g.,

vim -E -s -n $1 -cTOhtml -c"w! $2" -cq! -cq!

See

:help -E
:help -s

Regards,
Gary

-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php


Re: relativenumber is very very slow.

2012-03-11 Thread Ben Fritz
On Sunday, March 11, 2012 9:07:42 PM UTC-5, Yichao Zhou wrote:
> What I mean is that in help of 'cursorline'
> > Will make screen redrawing slower.
> 
> Since 'relativenumber' will make it slower too(but number does not),
> should the document point out this?
> 
> 

I can't say I've ever noticed a slow-down with relative numbering enabled.

-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php


Re: relativenumber is very very slow.

2012-03-11 Thread Benjamin R. Haskell

On Mon, 12 Mar 2012, Yichao Zhou wrote:


What I mean is that in help of 'cursorline'

Will make screen redrawing slower.


Since 'relativenumber' will make it slower too(but number does not), 
should the document point out this?


'relativenumber' shouldn't make it slower.  I can't reproduce your 
problem in a TeX document (ConTeXt).  Can you provide an example 
document that shows the problem?  Have you installed any plugins that 
might be slower with 'relativenumber' enabled?


Also, please provide `vim --version` (or :version) output.

--
Best,
Ben H

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php


Re: Using vim as a syntax highlighter

2012-03-11 Thread Ben Fritz
On Sunday, March 11, 2012 9:31:29 AM UTC-5, Günther Grantig wrote:
> 
> and for the sake of completenes here is the .vimrc of the user running it:
> 
>  let html_use_css=1
>  let html_number_lines=1
>  let html_no_pre=1
>  syntax on
> 

Depeding on your TOhtml version, you should also let html_no_progress = 1 to 
speed things up a little, but you'll get a much bigger speedup from the options 
Gary suggests.

-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php