Tuesday, January 31, 2012

RE: The Super Search and Vim Scripts for Python

gberar wrote:
> I installed some Python specific Vim scripts and found that,
> when editing python files, the "Super Search" does not behave
> as it does normally.
>
> If I have the cursor over "foo" in the string "foo.bar" and
> type the character *, vim will search for the string "foo" as
> long the file is not a python file type.

As already mentioned, one of the scripts active for files of
type "python" is changing your 'iskeyword' setting to include a
dot.

When editing a Python file, enter the following to determine
which script is responsible:

:verbose set iskeyword?

With the default Python stuff, "." is not part of iskeyword, and
pressing * does not include any dot.

John

--
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: The Super Search and Vim Scripts for Python

On Tue, 31 Jan 2012, gberar wrote:

> I installed some Python specific Vim scripts and found that, when
> editing python files, the "Super Search" does not behave as it does
> normally.
>
> If I have the cursor over "foo" in the string "foo.bar" and type the
> character *, vim will search for the string "foo" as long the file is
> not a python file type.
>
> If I edit a python file and perform the same action, vim will search
> for "foo.bar".
>
> What is causing this behavior? I really want it to perform the normal
> way unless there is a good reason it does this.

What you're calling "Super Search" is actually keyword search. It
searches for the keyword under the cursor¹. One of those files you list
is setting it so that '.' is considered part of a "word".

Seeing as how I'm not seeing this behavior, and I don't have this file:

> ./vim73/plugin/pydoc.vim

You should check to see if it sets the 'isk' (short for 'iskeyword') option.

Also, you shouldn't install plugins in the system directory (if that's
what you're abbreviating to './'). There's a good chance they'll be
overwritten when you update Vim.

--
Best,
Ben

¹: It doesn't always just use the "word" under the cursor, but only when
there's no keyword character underneath the cursor. For full details, see:

:help star

Also see:

:help 'iskeyword'

--
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: Display messed up

Marco wrote:
> On 2012-01-31 Tim Chase<vim@tim.thechases.com> wrote:
>
>
>>> Hmm… good question. My .Xresources file says:
>>>
>>> Rxvt.font: xft:Mono:pixelsize=13
>>>
>> Was that for the good font or the bad font? And is it
>> only dependent on the font-name, or does it behave if
>> you just change the font size?
>>
> I just did some more tests. The result: It occurs with
> different fonts and different font sizes. So, probably no
> font issue.
>
>
>> Just to add to the pool of data, what does the output of
>> :version have to say about "builtin_terms", "terminfo"
>> and "termresponse" (and note there's a difference
>> between "+" and "++" for some of those settings). It
>> might also helpful to know the settings for various
>> term-related settings:
>>
>> :set ttybuiltin? term? tenc?
>>
> ++builtin_terms +terminfo +termresponse
>
> :set ttybuiltin? term? tenc?
> ttybuiltin
> term=rxvt-unicode
> termencoding=
>
> Hopefully this sheds some light on the source of the
> trouble. I have to admit that I'm no expert in those
> things, it had always worked for me.
>

I suspect that your termcap/terminfo database entry may be incorrect.

If your system is using terminfo (as opposed to termcap)...

infocmp ${TERM} -- will display the terminal settings for your current
$TERM . You may wish to save the output (ie. ... > ${TERM}.info)

Then snoop on vim to see what its issuing:

script snoopy
vim somefile
:q
exit

The "snoopy" file (pls be sure that you don't already have such a file
before doing this). Check that the escape sequences work on your
terminal as they're supposed to. I'm afraid you'll probably have to
google the codes (probably looking for ansi escape sequences will help).

Alternatively, see if you can find a terminfo entry for your ${TERM} via
google and use infocmp to compare what you have vs what the internet
version has.

Good luck!
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

The Super Search and Vim Scripts for Python

I installed some Python specific Vim scripts and found that, when
editing python files, the "Super Search" does not behave as it does
normally.

If I have the cursor over "foo" in the string "foo.bar" and type the
character *, vim will search for the string "foo" as long the file is
not a python file type.

If I edit a python file and perform the same action, vim will search
for "foo.bar".

What is causing this behavior? I really want it to perform the normal
way unless there is a good reason it does this.

The scripts that I have are

./vim73/autoload/python3complete.vim
./vim73/autoload/pythoncomplete.vim
./vim73/ftplugin/python.vim
./vim73/plugin/pydoc.vim
./vim73/syntax/python.vim
./vim73/indent/python.vim

--
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 to search a "path" string in a file?

May be :s#/home/user/bin/session.log#& can do this.

On Wed, Feb 1, 2012 at 2:37 AM, Gary Johnson <garyjohn@spocom.com> wrote:
On 2012-01-31, Jerry Dai wrote:
> Hi,
>
> I have a file with a lot of path in it. I want to search "/home/user/bin/
> session.log" without changing  "/" to "\/".
> How should I do it?

The easiest way is probably to begin a reverse search by typing '?'
followed by your path.  If you want to change that to a forward
search, simply type '/' and Enter.

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

--
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: Display messed up

On 2012-01-31 Tim Chase <vim@tim.thechases.com> wrote:

> > Hmm… good question. My .Xresources file says:
> >
> > Rxvt.font: xft:Mono:pixelsize=13
>
> Was that for the good font or the bad font? And is it
> only dependent on the font-name, or does it behave if
> you just change the font size?

I just did some more tests. The result: It occurs with
different fonts and different font sizes. So, probably no
font issue.

> Just to add to the pool of data, what does the output of
> :version have to say about "builtin_terms", "terminfo"
> and "termresponse" (and note there's a difference
> between "+" and "++" for some of those settings). It
> might also helpful to know the settings for various
> term-related settings:
>
> :set ttybuiltin? term? tenc?

++builtin_terms +terminfo +termresponse

:set ttybuiltin? term? tenc?
ttybuiltin
term=rxvt-unicode
termencoding=

Hopefully this sheds some light on the source of the
trouble. I have to admit that I'm no expert in those
things, it had always worked for me.

Marco


--
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: Display messed up

On 01/31/12 16:27, Marco wrote:
> On 2012-01-31 Tim Chase<vim@tim.thechases.com> wrote:
> I can't tell you why, but I have the strong feeling that
> it's not a hardware issue.

With the behavior changing based on $TERM, the possibility of a
hardware issue no longer ranks high on my list of possible issues.

>> does using either ":redraw" or ":redraw!" also refresh
>> dthe isplay correctly?
>
> No, neither of the commands does.

Which backs the idea that something is wrong with the termcap,
that even as it redraws, it's using the improper escape settings.

>> So when you mentioned changing the font manifest the
>> behavior, that was your terminal font, not 'guifont' in
>> gvim, right?
>
> Yes, I'm talking about the terminal font. As I said gvim
> is not affected.

I just wanted to make sure--the resizing-fixes aspect hinted that
it might be (though not absolutely) gvim related. Terminals can
send a WINCH signal which tells the application the window size
changed, so the path Vim takes when processing this signal could
also be at issue.

> Hmm… good question. My .Xresources file says:
>
> Rxvt.font: xft:Mono:pixelsize=13

Was that for the good font or the bad font? And is it only
dependent on the font-name, or does it behave if you just change
the font size?

>> Also, what is $TERM set to...both within Vim and outside
>> Vim? Does the problem persist if you start vim with
>> something like
>
> outside vim: TERM=rxvt-unicode
> inside vim: TERM=xterm-256color
>
> I also changed TERM to xterm-256color, without success.
>
>> bash$ TERM=dummy vim file.txt
>>
>> to force a bogus termcap entry?
>
> Yes, this helps. I did a few tests and it works fine.
>
> I thank you a lot for your creative thoughts. As I
> mentioned, setting the TERM to "dummy" helps. But I have
> no idea why. Is this the solution of just a workaround
> that doesn't trigger the weird behaviour?

Just to add to the pool of data, what does the output of :version
have to say about "builtin_terms", "terminfo" and "termresponse"
(and note there's a difference between "+" and "++" for some of
those settings). It might also helpful to know the settings for
various term-related settings:

:set ttybuiltin? term? tenc?

-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: A Versatile fmt command

Christian made many valid points, some still outstanding.

On Jan 31, 11:06 am, Christian Brabandt <cbli...@256bit.org> wrote:

>There are some issues with this script.

Yes the if statements are not written right.. Probably best to create
3 separate if/endif statement to cover all combinations. The
combinations bear thought since,
substitute commands hand off text that can be processed by later
commands.

