" The (neo)vim function that takes care of navigation within vim. " Same concept as vim-tmux-navigator. If we navigate in the wanted " direction and the winnr() hasn't changed, then we are at the edge " and should forward the navigation to the window manager. function! NvimYabaiNavigate(yabai_direction, vim_direction) let win_nr_before = winnr() execute("wincmd " . a:vim_direction) if win_nr_before ==# winnr() call system("yabai -m window --focus " . a:yabai_direction) endif endfunction