Can't get <c-j>, <c-h>, <c-l>, <c-k> to work with lazy.nvim on neovim, other keys work fine
sdondley opened this issue · comments
I've been using this plugin for a few years now so I'm familiar with it. I'm trying to get it working on a new machine running neovim with lazy.nvim. <c-j,h,l,k>
keys all work fine between tmux panes outside of vim. However, I can't get them to respond between vim splits.
I have this dropped directly into the last part of my init.vim file:
vim.cmd([[
let g:tmux_navigator_no_mappings = 1
let g:tmux_navigator_disable_when_zoomed = 0
noremap <silent> <c-h> :up<cr>:TmuxNavigateLeft<cr>
noremap <silent> <c-j> :<C-U>TmuxNavigateDown<cr>
noremap <silent> <leader>y :<C-U>TmuxNavigateUp<cr>
noremap <silent> <c-l> :up<cr>:TmuxNavigateRight<cr>
]])
The <leader>y
mapping works perfectly fine. But <c-j>
does not. I disabled all other plugins but it still did not help.
Any ideas?
Thanks. I clearly don't know what I'm doing with lazy.nvim. I can't figure out how to use the keymaps.lua file:
![image](https://private-user-images.githubusercontent.com/2506364/258449907-efcb1a5e-60b5-4d22-8f6e-da641eb602b6.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTQzNDU0NDUsIm5iZiI6MTcxNDM0NTE0NSwicGF0aCI6Ii8yNTA2MzY0LzI1ODQ0OTkwNy1lZmNiMWE1ZS02MGI1LTRkMjItOGY2ZS1kYTY0MWViNjAyYjYucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDQyOCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA0MjhUMjI1OTA1WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MzUwZTM1YWE5NzdiZDNhY2FlZGQzMGM3MWFlNjNlZWZkNzY0ZWM1NjJlNzBlZmY4ZTJhNDdmMDY3NzI2MDYxOSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.LoGV9EFFMQK6lI9pAP8mrFHsPUCLbDBsDKUMXKkzaME)
It doesn't seem to work with vim.cmd
or the suggestion at LazyVim/LazyVim#277 (comment)
What baffles me is :verb map <c-j>
reports: <C-J> * :<C-U>TmuxNavigateDown<CR>
@christoomey OMFG, problem was apk add procps
package not in my dockerfile: https://github.com/christoomey/vim-tmux-navigator#switching-between-host-panes-doesnt-work-when-docker-is-running
Funny thing is I'm the one who made that pull request to the docs for this very problem several months ago.
But I didn't possibly think this could be the issue since it was working fine with <leader>y
.
Happens to the best of us. At least you did the noble thing back when and documented for future travelers (now including you) to find 🙂
I disabled the keymap etc in ~/.local/share/nvim/lazy/LazyVim/lua/lazyvim/config/keymaps.lua, then define your own for vim-tmux-navigator