> I am not sure, what you need the keepmarks command there.

It seems that an external filter like fmt wipes out marks otherwise -
or completely, since it basically deletes a text block and replaces it
with a new one.

> I think you want rather: :keepmarks 'A,'B!fmt -p '>'

Yes that might work, once A and B are set properly.
>
> The /^[^\.] matches lines, that do not start with either a dot or a
> backspace (so you don't need to escape the . in a collation) and I am
> not sure, if you need the search command in front of the :s command.

Correct on this. I did not think of silent! and did not realize there
was an e flag for
sub.

> Then I think you can do something like /^ *$\|\%$kB

I can mark a line as part of a movement command?

> It is mapped to, v which was simply map v !}fmt before. I learned one must
> unmap v first, before a new map will work.
> I am not sure this is true. It should work without unmapping v first,

Did not seem to. However, I work with a winchester mystery house of
configurations. He insists on setting compatible with all the limits
that imposes, has literally thousands of abbreviations and maps. I
thought a `latter' map of
v would also replace an earlier one too. But it did not seem to.

I did think that a script could read the '< and '> marks afterr <esc>,
but my script seemed unaware of them. Again perhaps the complex .vimrc
file. It may work now, that I have installed a non-crippled version of
vim.

Actually, testing for a current mark set after an initial cursor
position has advantages: I think it would be easier to, for instance
filter the whole file through the script by going to line 1, then to
the end and marking A. But I can not think of
a mark to test for that might only get set for this script.

It would also be very nice to use vim's internal gq command. But that
requires setting paragraphs to any line at all that starts with a dot.
Someone there must be a way to do this. Will paragraphs take only
strings or can one fool it with some kind of eval or expand function?
I guess the script could search the text block, retrieve every line
with an initial dot, temporarily set paragraphs accordingly, and then
use gq?

What do I want my script to do: Format a paragraph, treating all
lines that start with a dot as paragraph boundaries, if a mark is
given format a user defined text block instead of one paragraph, if
the paragraph or block contains comment or quote strings like >,
format those lines while retaining the initial quote string for each
line.

--
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: Display messed up

On 2012-01-31 Tim Chase <vim@tim.thechases.com> wrote:

> On 01/31/12 14:58, Marco wrote:
> > http://i42.tinypic.com/23l84x.png
>
> My first suspicions are: possibly a corrupted font file,
> possibly a corrupted termcap database, or perhaps a bad
> memory chip (or some other hardware in the picture).

I can't tell you why, but I have the strong feeling that
it's not a hardware issue.

> > A workaround is to resize the window. Then immediately
> > the file is displayed correctly.
>
> does using either ":redraw" or ":redraw!" also refresh
> dthe isplay correctly?

No, neither of the commands does.

> So when you mentioned changing the font manifest the
> behavior, that was your terminal font, not 'guifont' in
> gvim, right?

Yes, I'm talking about the terminal font. As I said gvim
is not affected.

> Do you have similar issues in other full-screen console
> applications when using the same "bad" font(s)? (could
> it be a corrupted font file?)

No, only vim makes trouble. All other applications work
fine.

> What are these offending fonts named?

Hmm… good question. My .Xresources file says:

Rxvt.font: xft:Mono:pixelsize=13

I'm not quite sure. fc-list outputs no font names "Mono",
but it could be FreeMono.ttf

> Also, what is $TERM set to...both within Vim and outside
> Vim? Does the problem persist if you start vim with
> something like

outside vim: TERM=rxvt-unicode
inside vim: TERM=xterm-256color

I also changed TERM to xterm-256color, without success.

> bash$ TERM=dummy vim file.txt
>
> to force a bogus termcap entry?

Yes, this helps. I did a few tests and it works fine.

> Does this persist over a reboot? (if the Vim executable
> is getting cached in RAM and it's a bad chip, a reboot
> might allocate it at a different location)

Yes, it's persistent.

> I don't know if the answers to any of my questions will
> lead anywhere, but hopefully they'll shed a little light
> on some of the areas that might be at issue.

I thank you a lot for your creative thoughts. As I
mentioned, setting the TERM to "dummy" helps. But I have
no idea why. Is this the solution of just a workaround
that doesn't trigger the weird behaviour?

Regards

Marco


--
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: Display messed up

On 01/31/12 14:58, Marco wrote:
> http://i42.tinypic.com/23l84x.png

My first suspicions are: possibly a corrupted font file,
possibly a corrupted termcap database, or perhaps a bad memory
chip (or some other hardware in the picture).

> A workaround is to resize the window. Then immediately the
> file is displayed correctly.

does using either ":redraw" or ":redraw!" also refresh the
display correctly?

> Only vim is affected, gvim behaves normal.

So when you mentioned changing the font manifest the behavior,
that was your terminal font, not 'guifont' in gvim, right?

Do you have similar issues in other full-screen console
applications when using the same "bad" font(s)? (could it be a
corrupted font file?)

What are these offending fonts named?

Also, what is $TERM set to...both within Vim and outside Vim?
Does the problem persist if you start vim with something like

bash$ TERM=dummy vim file.txt

to force a bogus termcap entry?

Does this persist over a reboot? (if the Vim executable is
getting cached in RAM and it's a bad chip, a reboot might
allocate it at a different location)

> I tried different terminals (urxvt and xterm). Starting vim
> with -u NONE doesn't help, either. I tried vim version
> 7.3.363 and 7.3.421.
>
> What happens here and how to solve this?

This sounds crazy and is the first I've heard of such behavior.
I don't know if the answers to any of my questions will lead
anywhere, but hopefully they'll shed a little light on some of
the areas that might be at issue.

-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

Display messed up

Dear list,

sometimes when I load vim, the display gets messed up.
Messed up means it displays lines of the file in the wrong
order. The displayed lines change when scrolling through
the file (the actual file content stays the same). It does
not happen with all files, but it is reproducible. It also
depends on the font used. After changing the font size, a
formerly "corrupt" displayed file displays correct and
vice versa. A screenshot can be found here:

http://i42.tinypic.com/23l84x.png

A workaround is to resize the window. Then immediately the
file is displayed correctly.

Only vim is affected, gvim behaves normal. I tried
different terminals (urxvt and xterm). Starting vim with
-u NONE doesn't help, either. I tried vim version 7.3.363
and 7.3.421.

What happens here and how to solve this?

Marco


--
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: A Versatile fmt command

On 2012-01-31, howard Schwartz wrote:
> hi, More adventures with my Blind friend. Sun's version of fmt, let all lines
> starting with a dot (.) alone, in deferrence to he unix markup language,
> Troff. The Redhat version of fmt, does not do that.

Apparently the OpenBSD version of fmt recognizes troff tags while
the GNU version does not. One solution to your friend's problem
would be to obtain the OpenBSD source, e.g., from
http://ftp.usa.openbsd.org/pub/OpenBSD/src/usr.bin/fmt/
and build it yourself. It appears really easy to build.

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: A Versatile fmt command

Hi howard!

On Di, 31 Jan 2012, howard Schwartz wrote:

> hi, More adventures with my Blind friend. Sun's version of fmt, let
> all lines starting with a dot (.) alone, in deferrence to he unix
> markup language, Troff. The Redhat version of fmt, does not do that.
>
> I love Vim's versatile internal fmt command. However, it defines a paragraph
> as a text block bounded either by blank lines, or one of the 2 character
> (troff) dot commands, set with the paragraph variable (e.g., .IP .LP etc.).
> My friend uses tons of dot commands and, so needs a fmt command that treats
> virtually every ``dot'' command as a paragraph boundary. That could approach
> 100 commands or so to set paragraphs to.
>
> So - I wrote a little script that ignore's dot commands (see below), and
> formats a single ``paragraph'' bounded only by blank lines. Here it is:
>
> keepmarks
> kA
> /^ *$\|\%$/
> kB
> 'A,'B/^[^\.]/s/^\([^\.]\)/>\1/
> 'A,'B!fmt -p '>'
> .,/^ *$\|\%$//^>/s/^>//
> 'A

There are some issues with this script. I am not sure, what you need the
keepmarks command there. I think you want rather:
:keepmarks 'A,'B!fmt -p '>'

The /^[^\.] matches lines, that do not start with either a dot or a
backspace (so you don't need to escape the . in a collation) and I am
not sure, if you need the search command in front of the :s command.

Then I think you can do something like /^ *$\|\%$kB

> It is mapped to, v which was simply map v !}fmt before. I learned one must
> unmap v first, before a new map will work.

I am not sure this is true. It should work without unmapping v first,
but it is probably cleaner to unmap v first. See also :h hasmapto(),
:h maparg() and :h mapcheck()

> Im now interested in expanding the script in two ways: Make it format an
> arbitary block of text, and make it format those quotes within emails like
> this:
>
> > Small line
> > a much larger and larger and larger line
>
> In so - a command that treats all dot commands are paragraph boundaries, that
> formats a single paragraph by default, and that formats quoted text (even
> interspersed with dot commands) within emails. Here is a try that does not
> work:
>
> if search("^>", 'cn') > 0
> %!fmt -p '>'
> elseif line("'>") > 0
> '<,'>/^[^\.]/s/^\([^\.]\)/>\1/
> '<,'>'!fmt -p '>'
> '<,'>/^>/s/^>//
> endif
> keepmarks
> kA
> /^ *$\|\%$/
> kB
> 'A,'B/^[^\.]/s/^\([^\.]\)/>\1/
> 'A,'B!fmt -p '>'
> .,/^ *$\|\%$//^>/s/^>//
> 'A
> endif
>
>
> The idea was to use the marks like '> set by visual mode, after hitting <ESC>,
> for arbitrary blocks. These marks to persis, but a script does not seem to
> be aware of them. Also, given both a range and pattern for substitute commands

A script sees the '< and '> marks just fine.

> is to avoid ``pattern not found'' messages when lines do not have what is
> being searched for.

You can use the :sil command for that, or specifically for the :s
command, use the e flag. See :h :sil and :h :s_flags

> Possible solutions: Somehow fool vim's paragraphs variable into accepting
> every line that begins with a dot. Figure a script test for a mark like mA,
> set on an initial line. Then I got to the end of a block and run the script.
> trouble is, A (or whatever) may be already defined in a buffer, so how to test
> that it was just set now? Or someway for a script to recognize the marks set
> by the highlight mode.

I am unsure, what you want to do. So here are only some basic tips.
Check with getpos("'A") the position of mark A see :h getpos() but using
the '< and '> marks is really the correct solution and works from within
scripts (but I think only after visual mode has been exited) as well. I
do this with the NrrwRgn plugin.

regards,
Christian

--
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 to search a "path" string in a file?

On 2012-01-31, Jerry Dai wrote:
> Hi,
>
> I have a file with a lot of path in it. I want to search "/home/user/bin/
> session.log" without changing "/" to "\/".
> How should I do it?

The easiest way is probably to begin a reverse search by typing '?'
followed by your path. If you want to change that to a forward
search, simply type '/' and Enter.

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: How to search a "path" string in a file?

Hi Jerry!

On Di, 31 Jan 2012, Jerry Dai wrote:

> Hi,
>
> I have a file with a lot of path in it. I want to search
> "/home/user/bin/session.log" without changing "/" to "\/".
> How should I do it?

You can at least use ? to search backwards, which does not care about /
delimiting the pattern, or if you have at least a normal built, you can
simply paste the pattern into the search register:
:let @/='/home/user/bin/session.log'
and press n.

I should possibly put this into the faq.

regards,
Christian
--
Ungläubiger:
In New York: Jemand, der nicht an die christliche Religion glaubt.
In Istanbul: Jemand, der an sie glaubt.
-- Ambrose Gwinnet Bierce (Des Teufels Wörterbuch)

--
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

A Versatile fmt command

hi, More adventures with my Blind friend. Sun's version of fmt, let all lines
starting with a dot (.) alone, in deferrence to he unix markup language,
Troff. The Redhat version of fmt, does not do that.

I love Vim's versatile internal fmt command. However, it defines a paragraph
as a text block bounded either by blank lines, or one of the 2 character
(troff) dot commands, set with the paragraph variable (e.g., .IP .LP etc.).
My friend uses tons of dot commands and, so needs a fmt command that treats
virtually every ``dot'' command as a paragraph boundary. That could approach
100 commands or so to set paragraphs to.

So - I wrote a little script that ignore's dot commands (see below), and
formats a single ``paragraph'' bounded only by blank lines. Here it is:

keepmarks
kA
/^ *$\|\%$/
kB
'A,'B/^[^\.]/s/^\([^\.]\)/>\1/
'A,'B!fmt -p '>'
.,/^ *$\|\%$//^>/s/^>//
'A

It is mapped to, v which was simply map v !}fmt before. I learned one must
unmap v first, before a new map will work.

Im now interested in expanding the script in two ways: Make it format an
arbitary block of text, and make it format those quotes within emails like
this:

> Small line
> a much larger and larger and larger line

In so - a command that treats all dot commands are paragraph boundaries, that
formats a single paragraph by default, and that formats quoted text (even
interspersed with dot commands) within emails. Here is a try that does not
work:

if search("^>", 'cn') > 0
%!fmt -p '>'
elseif line("'>") > 0
'<,'>/^[^\.]/s/^\([^\.]\)/>\1/
'<,'>'!fmt -p '>'
'<,'>/^>/s/^>//
endif
keepmarks
kA
/^ *$\|\%$/
kB
'A,'B/^[^\.]/s/^\([^\.]\)/>\1/
'A,'B!fmt -p '>'
.,/^ *$\|\%$//^>/s/^>//
'A
endif


The idea was to use the marks like '> set by visual mode, after hitting <ESC>,
for arbitrary blocks. These marks to persis, but a script does not seem to
be aware of them. Also, given both a range and pattern for substitute commands
is to avoid ``pattern not found'' messages when lines do not have what is
being searched for.


Possible solutions: Somehow fool vim's paragraphs variable into accepting
every line that begins with a dot. Figure a script test for a mark like mA,
set on an initial line. Then I got to the end of a block and run the script.
trouble is, A (or whatever) may be already defined in a buffer, so how to test
that it was just set now? Or someway for a script to recognize the marks set
by the highlight mode.

Any ideas?


--
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: QuickFix and BufEnter autocommand

On 07:46 Tue 31 Jan , Ben Fritz wrote:
>
>
> On Jan 30, 9:06 am, Marcin Szamotulski <msza...@gmail.com> wrote:
> > Hello,
> >
> > I'd like to make an autocommand which executes cgetfile with BufEnter, but not
> > when going from QuickFix (:copen) window. Any ideas how to do that?
> >
>
> You could use a BufLeave/WinLeave autocmd to set some variable if
> &buftype='quickfix' (or perhaps if &filetype='qf', but the former is
> probably better). In your BufEnter autocmd, check to see whether the
> variable is set and if so, don't run cgetfile. Always clear the
> variable on BufEnter after the check.
>
> That's how I'd try it first, anyway. There may be a better way.
>
> --
> 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

Thanks, this is indeed what I was looking for.

Best,
Marcin

--
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 to search a "path" string in a file?

Hi,

I have a file with a lot of path in it. I want to search "/home/user/bin/session.log" without changing  "/" to "\/".
How should I do it?

Thanks.
 
-- --
Best Regards
Jerry Dai

--
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: QuickFix and BufEnter autocommand

On Jan 30, 9:06 am, Marcin Szamotulski <msza...@gmail.com> wrote:
> Hello,
>
> I'd like to make an autocommand which executes cgetfile with BufEnter, but not
> when going from QuickFix (:copen) window. Any ideas how to do that?
>

You could use a BufLeave/WinLeave autocmd to set some variable if
&buftype='quickfix' (or perhaps if &filetype='qf', but the former is
probably better). In your BufEnter autocmd, check to see whether the
variable is set and if so, don't run cgetfile. Always clear the
variable on BufEnter after the check.

That's how I'd try it first, anyway. There may be a better way.

--
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: Syntax matching

On Jan 30, 11:38 am, mfc_alpha <mathieu.ma...@gmail.com> wrote:
> Hello !
>
> I've been looking around and I can't find a solution to my issue.
>
> I have a simple langage having 2 functions.
> BashRule and PythonRule.
>
> They both have similare signature.
>
> BashRule(type, comment, bashCode)
> and
> PythonRule(type, comment, pythonCode)
>
> It looks possible to have the bash coloration used for the 3rd
> argument of BashRule and python coloration for PyhtonRule.
> What I am missing is how to match each arguments to have proper
> coloration for each other.
> e.g.
> type get Statement coloration
> comment set Comment coloration
> and bashCode get bash coloration.
>
> May be I have been looking in the wrong direction or I want to do too
> much at one time ...
>
> Thanks for any information !
>

This looks like a good application for:

http://vim.wikia.com/wiki/Different_syntax_highlighting_within_regions_of_a_file

I see a note in the comments that I meant to go back and look at a bug
in the script...I'm not sure if it's still applicable or not, possibly
the script won't work as-is, but the concept is what you want if I
understand your problem correctly.

--
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: Better vertical align in code

On 01/31/2012 10:36 AM, Ben Fritz wrote:
> I think it's funny that I read AK's "when editing code" as "when
> editing C code", and you seem to have done the same, but apparently
> "editing code" was so self-evidently python for AK that it wasn't even
> mentioned in the post.
>
> Proof that everyone sees according to their own experiences, I guess.
>


I thought of mentioning it at first but decided not to because I
thought it would be the same for all languages where you might want
to align a function call, e.g.

myfunction_name(arg1,
arg2,
arg3,
arg4)


-ak

--
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: Better vertical align in code

On Jan 30, 6:07 pm, Gary Johnson <garyj...@spocom.com> wrote:
> On 2012-01-30, AK wrote:
> > I'm using indent/python.vim and this behaviour is in GetPythonIndent().
> > I'll just have to hack it.. If I set cindent or cinoptions, is there
> > a way to set it up to override indentexpr and work as I described?
>
> No, unless you let 'cindent' handle all your indenting, and while I
> haven't tried using a C indenting algorithm on Python code, I doubt
> that it would go well.
>

I think it's funny that I read AK's "when editing code" as "when
editing C code", and you seem to have done the same, but apparently
"editing code" was so self-evidently python for AK that it wasn't even
mentioned in the post.

Proof that everyone sees according to their own experiences, I guess.

>
> > >By the way, () are parentheses, not braces.  Braces are {} and
> > >brackets are [].
>
> > {} and [] () are also called curly, square, and round brackets, so I
> > thought brackets and braces are interchangeable.. guess not!
>
> I've seen other names for {} and [], but I don't think I've ever
> seen () referred to as round brackets or round braces, only
> parentheses.  Could be a U.S. thing.
>

I've seen "round brackets" a few times, very rarely. Never "round
braces". I've also seen '<' and '>' called "angle brackets". I have no
idea what the region might be.

--
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: Installing colorschemes and snippets with VAM

On 17:18 Mon 30 Jan , Marc Weber wrote:
> Excerpts from Marcin Szamotulski's message of Mon Jan 30 16:50:28 +0100 2012:
> > Can you explain my why I get lots of messages when I try to update plugins:
> The message talks about it: The pool of known plugins does no longer
> contain them. There are multiple reasons:
>
> - a plugin has a git source registered in VAM-known-repositories now
> (however this should cause a different message)
>
> - there was a rewrite of VAM-known-repositories recently. So your VAM
> version may no longer fit VAM-known-repositories.
>
> Thus if you have the recommended SetupVAM function try removing VAM and
> VAM-known-repositories and both should be checked out again.
> Else cd into the directories and do "git pull".
>
> About your long list of plugins: If the step above does not fix it keep
> in mind that you can always rm -fr the plugin and VAM will refetch it
> thereby working around the first issue mentioned above.
>
> I've verified that two of your plugins
> ColorV and GUI_Box should still be known to VAM-known-repositories.
> That's why I'm confident that updating VAM and VAM-kr fixes your
> problems.
>
> Marc Weber
>
> --
> 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

Thanks, Indeed updating vam solved the problem.

Marcin

--
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

Monday, January 30, 2012

Re: Set 'filetype' by filename extensions

On Tue, Jan 31, 2012 at 15:32, Christian Brabandt <cblists@256bit.org> wrote:
On Tue, January 31, 2012 8:16 am, Clark J. Wang wrote:
> On Tue, Jan 31, 2012 at 15:11, Christian Brabandt
> <cblists@256bit.org>wrote:
>
>> On Tue, January 31, 2012 8:05 am, Clark J. Wang wrote:
>> > I have some files named in the *.kshlib format which are ksh scripts
>> but
>> > vim always recongnized them as "ft=conf". So how can I force vim to
>> > consider those files as "ft=sh"?
>> >
>> > I tried following in vimrc but it did not work:
>> >
>> > autocmd BufReadPost *
>> >         \ if bufname('%') =~ '^.*\.kshlib$' |
>> >         \   exe 'normal set ft=sh' |
>> >         \ endif
>> >
>>
>> :h new-filetype
>>
>
> Thanks I see the example "au BufRead,BufNewFile *.mine set filetype=mine"
> and that works for me. But what's wrong with my original post though it's
> a
> bit complicated?
>

It looks weird.

The whole point of the BufReadPost autocommand is to match
against a file name, in your case you use the wildchar * to match against
any file pattern, but within the autocommand, you only want to match
against .kshlib.

Secondly, your exe 'normal set ft=sh' is wrong, you missed the
colon and additionally you don't need neither the 'exe' nor the 'normal
command so this statement can be simplified to :set ft=sh.

Thanks.

After all your whole autocommand can then be simplified to
au BufReadPost *.kshlib :set ft=sh
which is basically the same autocommand, that is given below
:h new-filetype, except that you are still missing the BufNewFile
autocommand.

regards,
Christian

--
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: Set 'filetype' by filename extensions

On Tue, January 31, 2012 8:16 am, Clark J. Wang wrote:
> On Tue, Jan 31, 2012 at 15:11, Christian Brabandt
> <cblists@256bit.org>wrote:
>
>> On Tue, January 31, 2012 8:05 am, Clark J. Wang wrote:
>> > I have some files named in the *.kshlib format which are ksh scripts
>> but
>> > vim always recongnized them as "ft=conf". So how can I force vim to
>> > consider those files as "ft=sh"?
>> >
>> > I tried following in vimrc but it did not work:
>> >
>> > autocmd BufReadPost *
>> > \ if bufname('%') =~ '^.*\.kshlib$' |
>> > \ exe 'normal set ft=sh' |
>> > \ endif
>> >
>>
>> :h new-filetype
>>
>
> Thanks I see the example "au BufRead,BufNewFile *.mine set filetype=mine"
> and that works for me. But what's wrong with my original post though it's
> a
> bit complicated?
>

It looks weird.

The whole point of the BufReadPost autocommand is to match
against a file name, in your case you use the wildchar * to match against
any file pattern, but within the autocommand, you only want to match
against .kshlib.

Secondly, your exe 'normal set ft=sh' is wrong, you missed the
colon and additionally you don't need neither the 'exe' nor the 'normal
command so this statement can be simplified to :set ft=sh.

After all your whole autocommand can then be simplified to
au BufReadPost *.kshlib :set ft=sh
which is basically the same autocommand, that is given below
:h new-filetype, except that you are still missing the BufNewFile
autocommand.

regards,
Christian

--
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: Set 'filetype' by filename extensions

On Tue, Jan 31, 2012 at 15:11, Christian Brabandt <cblists@256bit.org> wrote:
On Tue, January 31, 2012 8:05 am, Clark J. Wang wrote:
> I have some files named in the *.kshlib format which are ksh scripts but
> vim always recongnized them as "ft=conf". So how can I force vim to
> consider those files as "ft=sh"?
>
> I tried following in vimrc but it did not work:
>
> autocmd BufReadPost *
>         \ if bufname('%') =~ '^.*\.kshlib$' |
>         \   exe 'normal set ft=sh' |
>         \ endif
>

:h new-filetype

Thanks I see the example "au BufRead,BufNewFile *.mine set filetype=mine" and that works for me. But what's wrong with my original post though it's a bit complicated?


regards,
Christian

--
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: Set 'filetype' by filename extensions

On Tue, January 31, 2012 8:05 am, Clark J. Wang wrote:
> I have some files named in the *.kshlib format which are ksh scripts but
> vim always recongnized them as "ft=conf". So how can I force vim to
> consider those files as "ft=sh"?
>
> I tried following in vimrc but it did not work:
>
> autocmd BufReadPost *
> \ if bufname('%') =~ '^.*\.kshlib$' |
> \ exe 'normal set ft=sh' |
> \ endif
>

:h new-filetype

regards,
Christian

--
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

Set 'filetype' by filename extensions

I have some files named in the *.kshlib format which are ksh scripts but vim always recongnized them as "ft=conf". So how can I force vim to consider those files as "ft=sh"?

I tried following in vimrc but it did not work:

autocmd BufReadPost *
        \ if bufname('%') =~ '^.*\.kshlib$' |
        \   exe 'normal set ft=sh' |
        \ endif

--
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

Syntax matching

Hello !

I've been looking around and I can't find a solution to my issue.

I have a simple langage having 2 functions.
BashRule and PythonRule.

They both have similare signature.

BashRule(type, comment, bashCode)
and
PythonRule(type, comment, pythonCode)

It looks possible to have the bash coloration used for the 3rd
argument of BashRule and python coloration for PyhtonRule.
What I am missing is how to match each arguments to have proper
coloration for each other.
e.g.
type get Statement coloration
comment set Comment coloration
and bashCode get bash coloration.

May be I have been looking in the wrong direction or I want to do too
much at one time ...

Thanks for any information !

Mathieu

--
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] Problem with `inoremap jj '

