Backtick to move to mark doesn't work (E78: Unknown mark)

1,278 views
Skip to first unread message

Martin Lundberg

unread,
Apr 13, 2011, 3:01:25 AM4/13/11
to vim...@googlegroups.com
Hi.

I'm having problems with using the backtick ` character to move to
marks. If I do ma to set a mark into 'a' and then do 'a (a single
quote not a backtick) everything works and the cursor is moved to the
first non-blank on the marked line. However if I try `a I get an error
saying "E78: Unknown mark". What am I missing?

Thanks,

Martin

Ben Schmidt

unread,
Apr 13, 2011, 3:24:02 AM4/13/11
to vim...@googlegroups.com, Martin Lundberg

Hmm. Usually you get 'E20: Mark not set' when a mark is not set, and
your error message if you use some character which actually cannot be a
mark. So that suggests you are not actually typing a after the backtick,
but somehow typing some other letter/symbol. Have you accidentally
neglected to release a shift key, or is your keyboard layout treating `
as a dead key and producing an accented character or something?

Ben.

Ben Schmidt

unread,
Apr 13, 2011, 7:56:58 AM4/13/11
to Martin Lundberg, vim use
On 13/04/11 8:50 PM, Martin Lundberg wrote:

> On Wed, Apr 13, 2011 at 9:24 AM, Ben Schmidt
> <mail_ben...@yahoo.com.au> wrote:
>>
>> Hmm. Usually you get 'E20: Mark not set' when a mark is not set, and
>> your error message if you use some character which actually cannot be a
>> mark. So that suggests you are not actually typing a after the backtick,
>> but somehow typing some other letter/symbol. Have you accidentally
>> neglected to release a shift key, or is your keyboard layout treating `
>> as a dead key and producing an accented character or something?
>>
>> Ben.
>
> When I type ` it waits for me to enter another key for example a to
> create �. So maybe when I hit ` vim waits for another key and when I
> hit a it gets � which is not a valid mark. If so is the case, how
> would I solve it?

I do think that's the problem. But I have no idea how to solve it. CCing the
mailing list again so somebody else can help.

It would probably help to know a bit more about your setup (operating system,
windo manager, etc.).

Ben.


Jürgen Krämer

unread,
Apr 13, 2011, 8:04:46 AM4/13/11
to vim...@googlegroups.com

Hi,

Ben Schmidt wrote:
> On 13/04/11 8:50 PM, Martin Lundberg wrote:
>> On Wed, Apr 13, 2011 at 9:24 AM, Ben Schmidt
>> <mail_ben...@yahoo.com.au> wrote:
>>>
>>> Hmm. Usually you get 'E20: Mark not set' when a mark is not set, and
>>> your error message if you use some character which actually cannot be a
>>> mark. So that suggests you are not actually typing a after the backtick,
>>> but somehow typing some other letter/symbol. Have you accidentally
>>> neglected to release a shift key, or is your keyboard layout treating `
>>> as a dead key and producing an accented character or something?
>>>
>>> Ben.
>>
>> When I type ` it waits for me to enter another key for example a to
>> create �. So maybe when I hit ` vim waits for another key and when I
>> hit a it gets � which is not a valid mark. If so is the case, how
>> would I solve it?
>
> I do think that's the problem. But I have no idea how to solve it. CCing the
> mailing list again so somebody else can help.

maybe a simple solution is enough

:nmap � `a
:nmap � `e
:nmap � `i
:nmap � `o
:nmap � `u

Regards,
J�rgen

--
Sometimes I think the surest sign that intelligent life exists elsewhere
in the universe is that none of it has tried to contact us. (Calvin)

Tony Mechelynck

unread,
Apr 13, 2011, 8:27:57 AM4/13/11
to vim...@googlegroups.com, Ben Schmidt, Martin Lundberg

If Vim received the single � character (SMALL LATIN LETTER A WITH GRAVE)
it wouldn't even know that a mark was asked for. The fact that the error
is about a mark shows that Vim received either an apostrophe or a
backtick; it's what comes just after that which wasn't the "name" of a
mark. If you are on a unix-like OS, are backticks recognized when Vim
sends them to the shell? For instance

:!ls -l `which vim`

should display the directory entry for your Vim executable.

Or, in Insert mode, do you know how to type `a as two characters
(backtick followed by lowercase latin a) with nothing in between? If you
do, the exact same keystrokes in Normal mode ought to bring you to mark a.

