Edward J. Krall | 1 Jan 01:08 2003

Re[2]: Visual Marks - Please Repost

Dear Steve
On Tuesday, December 31, 2002, 2:46:34 PM, history will record that you wrote:

d> On Tue, 31 Dec 2002 14:06:40 -0700 "Edward J. Krall"
d> <ed.krall <at> gd-decisionsystems.com> wrote:
>> 
>> A couple of months ago, someone (Benji Fisher?) posted a small
>> script/plugin which made marks visible by shifting the window and
>> prepending "x>" to the marked line.
>> 
>> I could not find the script on the Vim web page. I tried the
>> archives on Yahoo, but was overwhelmed by the volume of material.
>> 
>> So.... would whoever posted the script please repost?

d> Are you looking for ShowMarks.vim?
d>   http://www.vim.org/script.php?script_id=152

Yes!  Thanks for the response.
I had to make one small change: guibg=white      since my video driver
is somewhat deficient.

Ed

 _________________________________________________________ 
| Edward J. Krall       | ed.krall <at> gd-decisionsystems.com | 
| 10838 North 110 Place | (480) 614-0423                  | 
| Scottsdale, AZ 85259  |                                 | 
|_______________________|_________________________________| 

(Continue reading)

Sandip P Deshmukh | 1 Jan 06:28 2003

Re: any way to integrate dict with vim?

On Tue, Dec 31, 2002 at 09:40:46AM -0500, Benji Fisher wrote:
> Sandip P Deshmukh wrote:
> >On Tue, Dec 31, 2002 at 07:57:29AM +0000, Colin Keith wrote:
> >
> >>On Tue, Dec 31, 2002 at 12:22:04PM +0530, Sandip P Deshmukh wrote:
> >>
> >map T :!dict <cword> | less <CR> gives an error!
> 
>      Maybe the error message gives a clue to the problem.  Try
> 
> :map T :!dict <cword> <Bar> less <CR>
> :help :map		" in general
> :help map_bar		" in particular

thanx a lot. i am yet to get used to the help system in vim. but i am
getting there slowly. i will try and see if i can send a word to a
dictionary site - like say oxford or dictionary.com in lynx and search
for it

--

-- 
regards,

sandip p deshmukh
------***--------

Who's scruffy-looking?
		-- Han Solo

Sandip P Deshmukh | 1 Jan 06:31 2003

Re: any way to integrate dict with vim?

On Tue, Dec 31, 2002 at 08:00:46AM -0500, Alan Schmitt wrote:
> * Sandip P Deshmukh (deshmukh <at> escortsmumbai.com) wrote:
> > hello all
> > 
> > i recently added dict package to my debian system. now i can type dict
> > someword at bash prompt and it returns the meaning of the word.
> > 
> > is there a way by which i can integrate vim and dict? so i am positioned
> > at a word and i pass it to dict command?
> > 
> This is interesting, I wondered the same thing yesterday, and here is
> what I found on the script page:
> http://vim.sourceforge.net/script.php?script_id=280
> I played a little with it, and it looks nice.

oh sure. this is more elaborate. however, a map command like:

map T :!dict <cword><BAR>less<CR>

works as well.

thanks for your help.

--

-- 
regards,

sandip p deshmukh
------***--------

To the systems programmer, users and applications serve only to provide a
(Continue reading)

Klaus Bosau | 1 Jan 09:55 2003
Picon

Re: Toggle 'modified' flag

On Mon, 30 Dec 2002, Antoine J. Mechelynck wrote:

> If you want to have buffer 3 become buffer 1, a recent discussion in
> this ML told us, from highest authority :-), that it wasn't possible.
> Note that :ls doesn't show 'unlisted' buffers, but :ls! does. What you
> show means that initialization has opened three buffers and delisted
> or wiped the first two (or maybe opened more than three and delisted
> or wiped all of them except number 3).

Hi Antoine,

sorry for the delay! The buffers in question are wiped out afterwards,
thus they didn't show up in the buffer listing. (To create the buffer
listing I used ":ls!".)

> I wonder wat caused buffer 3 (the current [NoFile] buffer) to be
> marked as modified. To see where it comes from, it might be
> instructive to do
>
>         :verbose setlocal modified?
>
> in the buffer in question, with the question mark

I entered

          set nomodified
          verbose setlocal modified? (resp. set verbose=20)
          redir! > c:\vim\log

at the very bottom of the script, but 'log' didn't show any buffer
(Continue reading)

Klaus Bosau | 1 Jan 09:56 2003
Picon

Count character in line

Hi,

I'd like to find out how often a certain character shows up in a line.
To achieve this I tried

   fun! s:N()
     .s/x/&/ge
     return substitute(v:statusmsg, '^\(.\).*', '\1', '')
   endfun

but this didn't work. Obviously v:statusmsg sometimes isn't set. How can
I ensure v:statusmsg is set? Or maybe there's another solution too...

Thanks in advance!

Klaus

Klaus Bosau | 1 Jan 09:56 2003
Picon

Re: Problem with menu items

On Tue, 31 Dec 2002, Antoine J. Mechelynck wrote:

