Saturday, April 2, 2011

Re: Some Vim peculiarities

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


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

No comments: