Having a lot of trouble setting options

45 views
Skip to first unread message

Dick Moores

unread,
Aug 16, 2008, 2:17:24 PM8/16/08
to vim...@googlegroups.com
Win XP, vim 7.2
using gvim

I'm trying to change the blinking of the cursor, which is too fast
for my liking. So I consult the PDF manual, "Changing the Appearance
of the Cursor", from p. 345, and find this format:
:set guicursor=mode:style[-highlight],mode:style[-highlight],...

So I try

set guicursor n:block-Cursor-blinkwait175-blinkoff150-blinkon400

and get

"Unknown option"

This is just one more time that I've been frustrated in an attempt to
set a somewhat complex option.

So 2 questions:

1. Where do I go for general instructions on the setting of options?
I can't even figure out when to use set and when not to. I see this
line in my _gvimrc:

colorscheme peaksea

No set at all, but it works.

2. What's the right way to get the cursor blinking I want?

Thanks,

Dick Moores

Tim Chase

unread,
Aug 16, 2008, 2:45:03 PM8/16/08
to vim...@googlegroups.com
> of the Cursor", from p. 345, and find this format:
> :set guicursor=mode:style[-highlight],mode:style[-highlight],...
>
> So I try
>
> set guicursor n:block-Cursor-blinkwait175-blinkoff150-blinkon400
>
> and get
>
> "Unknown option"

Looks like you're missing an "=" in there. The "Unknown option"
is directing you to notice that
"n:block-Cursor-blinkwait175-blinkoff150-blinkon400" isn't a Vim
setting. If you use "set" with non-boolean options and no "="
assignment, it assumes that you want to see their settings:

set titlestring ruler

has a very different behavior from

set titlestring=ruler

The first one displays the settings for the 'titlestring' and
'ruler' options, while the 2nd one sets your 'titlestring' to
"ruler" (a pretty useless thing to do. :)

> 1. Where do I go for general instructions on the setting of options?

:help :set

and more generally

:help options.txt

> I can't even figure out when to use set and when not to. I see this
> line in my _gvimrc:
>
> colorscheme peaksea
>
> No set at all, but it works.

I must admit, I can't explain the original line of thinking as to
why this wasn't done using "set colorscheme=peaksea" rather than
a command. However ":colorscheme" was created as a command, just
like ":set" or ":g" is. If the option is listed in the
options.txt help, it's set with ":set <option>=value" for
non-boolean values or "set <option>"/"set no<option>" for boolean
values. The ":colorscheme" is a bit anomalous in my book, but
that's how it goes.

> 2. What's the right way to get the cursor blinking I want?

Add the "=" to what you have, using the line from p345 exactly :)

-tim


Raúl Núñez

unread,
Aug 16, 2008, 2:59:19 PM8/16/08
to vim...@googlegroups.com
Saluton Dick :)

On Sat, 16 Aug 2008 11:17:24 -0700, Dick Moores dixit:


> I'm trying to change the blinking of the cursor, which is too fast
> for my liking. So I consult the PDF manual, "Changing the Appearance
> of the Cursor", from p. 345, and find this format:
> :set guicursor=mode:style[-highlight],mode:style[-highlight],...
>
> So I try
>
> set guicursor n:block-Cursor-blinkwait175-blinkoff150-blinkon400

"set guicursor=whatever", not "set guicursor whatever". Don't forget the
equal sign.

> and get
>
> "Unknown option"

That's because without the equal sign, Vim is considering "n:block-..."
as an option name.



> This is just one more time that I've been frustrated in an attempt to
> set a somewhat complex option.
>
> So 2 questions:
>
> 1. Where do I go for general instructions on the setting of options?
> I can't even figure out when to use set and when not to. I see this
> line in my _gvimrc:
>
> colorscheme peaksea

"colorscheme" is a command, not an option, so there's no "set" before.

Try ":help set".

> 2. What's the right way to get the cursor blinking I want?

Dunno, I've never set the cursor blinking, but probably the only problem
was the missing "=". Give it a try and, if it still doesn't work, just
ask again with additional details (if any).

Good luck :)

Raúl "DervishD" Núñez de Arenas Coronado
--
Linux Registered User 88736 | http://www.dervishd.net
It's my PC and I'll cry if I want to... RAmen!
We are waiting for 13 Feb 2009 23:31:30 +0000 ...

Tony Mechelynck

unread,
Aug 16, 2008, 3:56:08 PM8/16/08
to vim...@googlegroups.com
On 16/08/08 20:17, Dick Moores wrote:
> Win XP, vim 7.2
> using gvim
>
> I'm trying to change the blinking of the cursor, which is too fast
> for my liking. So I consult the PDF manual, "Changing the Appearance
> of the Cursor", from p. 345, and find this format:
> :set guicursor=mode:style[-highlight],mode:style[-highlight],...
>
> So I try
>
> set guicursor n:block-Cursor-blinkwait175-blinkoff150-blinkon400
>
> and get
>
> "Unknown option"