>> it's become a habit for me to do :set paste before
>> dumping in really odd pieces of non-language text just in case.
>
> Why only non-language text--and what do you mean by "non-language"?
>

Because unless I am pasting some kind of computer generated jibberish
rather than text made of words (language), the sequence 'jj' doesn't
appear-- in English it exists in only one word (and a couple of its
variations), and those are actually, in my experience, usually
misspelled so as not to contain the 'jj' sequence anyway.

So if, for some reason, I'm copying non-language text, I just
automatically paste/nopaste. But it's so rare that it's hardly a
burden.

c
--
Chris Lott <chris@chrislott.org>

--
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: Installing colorschemes and snippets with VAM

Excerpts from Marcin Szamotulski's message of Mon Jan 30 16:50:28 +0100 2012:
> Can you explain my why I get lots of messages when I try to update plugins:
The message talks about it: The pool of known plugins does no longer
contain them. There are multiple reasons:

- a plugin has a git source registered in VAM-known-repositories now
(however this should cause a different message)

- there was a rewrite of VAM-known-repositories recently. So your VAM
version may no longer fit VAM-known-repositories.

Thus if you have the recommended SetupVAM function try removing VAM and
VAM-known-repositories and both should be checked out again.
Else cd into the directories and do "git pull".

About your long list of plugins: If the step above does not fix it keep
in mind that you can always rm -fr the plugin and VAM will refetch it
thereby working around the first issue mentioned above.