On my Belgian keyboard, the key I use to produce a backtick (AltGr with
�) is also a dead key: nothing is displayed immediately, if I type o
immediately afterwards I get �, if I want a backtick instead I have to
use AltGr-� followed by space (or followed by itself but that's slower).


Best regards,
Tony.
--
hundred-and-one symptoms of being an internet addict:
54. You start tilting your head sideways to smile.

Tony Mechelynck

unread,
Apr 13, 2011, 8:30:49 AM4/13/11
to vim...@googlegroups.com, Jürgen Krämer

Maybe; but not if you happen to use Vim to type French, Italian,
Catalan, or any language using grave-accented Latin letters as a matter
of course.


Best regards,
Tony.
--
The church is near but the road is icy; the bar is far away but I will
walk carefully.
-- Russian Proverb

Ben Schmidt

unread,
Apr 13, 2011, 8:36:07 AM4/13/11
to Tony Mechelynck, vim...@googlegroups.com, Martin Lundberg
> If you are on a unix-like OS, are backticks recognized when Vim sends
> them to the shell? For instance
>
> :!ls -l `which vim`
>
> should display the directory entry for your Vim executable.

Of course, this is unlikely to go wrong, since, as far as I know, there
is no w grave character.

I guess that thought gives something else to test in Vim. Do marks with
non-vowels work after the backtick. If so, that is perhaps further
evidence that this is indeed the problem.

(Like Tony, I think it's a bit odd that typing `a would produce
something like `� which is somewhat what I suggested earlier, as it does
appear Vim is receiving the backquote. But I think the fact that `a
produces � is enough to strongly suggest the problem is related to
this.)

Ben.

Ben Schmidt

unread,
Apr 13, 2011, 8:39:59 AM4/13/11
to vim...@googlegroups.com
>> maybe a simple solution is enough
>>
>> :nmap � `a
>> :nmap � `e
>> :nmap � `i
>> :nmap � `o
>> :nmap � `u
>>
>> Regards,
>> J�rgen
>>
>
> Maybe; but not if you happen to use Vim to type French, Italian,
> Catalan, or any language using grave-accented Latin letters as a
> matter of course.

I don't think you would regularly use those characters in normal mode,
would you, even if using those languages? I certainly don't when I type
French!

Ben.

Tony Mechelynck

unread,
Apr 13, 2011, 10:24:52 AM4/13/11
to vim...@googlegroups.com, Ben Schmidt

oops, sorry, :nmap -- and yet I know that "Vim is a modal editor"!
You're right.


Best regards,
Tony.
--
It has just been discovered that research causes cancer in rats.

Tony Mechelynck

unread,
Apr 13, 2011, 10:31:25 AM4/13/11
to Ben Schmidt, vim...@googlegroups.com, Martin Lundberg

If hitting the dead-key twice produces the backtick, then inadvertently
hitting it three times, or long enough to trigger the keyboard repeat
mechanism, might produce `� when followed by a. So maybe the OP should
just be extra careful to release the ` dead key quickly after each
press? Or hit ` <Space> rather than ` ` in order to produce the
spacing-grave (backtick) character?

Best regards,
Tony.
--
hundred-and-one symptoms of being an internet addict:

55. You ask your doctor to implant a gig in your brain.

Martin Lundberg

unread,
Apr 13, 2011, 10:34:19 AM4/13/11
to vim...@googlegroups.com
Because I'm not sure if I sent this only to Ben from my gmail I'm reposting it here on google groups.

Hello everyone!

I'm on OSX and I've tried this on both macvim (which is what i
normally use), the terminal vim which comes with MacVim and with
normal vim. I tried starting them all with:

vim -u NONE -U NONE -N

To see if it's a plugin problem. And the results is that it works fine
in both terminal vims but fails in macvim. So it should have something
to do with macvim. I will write a question in mac_vim mailinglist too
linking to this thread. If someone want to keep trying to find the
problem we can continue the discussion there.

Thanks for all the time and help :)

Martin Lundberg

unread,
Apr 13, 2011, 11:50:12 AM4/13/11
to vim...@googlegroups.com
With the help of Björn we've now found that the problem was the "Draw marked text inline" options in macvim settings window. When unchecked everything works as expected except for that I have to hit <space> after ` to get `a instead of à.

Thanks everyone for the help!
Reply all
Reply to author
Forward
0 new messages