There should be no space, but an equal sign (or colon), between the
option name and its value:

:set gcr=n:block-Cursor-blinkwait175-blinkoff150-blinkon400

which, however, doesn't define the cursor in the other modes.

I'm using the following:

if has('gui_running')
set guicursor=n-v-c:block-Cursor/lCursor
set guicursor+=ve:ver35-Cursor,o:hor50-Cursor
set guicursor+=i-ci:ver25-Cursor/lCursor
set guicursor+=r-cr:hor20-Cursor/lCursor
set guicursor+=sm:block-Cursor
set guicursor+=a:blinkwait750-blinkoff750-blinkon750
endif

which gives a steady blinking rate of 0.75 seconds on, 0.75 seconds off
in all modes, and uses the default shapes and colours. Change it to suit
your taste, of course.

>
> This is just one more time that I've been frustrated in an attempt to
> set a somewhat complex option.
>
> So 2 questions:
>
> 1. Where do I go for general instructions on the setting of options?
> I can't even figure out when to use set and when not to. I see this
> line in my _gvimrc:
>
> colorscheme peaksea
>
> No set at all, but it works.

Options, which are listed under ":help option-list", described starting
at ":help option-summary" and shown between single quotes wherever they
appear in the help, are set using the ":set", ":setlocal" and
":setglobal" commands. The way to set them is described in the help for
these three commands, and the allowable values under the help for each
option.

However, there are a few other commands which define, not "options" in
the strict sense mentioned above, but "settings" in a somewhat more
general sense of the word. The following commands are of that kind:

:language
:filetype
:colorscheme
:syntax

How to use them is described in the help for each of them.

>
> 2. What's the right way to get the cursor blinking I want?

see above

>
> Thanks,
>
> Dick Moores

My pleasure,
Tony.

Dick Moores

unread,
Aug 16, 2008, 4:10:03 PM8/16/08
to vim...@googlegroups.com

And set guicursor=a:blinkwait1-blinkoff550-blinkon550 does exactly
what I wanted. I'd already got a better cursor color with

highlight Cursor guibg=firebrick guifg=NONE

Thanks to Tim and Juan, I'm a much happier camper. I was beginning
to think of (g)vim as a major time sink. Well, I still think it is
(I haven't done any programming for days now), but it's damned
interesting. What a great list this is!

Dick


Dick Moores

unread,
Aug 16, 2008, 4:37:20 PM8/16/08
to vim...@googlegroups.com

That whole thing of yours is at the bottom of my -gvimrc now (I did
change all the 750's to 550's). (Your example helped me understand
blinkwait--the doc was hard to understand.)

The only modes I understand are n, i, and a. Would I be using ve, r,
ci, cr, and sm with gvim on Win XP? Can I? Should I? Some info on
these would be gratefully received. Although maybe I just figured out
r when I replaced a character using "r" and saw the cursor change
shape to horizontal.

> > This is just one more time that I've been frustrated in an attempt to
> > set a somewhat complex option.
> >
> > So 2 questions:
> >
> > 1. Where do I go for general instructions on the setting of options?
> > I can't even figure out when to use set and when not to. I see this
> > line in my _gvimrc:
> >
> > colorscheme peaksea
> >
> > No set at all, but it works.
>
>Options, which are listed under ":help option-list", described starting
>at ":help option-summary" and shown between single quotes wherever they
>appear in the help, are set using the ":set", ":setlocal" and
>":setglobal" commands. The way to set them is described in the help for
>these three commands, and the allowable values under the help for each
>option.
>
>However, there are a few other commands which define, not "options" in
>the strict sense mentioned above, but "settings" in a somewhat more
>general sense of the word. The following commands are of that kind:
>
> :language
> :filetype
> :colorscheme
> :syntax
>
>How to use them is described in the help for each of them.

Thanks for these!

> > 2. What's the right way to get the cursor blinking I want?
>
>see above

Thanks very much, Tony.

Dick


Tony Mechelynck

unread,
Aug 16, 2008, 5:16:49 PM8/16/08
to vim...@googlegroups.com
On 16/08/08 22:37, Dick Moores wrote:
> At 12:56 PM 8/16/2008, Tony Mechelynck wrote:
[...]

>> I'm using the following:
>>
>> if has('gui_running')
>> set guicursor=n-v-c:block-Cursor/lCursor
>> set guicursor+=ve:ver35-Cursor,o:hor50-Cursor
>> set guicursor+=i-ci:ver25-Cursor/lCursor
>> set guicursor+=r-cr:hor20-Cursor/lCursor
>> set guicursor+=sm:block-Cursor
>> set guicursor+=a:blinkwait750-blinkoff750-blinkon750
>> endif
>>
>> which gives a steady blinking rate of 0.75 seconds on, 0.75 seconds off
>> in all modes, and uses the default shapes and colours. Change it to suit
>> your taste, of course.
>
> That whole thing of yours is at the bottom of my -gvimrc now (I did
> change all the 750's to 550's). (Your example helped me understand
> blinkwait--the doc was hard to understand.)
>
> The only modes I understand are n, i, and a. Would I be using ve, r,
> ci, cr, and sm with gvim on Win XP? Can I? Should I? Some info on
> these would be gratefully received. Although maybe I just figured out
> r when I replaced a character using "r" and saw the cursor change
> shape to horizontal.
[...]

n: Normal mode
v: Visual mode (started by v V or Ctrl-V in Normal mode)
c: Command-line append (started by hitting : in Normal mode)
i: Insert mode
you will certainly need all of the above
ci: Command-line insert
for command-line editing
after moving the cursor leftwards on the command-line
r: Replace
for r, R etc.
cr: Command-line replace
for command-line editing in Replace mode
started e.g. by hitting Ins after moving the cursor leftwards
on the command-line
o: operator-pending mode
e.g. when Vim is waiting for you to type a motion command
after an operator such as y d c etc.
ve: Visual with selection exclusive
you may or may not need this depending on
your 'selection' setting
sm: showmatch in Insert mode
you may or may not need this depending on
your 'showmatch' setting
a: all of the above
this one is the easiest to understand ;-)