I've verified that two of your plugins
ColorV and GUI_Box should still be known to VAM-known-repositories.
That's why I'm confident that updating VAM and VAM-kr fixes your
problems.

Marc Weber

--
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: Installing colorschemes and snippets with VAM

On 14:26 Mon 30 Jan , Marc Weber wrote:
> Excerpts from Alexandre Provencio's message of Mon Jan 30 14:14:34 +0100 2012:
> > I want to know from who is using VAM (vim-addons-manager) what is the
> > preferable way to install things like Solarized and snipmate-snippets.
> > After a normal install with :ActivateAddons, are symbolic links to colors
> > and snippets directories under ~/.vim the best way to complete the task?
> Why are you asking? Neither is "ActivateAddons" the preferred way of
> installing addons (its for testing addons, but would work as well) nor
> are any manualy steps required to make Solarized work.
>
> - VAM docs section 2 (doc/*.txt)
>
> - snipmate README file line 111
>
> If you think that documentation can be improved tell me.
> Otherwise I think you should have RTFM which VAM even tells you when you
> install it - looks like you missed it. Thus read section 2 even more
> carefully :)
>
> Maybe you should just have tried the most obvious:
> :colorscheme solarized and watch it work?
>
> Marc Weber
>
> --
> 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

Dear Marc,

Can you explain my why I get lots of messages when I try to update plugins:
"Don't know how to update vim-indent-object because it is (no longer?) contained in plugin_sources"

At the end I got this:
Don't know how to update vimtips because it is (no longer?) contained in
plugin_sources Failed updating plugins: ['ColorV', 'Comceal', 'CountJump',
'EasyMotion', 'FindFile', 'GUI_Box', 'HTML_AutoCloseTag',
'LaTeX_error_filter', 'L anguageTool', 'ManPageView', 'PushPop',
'Python_2.x_Standard_Library_Reference',
'Python_3.x_Standard_Library_Reference', 'Python_Documentatio n',
'SpellCheck', 'SudoEdit', 'YankRing', 'ZoomWin', 'calendar52', 'cmdalias',
'ctags610', 'diff_movement', 'emacscommandline', 'fatrat', 'gen utils',
'karma', 'netrw', 'progressbar_widget', 'python30', 'python_match',
'pythonhelper', 'recover', 'sessionman', 'showmarks', 'taglist',
' vam-addons', 'vim-indent-object', 'vimwiki', 'xorium', 'ywtxt',
'vimchat', 'vimtips'].

And how to deal with them.

Best,
Marcin

--
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: set a mark in an arbitrary file

Forgot to mention: bufnr() requires a true second argument for this:
bufnr('filename.c', 1)

Thanks,
Sam

--
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: set a mark in an arbitrary file

Thank you both, guys! Both approaches are very instructive and
helpful, the latter a bit more convenient.

Thanks a lot for the quick reply.

Sam

--
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

QuickFix and BufEnter autocommand

Hello,

I'd like to make an autocommand which executes cgetfile with BufEnter, but not
when going from QuickFix (:copen) window. Any ideas how to do that?

Best,
Marcin

--
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: autoalign and html

On 09:51 Mon 30 Jan , Charles Campbell wrote:
> Marcin Szamotulski wrote:
> > You can check the AutoAlign version (v14i) from:
> > http://drchip.0sites.net/astronaut/vim/#AUTOALIGN
> >
> > Best,
> > Marcin
> >
> > On 18:47 Sat 28 Jan , Cesar Romani wrote:
> >
> >> I'm using wim 7.3.420 on windows 7 with the latest version of AutoAlign.
> >> Whenever I edit a html file and try to close "<table" with ">" I get:
> >>
> >> --------------------
> >> Error detected while processing function AutoAlign:
> >> line 70:
> >> E108: No such variable: "b:autoalign"
> >> --------------------
> >>
> >> That doesn't happen with other tags, only with<table>
> >>
> >> Many thanks in advance,
> >>
> Hello,
>
> Like Marcin S, I don't see an error with <table> in *.html files using v14i.
I didn't say I don't see an error ;) [I did not try] - this is my personal
experience with (Auto)Align plugin to test the most recent version :).

Cheers,
Marcin
>
> If you try v14i and still have difficulties, then it would be helpful:
> * to have an example
> * to try it with just AutoAlign and Align/AlignMaps.
>
> Regards,
> 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: autoalign and html

Marcin Szamotulski wrote:
> You can check the AutoAlign version (v14i) from:
> http://drchip.0sites.net/astronaut/vim/#AUTOALIGN
>
> Best,
> Marcin
>
> On 18:47 Sat 28 Jan , Cesar Romani wrote:
>
>> I'm using wim 7.3.420 on windows 7 with the latest version of AutoAlign.
>> Whenever I edit a html file and try to close "<table" with ">" I get:
>>
>> --------------------
>> Error detected while processing function AutoAlign:
>> line 70:
>> E108: No such variable: "b:autoalign"
>> --------------------
>>
>> That doesn't happen with other tags, only with<table>
>>
>> Many thanks in advance,
>>
Hello,

Like Marcin S, I don't see an error with <table> in *.html files using v14i.

If you try v14i and still have difficulties, then it would be helpful:
* to have an example
* to try it with just AutoAlign and Align/AlignMaps.

Regards,
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: Update on my search for a radhat VIM

On Mon, 2012-01-30 at 08:45 -0500, Steve Hall wrote:
> On Mon, Jan 30, 2012 at 8:15 AM, Reid Thompson <Reid.Thompson@ateb.com> wrote:

> These are ancient. Is there any reason the standard current Fedora
> releases wouldn't work?
>
> http://mirrors.servercentral.net/fedora/releases/16/Everything/i386/os/Packages/
>
> Packages:
>
> vim-X11-7.3.315-1.fc16.i686.rpm
> vim-clustershell-1.5.1-1.fc16.noarch.rpm
> vim-common-7.3.315-1.fc16.i686.rpm
> vim-enhanced-7.3.315-1.fc16.i686.rpm
> vim-filesystem-7.3.315-1.fc16.i686.rpm
> vim-latex-1.8.23-2.20101027.r1112.fc15.noarch.rpm
> vim-latex-doc-1.8.23-2.20101027.r1112.fc15.noarch.rpm
> vim-minimal-7.3.315-1.fc16.i686.rpm
> vim-perl-support-4.13-2.fc16.noarch.rpm
> vim-perl-tt2-0.1.3-3.fc15.noarch.rpm
> vim-vimoutliner-0.3.4-14.fc15.noarch.rpm
>
> Still not the most current, but 7.3.315 is years newer than 7.0.109.
>
> --
> Steve Hall [ digitect dancingpaper com ]
>

potentially it could not work due to missing newer dependencies.
Has current fedora switched to gtk3 yet?
Are they using the same version of libc?
etc

--
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: set a mark in an arbitrary file

Am Montag, 30. Januar 2012 10:39:06 UTC+1 schrieb Samuel Ferencik:
I keep losing my (uppercase) marks, and would like to set them up in
my .vimrc. I'd do this using setpos(), but that requires a buffer
number. I want to call something like setpos("'A", ['filename.c', 1,
1, 0]).

I guess you could add the buffer to the arguments list. A buffer will then be created but not loaded.

argadd filename.c
call setpos("'A", [bufnr('filename.c'), 1, 1, 0])

HTH
Tom

--
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: Update on my search for a radhat VIM

On Mon, Jan 30, 2012 at 8:15 AM, Reid Thompson <Reid.Thompson@ateb.com> wrote:
> On Sun, 2012-01-29 at 22:24 -0800, howard Schwartz wrote:
> > On Sun, 29 Jan 2012, Reid Thompson wrote:
> >
> > > What version does this show?
> > > $ cat /etc/redhat-release
> >
> > Red Hat Enterprise Linux Server release 5.7 (Tikanga)
>
> http://rpm.pbone.net/index.php3
>
> CentOS 5
> ftp.centos.org/5.7/os/x86_64/CentOS/vim-X11-7.0.109-7.el5.x86_64.rpm
> CentOS 5
> ftp.centos.org/5.7/os/i386/CentOS/vim-X11-7.0.109-7.el5.i386.rpm

These are ancient. Is there any reason the standard current Fedora
releases wouldn't work?

http://mirrors.servercentral.net/fedora/releases/16/Everything/i386/os/Packages/

Packages:

vim-X11-7.3.315-1.fc16.i686.rpm
vim-clustershell-1.5.1-1.fc16.noarch.rpm
vim-common-7.3.315-1.fc16.i686.rpm
vim-enhanced-7.3.315-1.fc16.i686.rpm
vim-filesystem-7.3.315-1.fc16.i686.rpm
vim-latex-1.8.23-2.20101027.r1112.fc15.noarch.rpm
vim-latex-doc-1.8.23-2.20101027.r1112.fc15.noarch.rpm
vim-minimal-7.3.315-1.fc16.i686.rpm
vim-perl-support-4.13-2.fc16.noarch.rpm
vim-perl-tt2-0.1.3-3.fc15.noarch.rpm
vim-vimoutliner-0.3.4-14.fc15.noarch.rpm

Still not the most current, but 7.3.315 is years newer than 7.0.109.

--
Steve Hall [ digitect dancingpaper com ]

--
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: digraphs and subscripting - ok

Thanks Christian

> It should work, but most probably you only see empty rectangles or
> question marks. This usually means, your font/terminal cannot display
> that glyph and replaces it by a default glyph. The actual codepoints

Correct, before posting I checked the rendering but in MS notepad
and that did not display it either, MS word does though, so I
assume my emails with the digraph will be appropriately rendered
by the recipients' clients.

> For the terminal vim, you need to configure your terminal vim to use a
> different font, that displays those characters.

Alas, I use work from an X-Win32 X-Windows emulator and I have no
access to other that give better support but now at least I have
faith that vim will DWIM even though I cannot see it directly.

Thanks again

Eric

--
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: Installing colorschemes and snippets with VAM

Excerpts from Alexandre Provencio's message of Mon Jan 30 14:14:34 +0100 2012:
> I want to know from who is using VAM (vim-addons-manager) what is the
> preferable way to install things like Solarized and snipmate-snippets.
> After a normal install with :ActivateAddons, are symbolic links to colors
> and snippets directories under ~/.vim the best way to complete the task?
Why are you asking? Neither is "ActivateAddons" the preferred way of
installing addons (its for testing addons, but would work as well) nor
are any manualy steps required to make Solarized work.

- VAM docs section 2 (doc/*.txt)

- snipmate README file line 111

If you think that documentation can be improved tell me.
Otherwise I think you should have RTFM which VAM even tells you when you
install it - looks like you missed it. Thus read section 2 even more
carefully :)

Maybe you should just have tried the most obvious:
:colorscheme solarized and watch it work?

Marc Weber

--
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: set a mark in an arbitrary file

On 01/30/12 03:39, Samuel Ferencik wrote:
> Is there a way to set a mark to a file not loaded in a buffer, just
> specified by the filename?
>
> I keep losing my (uppercase) marks, and would like to set them up in
> my .vimrc. I'd do this using setpos(), but that requires a buffer
> number. I want to call something like setpos("'A", ['filename.c', 1,
> 1, 0]).

Not directly, but in your particular use-case you could create a
file named ~/.my_viminfo

that contains:
""""""""""""""""""""""""""""""""""""""""""""""""
# Value of 'encoding' when this file was written
*encoding=latin1

# File marks:
'P 1 0 ~/somefile.txt
'Q 21 10 ~/otherfile.txt
""""""""""""""""""""""""""""""""""""""""""""""""

adjusting/adding additional lines to specify where your
file-marks should be dropped. The encoding line is optional, but
helpful to have. If you have an existing .viminfo with the
file-marks you want (or have a session in which you've set the
marks you want, you can write one with ":wv"), you can just open
it and issue the following:

:v/^'/d
:saveas ~/.my_viminfo

Once you've saved those, you can then add the following line to
your vimrc:

rv ~/.my_viminfo

You can read the basics at

:help :rv

and far more than you probably want to know at

:help viminfo

-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: Update on my search for a radhat VIM

On Sun, 2012-01-29 at 22:24 -0800, howard Schwartz wrote:
>
>
> On Sun, 29 Jan 2012, Reid Thompson wrote:
>
> > What version does this show?
> > $ cat /etc/redhat-release
>
>
> Red Hat Enterprise Linux Server release 5.7 (Tikanga)
>
>

http://rpm.pbone.net/index.php3

CentOS 5
ftp.centos.org/5.7/os/x86_64/CentOS/vim-X11-7.0.109-7.el5.x86_64.rpm
CentOS 5
ftp.centos.org/5.7/os/i386/CentOS/vim-X11-7.0.109-7.el5.i386.rpm

--
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

Installing colorschemes and snippets with VAM

Hello guys,
I want to know from who is using VAM (vim-addons-manager) what is the preferable way to install things like Solarized and snipmate-snippets. After a normal install with :ActivateAddons, are symbolic links to colors and snippets directories under ~/.vim the best way to complete the task?

Thanks

-alexandre

--
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] Problem with `inoremap jj '

On Jan 30, 2012 at 07:17 AM -0500, Eric Weir wrote:
>Why only non-language text--and what do you mean by "non-language"?
>
>If I use vim primarily, almost exclusively, to compose and edit prose,
>do I need to be concerned? Haven't done any copying and pasting in vim,
>but do a fair bit of pasting from vim to other apps.

I think you'll be fine. Can you think of any words that have 'jj' in
it? That's why we pick that mapping. If you picked, say, 'oo', then
every time you typed the word 'book' or 'school', you would exit insert
mode, which is clearly not the desired behavior. 'jj' is picked because
it should rarely, if ever, come up in normal typing.

--
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] Problem with `inoremap jj '

On Jan 30, 2012, at 1:49 AM, Chris Lott wrote:

> it's become a habit for me to do :set paste before
> dumping in really odd pieces of non-language text just in case.

Why only non-language text--and what do you mean by "non-language"?

If I use vim primarily, almost exclusively, to compose and edit prose, do I need to be concerned? Haven't done any copying and pasting in vim, but do a fair bit of pasting from vim to other apps.

Thanks,
------------------------------------------------------------------------------------------
Eric Weir
Decatur, GA
eeweir@bellsouth.net

"A man should be in the world as though he were not in it
so that it will be no worse because of his life."

- Wendell Berry

--
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: diagraphs and subscripting

Eric Smith <es@fruitcom.com> a écrit:
>
> Following these commands;
> Superscripts: <cntrl-K> + [number key] + S
> Subscripts: <cntril-K> + [number key] + s
>
> Superscripting woks for me only with the numbers 2 and 3.
> And I cannot achieve any subscripting of numbers.
>
> On first line is 2 and 3 with an upper case S and on second line
> with a lower case s.
>
> ² ³
> ₂ ₃
>
> (file)encoding=utf-8

What does :digraphs says, particularly for digraphs in the Unicode range
8304-8351? There should be there by default, I think, so something
somewhere has removed them. At least if you can't find the cause you can
redefine them in your .vimrc:

digraphs 0S 8304
digraphs 1S 8305
etc.

Best,
Paul

--
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: diagraphs and subscripting

On Mon, January 30, 2012 12:15 pm, Eric Smith wrote:
>
> Following these commands;
> Superscripts: <cntrl-K> + [number key] + S
> Subscripts: <cntril-K> + [number key] + s
>
> Superscripting woks for me only with the numbers 2 and 3.
> And I cannot achieve any subscripting of numbers.
>
> On first line is 2 and 3 with an upper case S and on second line
> with a lower case s.
>
> ² ³
> ₂ ₃
>
> (file)encoding=utf-8

It should work, but most probably you only see empty rectangles or
question marks. This usually means, your font/terminal cannot display
that glyph and replaces it by a default glyph. The actual codepoints
are correct, though. I checked using the unicode.vim plugin and the
:UnicodeName command.

That basically means, you need to configure your gvim to use an apropriate
monospaced font. See :h 'guifont' and use e.g. :set guifont=* to select
a nice font from the dialogbox on GTK2 built or Windows.

For the terminal vim, you need to configure your terminal vim to use a
different font, that displays those characters.

regards,
Christian


--
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

SV: Completing a column name with sqlcomplete and dbext

> Yes, it is possible.
>
> Can you provide a few items:
>
> 1. Version 11.0 is the most recent version of
autoload\sqlcomplete.vim I
> have uploaded that version here:
> http://www.vim.org/scripts/script.php?script_id=1572
>
> 2. dbext is correct, 13.0 being the most recent.
>
> Try it with 11.0 sqlcomplete and see what you get.
>
> Dave

Thanks but v. 11 yields the same results. It's odd because pressing
<C-C>c directly after inputting the table name will bring up a list of
all columns and insert the first column of that list. If you delete this
column name and start typing, the list shows available columns as you
type. Typing part of a column name and pressing <C-C>c to bring up the
list doesn't work however.

Jonas Enberg

--
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

diagraphs and subscripting

Following these commands;
Superscripts: <cntrl-K> + [number key] + S
Subscripts: <cntril-K> + [number key] + s

Superscripting woks for me only with the numbers 2 and 3.
And I cannot achieve any subscripting of numbers.

On first line is 2 and 3 with an upper case S and on second line
with a lower case s.

² ³
₂ ₃

(file)encoding=utf-8

--
- Eric Smith

--
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

set a mark in an arbitrary file

Is there a way to set a mark to a file not loaded in a buffer, just
specified by the filename?

I keep losing my (uppercase) marks, and would like to set them up in
my .vimrc. I'd do this using setpos(), but that requires a buffer
number. I want to call something like setpos("'A", ['filename.c', 1,
1, 0]).

Thanks,
Sam

--
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] Problem with `inoremap jj '

On 2012-01-30, Clark J. Wang wrote:
> On Mon, Jan 30, 2012 at 15:38, Gary Johnson wrote:
>
> On 2012-01-29, Clark J. Wang wrote:
> > On Monday, January 30, 2012 2:56:37 PM UTC+8, Gary Johnson wrote:
> >
> > On 2012-01-29, Clark J. Wang wrote:
> > > As recommended by other people I have 'inoremap jj <ESC>' defined
> in my
> > vimrc
> > > and it works well for most of the time.
> > >
> > > A few days ago when I copy-n-paste a lot of text into vim, the
> result was
> > > always wrong. It took me quite a while before I figured out that
> there
> > was a
> > > substring "jj" included in the text to be pasted. For now I often
> :set
> > paste
> > > before copying large text to avoid unexpected behavior.
> >
> > How are you copy-n-pasting? If you are using a vim with the X11 and
> > xterm-clipboard features enabled, have mouse=a, and are pasting with
> > a mouse in a suitable terminal such as GNOME Terminal or xterm, Vim
> > will detect that you are pasting and disable mappings.
> >
> >
> > I usually use vim without X11 from a terminal and the TERM var may be set
> to
> > linux (for Linux), dtterm (for Solaris), xterm-color (for OS X) or screen
> > (within GNU screen).
>
> What do you mean by "a terminal"? Are you not in an X11
> environment, or are you just using a vim without X11?
>
>
> By "terminal" I mean a "pseudo terminal" opened by PuTTY when I ssh to a
> server. I seldom use X11 enviroment for work and I use gvim only on Windows. :)

Oh, PuTTY. Now I understand. I've never been able to configure
PuTTY to behave like a real xterm--I'm not sure it's even possible--
but I seldom use it in a situation where I need to copy and paste so
I'm not very motivated. When I have to paste, I do what you've
done: :set paste; paste; :set nopaste.

> I've never used dtterm--I just built
> xterm for Solaris.
>
>
> Could you tell me how to build xterm for Solaris? I find TERM=xterm does not
> work well by default on Solaris 11 and TERM=dtterm works fine.

From my notes (from 2005), it was pretty simple:

cd /home/garyjohn/src/SunOS/xterm-165
tar zxf xterm.tar.gz
cd xterm-165/
./configure --prefix=/home/garyjohn/src/SunOS/xterm-165
make
ln -s /home/garyjohn/src/SunOS/xterm-165/xterm-165/xterm ~/bin

I wasn't allowed to install anything in the official places on that
system.

The Solaris system I used also did not support color xterms, so
there were no color xterm terminfo entries. I installed xterm's
terminfo entries under TERMINFO=$HOME/terminfo. An easier solution
may be to put the proper terminfo/termcap definitions in your
~/.vimrc.

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

Sunday, January 29, 2012

Re: [vim] Problem with `inoremap jj '

On 2012-01-30, Clark J. Wang wrote:
> On Mon, Jan 30, 2012 at 15:28, Jane Smith wrote:
>
> On 30 Jan 2012, at 07:18, Benjamin R. Haskell wrote:
>
> > On Sun, 29 Jan 2012, Clark J. Wang wrote:
> >
> >> On Monday, January 30, 2012 2:24:55 PM UTC+8, Markus Osterhoff wrote:
> >>>
> >>> * Clark J. Wang [120130 07:01]:
> >>>> So I wonder if the `jj' mapping can be ignored when doing copy-n-paste
> and only work when I'm typing from a keyboard.
> >>> :set paste
> >>> do your paste
> >>> :set nopaste
>
> I am not sure if this is possible or the syntax you would use but could you
> use a mapping to the effect of:
>
> map <c-v> set paste<c-v>set nopaste
>
> You need something to stop the infinite loop and you may want to restrict
> it to insert mode. I think this makes the above mapping into something
> like:
>
> inoremap <c-v> set paste<c-v>set nopaste
>
>
> This should not work I think since vim's <c-v> is not the same as the OS (e.g.
> Windows)'s <c-v>.

That depends on how you have Vim configured. See

:help CTRL-V
:help mswin.vim

That particular mapping does have syntax issues, though. For normal
mode I think it would have to be

:nnoremap <C-V> :set paste<CR>"+gP:set nopaste<CR>

but that's off the top of my head and I haven't tested it. Insert
mode is a little trickier. See the help references for more.

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: [vim] Problem with `inoremap jj '

On Mon, Jan 30, 2012 at 15:38, Gary Johnson <garyjohn@spocom.com> wrote:
On 2012-01-29, Clark J. Wang wrote:
> On Monday, January 30, 2012 2:56:37 PM UTC+8, Gary Johnson wrote:
>
>     On 2012-01-29, Clark J. Wang wrote:
>     > As recommended by other people I have 'inoremap jj <ESC>' defined in my
>     vimrc
>     > and it works well for most of the time.
>     >
>     > A few days ago when I copy-n-paste a lot of text into vim, the result was
>     > always wrong. It took me quite a while before I figured out that there
>     was a
>     > substring "jj" included in the text to be pasted. For now I often :set
>     paste
>     > before copying large text to avoid unexpected behavior.
>
>     How are you copy-n-pasting?  If you are using a vim with the X11 and
>     xterm-clipboard features enabled, have mouse=a, and are pasting with
>     a mouse in a suitable terminal such as GNOME Terminal or xterm, Vim
>     will detect that you are pasting and disable mappings.
>
>
> I usually use vim without X11 from a terminal and the TERM var may be set to
> linux (for Linux), dtterm (for Solaris), xterm-color (for OS X) or screen
> (within GNU screen).

What do you mean by "a terminal"?  Are you not in an X11
environment, or are you just using a vim without X11?

By "terminal" I mean a "pseudo terminal" opened by PuTTY when I ssh to a server. I seldom use X11 enviroment for work and I use gvim only on Windows. :)
 
If the
latter, that's your problem.  Vim doesn't have to run as gvim to
take advantage of X11 features.  Try using "gvim -v" instead of
"vim", with mouse=a, and see if that helps.  That will give you a
terminal-mode vim with X11 features enabled.

Copying and pasting works fine for me using either xterm or GNOME
Terminal, whether using screen or not, and whether TERM is set to
xterm, xterm-color or screen.

Will try that when I use X11. Thanks for the tip anyway.
 
I've never used dtterm--I just built
xterm for Solaris.

Could you tell me how to build xterm for Solaris? I find TERM=xterm does not work well by default on Solaris 11 and TERM=dtterm works fine.

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: [vim] Problem with `inoremap jj '

On 2012-01-29, Clark J. Wang wrote:
> On Monday, January 30, 2012 2:56:37 PM UTC+8, Gary Johnson wrote:
>
> On 2012-01-29, Clark J. Wang wrote:
> > As recommended by other people I have 'inoremap jj <ESC>' defined in my
> vimrc
> > and it works well for most of the time.
> >
> > A few days ago when I copy-n-paste a lot of text into vim, the result was
> > always wrong. It took me quite a while before I figured out that there
> was a
> > substring "jj" included in the text to be pasted. For now I often :set
> paste
> > before copying large text to avoid unexpected behavior.
>
> How are you copy-n-pasting? If you are using a vim with the X11 and
> xterm-clipboard features enabled, have mouse=a, and are pasting with
> a mouse in a suitable terminal such as GNOME Terminal or xterm, Vim
> will detect that you are pasting and disable mappings.
>
>
> I usually use vim without X11 from a terminal and the TERM var may be set to
> linux (for Linux), dtterm (for Solaris), xterm-color (for OS X) or screen
> (within GNU screen).

What do you mean by "a terminal"? Are you not in an X11
environment, or are you just using a vim without X11? If the
latter, that's your problem. Vim doesn't have to run as gvim to
take advantage of X11 features. Try using "gvim -v" instead of
"vim", with mouse=a, and see if that helps. That will give you a
terminal-mode vim with X11 features enabled.

Copying and pasting works fine for me using either xterm or GNOME
Terminal, whether using screen or not, and whether TERM is set to
xterm, xterm-color or screen. I've never used dtterm--I just built
xterm for Solaris.

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: [vim] Problem with `inoremap jj '

On Mon, Jan 30, 2012 at 15:28, Jane Smith <phunky83@gmail.com> wrote:
On 30 Jan 2012, at 07:18, Benjamin R. Haskell wrote:

> On Sun, 29 Jan 2012, Clark J. Wang wrote:
>
>> On Monday, January 30, 2012 2:24:55 PM UTC+8, Markus Osterhoff wrote:
>>>
>>> * Clark J. Wang <dear...@gmail.com> [120130 07:01]:
>>>> So I wonder if the `jj' mapping can be ignored when doing copy-n-paste and only work when I'm typing from a keyboard.
>>> :set paste
>>> do your paste
>>> :set nopaste

I am not sure if this is possible or the syntax you would use but could you use a mapping to the effect of:

map <c-v>  set paste<c-v>set nopaste

You need something to stop the infinite loop and you may want to restrict it to insert mode. I think this makes the above mapping into something like:

inoremap <c-v>  set paste<c-v>set nopaste

This should not work I think since vim's <c-v> is not the same as the OS (e.g. Windows)'s <c-v>.

But I am not sure so please check before you use. You also need to be in command mode for the 'set' 's. This might be possible using something like 'normal:' so again if someone better at these things than me could refine or reject this then that would be great.

Good Luck

--
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] Problem with `inoremap jj '

On 30 Jan 2012, at 07:18, Benjamin R. Haskell wrote:

> On Sun, 29 Jan 2012, Clark J. Wang wrote:
>
>> On Monday, January 30, 2012 2:24:55 PM UTC+8, Markus Osterhoff wrote:
>>>
>>> * Clark J. Wang <dear...@gmail.com> [120130 07:01]:
>>>> So I wonder if the `jj' mapping can be ignored when doing copy-n-paste and only work when I'm typing from a keyboard.
>>> :set paste
>>> do your paste
>>> :set nopaste

I am not sure if this is possible or the syntax you would use but could you use a mapping to the effect of:

map <c-v> set paste<c-v>set nopaste

You need something to stop the infinite loop and you may want to restrict it to insert mode. I think this makes the above mapping into something like:

inoremap <c-v> set paste<c-v>set nopaste

But I am not sure so please check before you use. You also need to be in command mode for the 'set' 's. This might be possible using something like 'normal:' so again if someone better at these things than me could refine or reject this then that would be great.

Good Luck

--
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] Problem with `inoremap jj '

On Sun, 29 Jan 2012, Clark J. Wang wrote:

> On Monday, January 30, 2012 2:24:55 PM UTC+8, Markus Osterhoff wrote:
>>
>> * Clark J. Wang <dear...@gmail.com> [120130 07:01]:
>>> So I wonder if the `jj' mapping can be ignored when doing
>>> copy-n-paste and only work when I'm typing from a keyboard.
>> :set paste
>> do your paste
>> :set nopaste
>>
>
> I knew 'paste' can work that around.
>
> My idea is to introduce a new option, say 'mapwait' which is a number
> in milliseconds. For example, if 'mapwait' is set to 100 then two 'j'
> chars entered in less than 100ms will not be considered as the `jj'
> mapping.

Interesting. I was about to suggest setting 'timeoutlen' to 100. But,
that's the opposite of what you're looking for. (It will wait up to 100
milliseconds for the next keystroke.)

I like the idea of 'mapwait', because it seems like the false-positive
rate could be very low (problems w/ spotty internet?), but the
true-positives that it would catch would be pretty numerous. Maybe set
it much lower, though, around 10ms. I'm an okay typist (60 WPM
according to an online test¹), but testing it via some Perl², my minimum
time between keystrokes was around the 50ms mark.

On the other hand, probably a less error-prone approach would be to
provide (or fix?) support for bracketed paste mode³. It's been
available in XTerm for a long time, and it's also supported by
rxvt-unicode. Unsure of its support in derivatives of either. And it
was disabled by default for a long time (might still be?).

--
Best,
Ben

¹: http://patorjk.com/typing-speed-test/
²: perl -MTerm::ReadKey -MTime::HiRes=time -lwe 'my $stop = "="; print "Type $stop to exit"; ReadMode 4; END { ReadMode 0 } my @times; while (1) { next unless defined($k = ReadKey -1); push @times, time; last if $k eq $stop; } print for map { int(1000 * ($times[$_]-$times[$_-1])) } 1..$#times'
³: http://www.xfree86.org/current/ctlseqs.html#Bracketed%20Paste%20Mode

--
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] Problem with `inoremap jj '

On Monday, January 30, 2012 2:56:37 PM UTC+8, Gary Johnson wrote:
On 2012-01-29, Clark J. Wang wrote:
> As recommended by other people I have 'inoremap jj <ESC>' defined in my vimrc
> and it works well for most of the time.
>
> A few days ago when I copy-n-paste a lot of text into vim, the result was
> always wrong. It took me quite a while before I figured out that there was a
> substring "jj" included in the text to be pasted. For now I often :set paste
> before copying large text to avoid unexpected behavior.

How are you copy-n-pasting?  If you are using a vim with the X11 and
xterm-clipboard features enabled, have mouse=a, and are pasting with
a mouse in a suitable terminal such as GNOME Terminal or xterm, Vim
will detect that you are pasting and disable mappings.


I usually use vim without X11 from a terminal and the TERM var may be set to linux (for Linux), dtterm (for Solaris), xterm-color (for OS X) or screen (within GNU screen).
 

> So I wonder if the `jj' mapping can be ignored when doing copy-n-paste and only
> work when I'm typing from a keyboard.

This is automatic if Vim is properly configured and used with a
proper terminal.

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