Some Vim peculiarities

10 views
Skip to first unread message

Jostein Berntsen

unread,
Apr 2, 2011, 5:01:00 PM4/2/11
to vim...@googlegroups.com
Hi,

I have some questions regarding some peculiar behavior in my Vim 7.3.
Some of these might have been there from previous versions, while some
seems to have been introduced in the new version. Some might also come
from some plugins I have installed, or setting in .vimrc. Hopefully I
can get some hints to what to do with these:

1. When doing a visual selection with "V" sometimes this function errors
out, and all lines are underlined instead. Doing commands on this
underlined selection does not work, and several other vim commands stops
working. I have to close the file and reopen to make it work again.

2. Hitting "Return/Enter" in normal mode closes vim.

3. Sometimes when I copy/paste in Vim it errors out with a "Bad Atom"
error message.

4. "l" opens a fold instead of moving right in the line.

5. "^" must be clicked two times to be activated to go to first letter
in line.


Jostein


Tim Chase

unread,
Apr 2, 2011, 8:01:04 PM4/2/11
to vim...@googlegroups.com
On 04/02/2011 04:01 PM, Jostein Berntsen wrote:
> I have some questions regarding some peculiar behavior in my Vim 7.3.
> Some of these might have been there from previous versions, while some
> seems to have been introduced in the new version. Some might also come
> from some plugins I have installed, or setting in .vimrc.

All of these are almost surely from plugins or a setting in your
.vimrc which you can verify by starting vim with

vim -u NONE file1.txt file2.txt ...

This will prevent Vim from loading your .vimrc and any plugins.
Having a list of the scripts/plugins might help track down the
offenders which, in your regular load of vim, can be found with

:redir > scriptnames.txt
:scriptnames
:redir END

(you can then send the created "scriptnames.txt" file to the
list) While I don't use much in the way of vim-scripts, it will
help others on the list track down the peculiar behaviors.

> 1. When doing a visual selection with "V" sometimes this
> function errors out, and all lines are underlined instead.
> Doing commands on this underlined selection does not work,
> and several other vim commands stops working. I have to close
> the file and reopen to make it work again.
>
> 2. Hitting "Return/Enter" in normal mode closes vim.

I don't have much insight on these (#1 & #2) without your scripts.

> 3. Sometimes when I copy/paste in Vim it errors out with a
> "Bad Atom" error message.

How are you copy&paste'ing and is this vim or gvim? Are you
using the X selection-buffer (selecting with the mouse and
pasting with middle-click) or are you pasting with either the "*"
or "+" register? Pasting into a terminal with middle-mouse acts
as if you're typing the characters in the buffer which can
produce odd effects.

> 4. "l" opens a fold instead of moving right in the line.

This is actually a default behavior, though ou may want to tweak
the 'foldopen' setting to remove "hor":

:set foldopen-=hor

You can read more at

:help 'foldopen'

for other actions which open folds to alter to your desired behavior.

> 5. "^" must be clicked two times to be activated to go to
> first letter in line.

This sounds like a mapping that begins with "^". Check the output of

:map
:map!

to see if any mappings begin with "^". What you're seeing is Vim
waiting to discern between pure "^" and your mapping (say, "^x").
To double-verify my hypothesis, try typing any other character
after the "^" that isn't the mapping.


Hope this helps you on at least a few of the issues.

-tim


Jostein Berntsen

unread,
Apr 3, 2011, 3:04:33 AM4/3/11
to vim...@googlegroups.com

Thanks for your detailed answer, this helped me on the way to solve some
of these.

1. It seems like this occurs even without loading any scripts. I will
check some more regarding this.

2. This I located to a mapping in my .vimrc. Removing this solved it.


> >3. Sometimes when I copy/paste in Vim it errors out with a
> >"Bad Atom" error message.
>
> How are you copy&paste'ing and is this vim or gvim? Are you using
> the X selection-buffer (selecting with the mouse and pasting with
> middle-click) or are you pasting with either the "*" or "+"
> register? Pasting into a terminal with middle-mouse acts as if
> you're typing the characters in the buffer which can produce odd
> effects.
>

3. This occurs especially when using the ":y+" command I believe. Will
check more on this. I have some problems with klipper crashing on my box
now, so I will check out this first.


> >4. "l" opens a fold instead of moving right in the line.
>
> This is actually a default behavior, though ou may want to tweak the
> 'foldopen' setting to remove "hor":
>
> :set foldopen-=hor
>

4. This setting removed the fold opening, but also removed the move to
right. Will check more tweaks here.

>
> >5. "^" must be clicked two times to be activated to go to
> >first letter in line.
>
> This sounds like a mapping that begins with "^". Check the output of
>
> :map
> :map!
>
> to see if any mappings begin with "^". What you're seeing is Vim
> waiting to discern between pure "^" and your mapping (say, "^x").
> To double-verify my hypothesis, try typing any other character after
> the "^" that isn't the mapping.
>

5. This seems related to some mapping as you say. I will try to locate
this.

>
> Hope this helps you on at least a few of the issues.
>

Thanks!


Markus Osterhoff

unread,
Apr 3, 2011, 5:35:39 AM4/3/11
to vim...@googlegroups.com
* Jostein Berntsen <jbe...@broadpark.no> [110402 23:01]:
> Hi,
Hi Jostein,

> 5. "^" must be clicked two times to be activated to go to first letter
> in line.

This could be a "dead key" problem; some keyboard layouts allow you to
compose accented characters by first typing ^,´, or `, followed by an
appropriate letter. While then it is easy to type something like ê, a
literal ^ can be typed by ^^ or ^[space].

Assuming Linux:
You could try some keymap option, like in the command
setxkbmap <your layout here> nodeadkeys

(e.g. for a German keyboard: setxkbmap de nodeadkeys)
(also possible by some GUI, check "Preferences", "Keyboard", "Layout")

> Jostein
mo

Jostein Berntsen

unread,
Apr 3, 2011, 5:45:48 AM4/3/11
to vim...@googlegroups.com
>
> > >4. "l" opens a fold instead of moving right in the line.
> >
> > This is actually a default behavior, though ou may want to tweak the
> > 'foldopen' setting to remove "hor":
> >
> > :set foldopen-=hor
> >
>
> 4. This setting removed the fold opening, but also removed the move to
> right. Will check more tweaks here.
>

Sorry, this seems to work as it should. Tested it again and "l" moved
cursor to the right.


Jostein

Jostein Berntsen

unread,
Apr 3, 2011, 5:46:10 AM4/3/11
to vim...@googlegroups.com

Will check this, thanks!


Jostein

Reply all
Reply to author
Forward
0 new messages