The full power of the 'guicursor' option is seen only in gvim, though in
console Vim for Windows (vim.exe) it is possible to use it to control
the height (but not the width, colour or blink rate) of the cursor.

The fact that you're on Windows, Unix, Mac or whatever is immaterial,
that option works the same way in all versions of gvim.


Best regards,
Tony.
--
Peter's Law of Substitution:
Look after the molehills, and the mountains will look after
themselves.

Dick Moores

unread,
Aug 16, 2008, 6:40:35 PM8/16/08
to vim...@googlegroups.com

Yes.

>ci: Command-line insert
> for command-line editing
> after moving the cursor leftwards on the command-line

Yes, I see your setting is useful. Before, I couldn't see the cursor
while moving it leftwards.

>r: Replace
> for r, R etc.
>cr: Command-line replace
> for command-line editing in Replace mode
> started e.g. by hitting Ins after moving the cursor leftwards
> on the command-line
>o: operator-pending mode
> e.g. when Vim is waiting for you to type a motion command
> after an operator such as y d c etc.

Ah. Informative.

>ve: Visual with selection exclusive
> you may or may not need this depending on
> your 'selection' setting

I'll have to investigate that.

>sm: showmatch in Insert mode
> you may or may not need this depending on
> your 'showmatch' setting

I turned it on to see. Nice!

>a: all of the above
> this one is the easiest to understand ;-)
>
>The full power of the 'guicursor' option is seen only in gvim, though in
>console Vim for Windows (vim.exe) it is possible to use it to control
>the height (but not the width, colour or blink rate) of the cursor.
>
>The fact that you're on Windows, Unix, Mac or whatever is immaterial,
>that option works the same way in all versions of gvim.

Good info.

Thanks for trouble you went to in spelling all that out for me.

Dick


Dick Moores

unread,
Aug 16, 2008, 6:40:35 PM8/16/08
to vim...@googlegroups.com

Yes.

>ci: Command-line insert
> for command-line editing
> after moving the cursor leftwards on the command-line

Yes, I see your setting is useful. Before, I couldn't see the cursor
while moving it leftwards.

>r: Replace


> for r, R etc.
>cr: Command-line replace
> for command-line editing in Replace mode
> started e.g. by hitting Ins after moving the cursor leftwards
> on the command-line
>o: operator-pending mode
> e.g. when Vim is waiting for you to type a motion command
> after an operator such as y d c etc.

Ah. Informative.

>ve: Visual with selection exclusive
> you may or may not need this depending on
> your 'selection' setting

I'll have to investigate that.

>sm: showmatch in Insert mode


> you may or may not need this depending on
> your 'showmatch' setting

I turned it on to see. Nice!

>a: all of the above


> this one is the easiest to understand ;-)
>
>The full power of the 'guicursor' option is seen only in gvim, though in
>console Vim for Windows (vim.exe) it is possible to use it to control
>the height (but not the width, colour or blink rate) of the cursor.
>
>The fact that you're on Windows, Unix, Mac or whatever is immaterial,
>that option works the same way in all versions of gvim.

Good info.

Reply all
Reply to author
Forward
0 new messages