GithubHelp home page GithubHelp logo

Comments (6)

rhysd avatar rhysd commented on May 13, 2024

Could you try below each commands while committia windows are shown?

:nmap <C-h>
:nmap <C-j>
:nmap <C-k>
:nmap <C-l>

What was shown in messages area for each commands?

from committia.vim.

tinyheero avatar tinyheero commented on May 13, 2024

I got this:

n  <C-H>       * :TmuxNavigateLeft<CR>
n  <NL>        * :TmuxNavigateDown<CR>
n  <C-K>       * :TmuxNavigateUp<CR>
n  <C-L>       * :TmuxNavigateRight<CR>

I have the plugin Plug 'christoomey/vim-tmux-navigator' that allows for navigation between tmux and vim panes. This might be the reason why it's failing...

from committia.vim.

rhysd avatar rhysd commented on May 13, 2024

Yeah, I think disabling the plugin temporarily would solve this problem. I don't know what actually the plugin does. But I think overwriting mappings only in committia windows as following may solve this problem.

" In .vimrc
function! s:setup_win_move(info)
    nnoremap <buffer><C-h> <C-w>h
    nnoremap <buffer><C-j> <C-w>j
    nnoremap <buffer><C-k> <C-w>k
    nnoremap <buffer><C-l> <C-w>l
endfunction

let g:committia_hooks = {}
let g:committia_hooks.edit_open = function('s:setup_win_move')
let g:committia_hooks.diff_open = function('s:setup_win_move')
let g:committia_hooks.status_open = function('s:setup_win_move')

from committia.vim.

tinyheero avatar tinyheero commented on May 13, 2024

Unfortunately, this didn't work. The issue only surfaces when I am inside a tmux session. I think the issue is in my ~/.tmux.conf I have the following settings:

# Smart pane switching with awareness of vim splits
# recommended by vim-tmux-navigator
is_vim='echo "#{pane_current_command}" | grep -iqE "(^|\/)g?(view|n?vim?)(diff)?$"'
bind -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L"
bind -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D"
bind -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U"
bind -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R"
bind -n C-\ if-shell "$is_vim" "send-keys C-\\" "select-pane -l"

When I remove this, the quick window navigation works inside committia while inside a tmux session. The downside is that I can't use the mappings to navigate tmux panes...

from committia.vim.

rhysd avatar rhysd commented on May 13, 2024

I see. From .vimrc, there is no way to modify tmux config safely. The tmux config captures input sequence from you before Vim receives. Then I think you need to find other mappings like <Space>h, <Space>j, ...

from committia.vim.

tinyheero avatar tinyheero commented on May 13, 2024

Thanks.

from committia.vim.

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.