9

When trying to use vim-latexsuite's mappings, the ones using Leader are not working:

:nmap
----------------------------------------
n  <Leader>rf   @<Plug>Tex_RefreshFolds
n  <Leader>ls   @<Plug>Tex_ForwardSearch
n  <Leader>lv   @<Plug>Tex_View
n  <Leader>ll   @<Plug>Tex_Compile

All other mappings by this plugin are working, so the plugin is being loaded correctly. Without mapleader being set, Leader should default to \ (Backslash).

When typing \ll in command mode, the cursor gets moved 2 characters to the right, as it's supposed to by just typing ll. So the Backslash seems to be ignored. Vim does not beep or display any errors and the ll follows earlier than 1000ms, which is my timeoutlen.

I have also tried the following settings in both .vimrc and /etc/vimrc (Though I assume only mapleader needs to be set here):

let mapleader = ","
let maplocalleader = ","

After this, Vim behaves the same way: No beep, no error and after typing ,ll the cursor moves 2 characters to the right.

Any ideas how to fix this?

J0hn D0e
  • 167
  • 1
  • 3
  • 10
  • 1
    What do you get when you type `:echo mapleader`? :verbose nmap \? – romainl Jul 19 '12 at 12:03
  • :echo mapleader -> `,` and :verbose nmap \ (or ,) -> `No mapping found` – J0hn D0e Jul 19 '12 at 12:28
  • Here, `:nmap` and `:nmap ` don't return `n b SomeCommand` but `n ,b SomeCommand`. Note that `` is expanded to its value. It looks to my untrained eyes as if the value of mapleader would be set to the string ``, which seems quite weird. – romainl Jul 19 '12 at 12:58
  • 1
    This may not be the case here but it's a useful tidbit nonetheless.. If mapleader is changed after a plugin is already loaded the new mapleader will not be a part of the mappings for that plugin. Another quirk with mapleader. – Randy Morris Jul 19 '12 at 13:00
  • Manually reinstalling the plugin didn't change anything. Any more ideas? – J0hn D0e Jul 19 '12 at 14:39
  • If you edit the plugins code and make a mapping next to the other ones that just echo's "test", does it work? – Conner Jul 19 '12 at 16:10
  • Do you mean something like this: `:nnoremap d dd` I added this to my .vimrc and `:nmap` returns `n d * dd`. When i type ",d", only one "d" is being shown in the bottom right corner. So it doesn't work either. As i said in the Question, the other mappings of the plugin are working. – J0hn D0e Jul 19 '12 at 16:19
  • Have you seen this? http://stackoverflow.com/questions/8189055/vim-and-gvim-leader-key-not-working – Conner Jul 19 '12 at 16:30
  • Yes, and my `let mapleader = ","` is at the top of my .vimrc. But even without that working, the Leader should default to \, which doesn't work either (Both \ and , seem to be ignored by Vim). – J0hn D0e Jul 19 '12 at 16:34

4 Answers4

11

If you've shortened timeoutlen, you won't be able to type quickly enough. If you look at :help 'ttimeoutlen', you'll see it suggests:

:set timeout timeoutlen=3000 ttimeoutlen=100
neptunepink
  • 111
  • 1
  • 3
4

Try to clear a content of ~/.viminfo file and if you are using a session plugin -- clear a session data in generated file. Then restart Vim. It helps me sometimes when I experiment with different settings, mappings etc.

  • 1
    This worked for me. I had the same problem as the original post, and when I deleted the .viminfo and reloaded, the remapped leader key worked as expected. – leonormes Aug 02 '15 at 14:54
1

After uninstalling Vim, removing all plugin and config files and reinstalling it, the Leader works just fine. Unfortunately, i don't know what exactly caused Vim to ignore the Leader.

J0hn D0e
  • 167
  • 1
  • 3
  • 10
  • In my case, I had some conflicting "let mapleader" leader changes in a couple ~/.vim/ftplugin/tex_*.vim that were executing in the wrong order. Having them execute in the right order solved it for me without a reinstall. – rfabbri Nov 08 '15 at 19:14
0

If you have a mapping like this in your .vimrc,

nmap <Leader>rf @<Plug>Tex_RefreshFolds

then the output of nmap (without arguments) should be this:

n  \rf   @<Plug>Tex_RefreshFolds

In other words, "<Leader>" should be expanded to "\". Since this is not the case for you, something is going wrong with your mapping. This could be caused by having "<" in your cpoptions. Try set cpoptions? to check.

tsnee
  • 78
  • 7