> Oops! 2nd byte is FA, not F0.

Hi Antoine,

the sequence in question showed up where (normal mode) keystrokes
normally are shown. Are there any commands which could have caused this?
"128" for instance... It denotes the symbol for the european monetary
unit. Isn't it unlikely that a normal mode command contains this
character?

Thanks,

Klaus

Klaus Bosau | 1 Jan 09:56 2003
Picon

Re: Problem with menu item

On Tue, 31 Dec 2002, Benji Fisher wrote:

> Klaus Bosau wrote:
>
> > [source'ing experiment]
> >
> > Now I'm wondering a bit if there might be something like an upper
> > limit on the amount of source'd material. What do you think?
>
> I suppose that is possible, but I still suspect some sort of conflict
> between the scripts. I would look closely at the parts of the two
> scripts that, when deleted, lead to a working system. Do things start
> working as soon as you delete ANY plugin (such as the standard ones,
> in $VIMRUNTIME/plugin/ )?

Yes. I have to ensure however that the size of the moved material is
about equal to the size of the initially moved plugin. - How large is
the amount of sourced material in your local environment, Benji? Do you
run plugins not shipped with Vim too? And if yes, which ones? (Sorry for
I'm asking so much questions...)

Thanks,

Klaus

Antoine J. Mechelynck | 1 Jan 10:23 2003
Picon

Re: Toggle 'modified' flag

Klaus Bosau <kbosau <at> web.de> wrote:
> On Mon, 30 Dec 2002, Antoine J. Mechelynck wrote:
[...]
> > I wonder wat caused buffer 3 (the current [NoFile] buffer) to be
> > marked as modified. To see where it comes from, it might be
> > instructive to do
> >
> >         :verbose setlocal modified?
> >
> > in the buffer in question, with the question mark
>
> I entered
>
>           set nomodified
>           verbose setlocal modified? (resp. set verbose=20)
>           redir! > c:\vim\log
>
> at the very bottom of the script, but 'log' didn't show any buffer
> related information. The buffer in question however again has been
> marked 'modified'.

I meant you to type :verbose setlocal modified? yourself as a Vim command,
not enter it into a script; and if you put it before the redir command, it
won't be redirected, but its output (if any) will appear on the
command-line. But apparently even if you get an answer it might be for a
different buffer.
>
> In the meantime I found out that scripts residing in the plugin/
> directory (it's the default collection) cannot be responsible for this.
> So I'm looking for a new candidate now. ":scrip" told me that it might
(Continue reading)

Antoine J. Mechelynck | 1 Jan 10:39 2003
Picon

Re: Problem with menu items

Klaus Bosau <kbosau <at> web.de> wrote:
> On Tue, 31 Dec 2002, Antoine J. Mechelynck wrote:
>
> > Oops! 2nd byte is FA, not F0.
>
> Hi Antoine,
>
> the sequence in question showed up where (normal mode) keystrokes
> normally are shown. Are there any commands which could have caused this?
> "128" for instance... It denotes the symbol for the european monetary
> unit. Isn't it unlikely that a normal mode command contains this
> character?
>
> Thanks,
>
> Klaus

I'm still thinking of something nasty, stack overflow, buffer ovrerun, using
an uninitialized pointer, etc. That bytestring looked to me like an
out-of-contest snippet of program code, possibly for some Intel x86
platform, but too short to be easily understood. In that case your 128 would
be a 0x80 byte somewhere in an instruction, and it cannot be interpreted
without knowing at least where the (possibly multibyte) instruction starts.
And anyway once you start unintentionally handling program code as data, all
hell can break loose anytime.

Tony.

Antoine J. Mechelynck | 1 Jan 11:24 2003
Picon

Re: multibyte and 'encoding' and 'fileencoding'

Benji Fisher <benji <at> member.AMS.org> wrote:
[...]
>       I am surprised that a file is not supposed to contain a raw
> "\xe4".  What is to stop me from doing
>
> > put=\"xe4\"
>
> --Benji Fisher

If your file is in UTF-8, then obviously it must obey UTF-8 encoding rules;
and these rules say (among other things) that:

    - Codepoints from 0000 to 007F are compatible with us-ascii and are
encoded as one byte, with high bit off
    - Codepoints from 0080 upwards are encoded as a string of 2 or more
bytes; the first of those is greater than 0xC0, the other(s) lie in the
range 0x80-0xBF. The number of highbits in the first byte determines the
number of following bytes

So there is a strict separation between single-bytes (0x00-0x7F),
first-bytes (0xC0-0xFF, and not all values in that range are legal) and
following-bytes (0x80-0xBF) to avoid context ambiguity.

Details can be found somewhere on the Unicode site, whose entry page is at
http://www.unicode.org/ . And don't forget that if 'encoding' is set to
utf-8, then all files will be internally represented as UTF-8 while editing,
with translation when reading or writing non-UTF-8 files. So typing (in
Insert mode) Ctrl-V followed by xE4 will enter the 00E4 codepoint into
memory as two bytes, 0xC3 0xA4, but show it as one character, small a with
umlaut; and pressing x once in Normal mode with the cursor on that
(Continue reading)