Closed eduardoarandah closed 8 months ago
@eduardoarandah What's your localleader
set to ? Make sure it's set to the right thing during config function.
@eduardoarandah What's your
localleader
set to ? Make sure it's set to the right thing during config function.
\
<space>
As you can see, it's shown as \
when opening a markdown file.
<space> tt
should not trigger table mode here <localleader> tt
should trigger it and it doesn't video:
https://user-images.githubusercontent.com/4065733/215833046-eaa8b4d2-53eb-4e15-9f38-ed53f8256963.mp4
@eduardoarandah Thanks for reporting this, the screencast is really helpful. I am going to test this and report back.
I added the line vim.g.table_mode_map_prefix = '<leader>mt'
to my init.lua file before the line that installs Lazy.nvim and the prefix gets changed correctly to what I want.
I think this issue might be similar to setting the leader key as described in kickstart.nvim, but I'm not entirely sure.
-- Set <space> as the leader key
-- See `:help mapleader`
-- NOTE: Must happen before plugins are required (otherwise wrong leader will be used)
@darricheng Can you share a minimal vimrc for me to test with ? I don't use Lazy.nvim, so it'll help me test this quickly.
@eduardoarandah ^
@dhruvasagar I'm still a beginner with Neovim, so I'm not sure what the absolute minimum config would be to test this, but I can point you to kickstart.nvim's init.lua file. It's the base config that I started with, and it's one of the more minimal base Neovim configs that I'm aware of.
What I did for my config was the equivalent of adding vim.g.table_mode_map_prefix = '<leader>mt'
to line 44 of the init.lua file that I linked.
Note that since this is Neovim, the file is init.lua
instead of vimrc.
By minimal, I mean a vimrc that sets up just maybe lazy.nvim and vim-table-mode as plugins along with any customizations you're using. That way we can isolate and identify if the issue is with vim-table-mode or your particular setup. I'll take a look at the linked kickstart.nvim file, but i'll be a couple of days until I can get back on this.
I've had the same issue, the solution is to use the 'init' property instead of 'config', as that triggers much earlier.
@eduardoarandah and other folks facing this issue. In neovim, there's an issue that requires you to configure mapleader
or maplocalleader
before you load plugins to correctly use Leader
or LocalLeader
mappings. This was an issue I faced myself.
{
"dhruvasagar/vim-table-mode",
config = function ()
vim.g.table_mode_map_prefix = "mt"
end
},
I use neovim (+ lazy.nvim as my package manager). Even without using <leader>
or <localleader>
, the mappings do not change. As @gwash said, changing config
to init
gets the mappings to change. Though, tbh, I'd prefer the option of disabling all default mappings since I prefer to make my own.
Thanks for the awesome plugin!
@carbon-steel That's a good point. Typically these configurations should be added in vimrc, which is loaded before plugins are loaded. While the config
callback of lazy is called after loading the plugin. So that's why it does not work, if the configuration is not set before the plugin loads, it uses the defaults as you are experiencing. Sounds like init
is the way to go for lazy. I shall add that note in the README.md
Version:
Want:
change prefix from
<leader>t
to<localleader>t
because I've already mapped some things to: leader t leader ttTried:
Also tried:
Executing manually
:let g:table_mode_map_prefix = '<localleader>t'
in buffer with no success, leader tt still adds pipes to content.Any ideas?