Code Monkey home page Code Monkey logo

Comments (5)

Normanras avatar Normanras commented on September 16, 2024 3

@aserowy Let me see if I can help with this and/or take it over. Sucks that you're not using tmux anymore!

@kohane27 can you please run in vim/neovim :nmap <A-h> (along with the other keys) and let me know what command those keys are mapped to?

Have you installed any other plugins recently?

from tmux.nvim.

aserowy avatar aserowy commented on September 16, 2024 1

@Normanras

tyvm!

I mean, i am not using tmux anymore because i switched my working environment to linux completly :) i would say this is a good thing :D

from tmux.nvim.

kohane27 avatar kohane27 commented on September 16, 2024 1

Hello guys! I figured it out.

TL;DR: it was a keybinding conflict with a tmux plugin I use called tmux-tilish.

The following maybe helpful for debugging if you have similar problems:

If you achieve cycle-free navigation in nvim, it means it's not a problem with tmux.nvim. The problem very likely lies within your tmux config.

Try the default keybindings outlined in tmux.nvim#navigation. Do not remap the keys just yet. Remember to tmux kill-sever to make sure tmux reloads the changes. If it works, then it means you have keybinding conflicts within your tmux environment. This was my case.

If you happened to use tmux-tilish that was causing this issue for me, go to its source code and comment out the following:

# Switch to pane via Alt + hjkl.
tmux $bind "${mod}${h}" select-pane -L
tmux $bind "${mod}${j}" select-pane -D
tmux $bind "${mod}${k}" select-pane -U
tmux $bind "${mod}${l}" select-pane -R

You also need to set set -g @tilish-navigator 'off' and add cycle-free navigation outlined in tmux.nvim#navigation to your .tmux.conf. The full code:

set -g @tilish-navigator 'off'

is_vim="ps -o state= -o comm= -t '#{pane_tty}' | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"

# navigation
bind-key -n 'M-h' if-shell "$is_vim" 'send-keys M-h' { if -F '#{pane_at_left}' '' 'select-pane -L' }
bind-key -n 'M-j' if-shell "$is_vim" 'send-keys M-j' { if -F '#{pane_at_bottom}' '' 'select-pane -D' }
bind-key -n 'M-k' if-shell "$is_vim" 'send-keys M-k' { if -F '#{pane_at_top}' '' 'select-pane -U' }
bind-key -n 'M-l' if-shell "$is_vim" 'send-keys M-l' { if -F '#{pane_at_right}' '' 'select-pane -R' }

bind-key -T copy-mode-vi 'M-h' if -F '#{pane_at_left}' '' 'select-pane -L'
bind-key -T copy-mode-vi 'M-j' if -F '#{pane_at_bottom}' '' 'select-pane -D'
bind-key -T copy-mode-vi 'M-k' if -F '#{pane_at_top}' '' 'select-pane -U'
bind-key -T copy-mode-vi 'M-l' if -F '#{pane_at_right}' '' 'select-pane -R'

Reload and it should work. Cheers!

from tmux.nvim.

aserowy avatar aserowy commented on September 16, 2024

Heho,

the config seems fine. Currently im not using tmux in my workflow anymore. Thus, i have no idea why it stopped working :D
To get a better grasp: What tmux version are you using? Maybe we have an issue on this end, because #{pane_at_left} should resolve only if there is a pane at the left.

Kinde regards
Alexander

from tmux.nvim.

kohane27 avatar kohane27 commented on September 16, 2024

@Normanras

Thank you for taking a look into this. I appreciate it:)

:nmap <A-h>
n  <M-h>       * <Cmd>lua require("tmux").move_left()<CR>

:nmap <A-l>
n  <M-h>       * <Cmd>lua require("tmux").move_right()<CR>

:nmap <A-j>
n  <M-h>       * <Cmd>lua require("tmux").move_bottom()<CR>

:nmap <A-k>
n  <M-h>       * <Cmd>lua require("tmux").move_top()<CR>

The problem is not within neovim; it's that I can't disable pane cycling within two terminals (like I shown in first video). Pane cycling is indeed disabled in two neovim buffers (like I shown in second video).

I haven't installed any other plugins recently.

Config:
NVIM v0.7.2
tmux 3.3a

Thank you again!

from tmux.nvim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.