kevinhwang91 / rnvimr

Make Ranger running in a floating window to communicate with Neovim via RPC
BSD 3-Clause "New" or "Revised" License
804 stars 17 forks source link

split the file in four direction #104

Closed kanglcn closed 2 years ago

kanglcn commented 2 years ago

Currently rnvimr support split files in two directions: horizontal and vertical. I want to split the file in four directions: up, down, left, right. In vim, I achieve it by:

set splitright
set splitbelow
nnoremap s <nop>

nnoremap sk :set nosplitbelow<CR>:split<CR>:set splitbelow<CR>
nnoremap sj :split<CR>
nnoremap sh :set nosplitright<CR>:vsplit<CR>:set splitright<CR>
nnoremap sl :vsplit<CR>

I think in rnvimr, it could be achieved by some configuration like:

let g:rnvimr_action = {
      \ '<C-j>': 'NvimEdit split',
      \ '<C-k>': 'NvimEdit set nosplitbelow<CR>split<CR>set splitbelow',
      \ '<C-l>': 'NvimEdit vsplit',
      \ '<C-k>': 'NvimEdit set nosplitright<CR>vsplit<CR>set splitright',
      \ }

But it does not work. Please let me know how to achieve that if you know. Thanks!

kevinhwang91 commented 2 years ago
let g:rnvimr_action = {
      \ '<C-j>': 'NvimEdit split',
      \ '<C-k>': 'NvimEdit rightbelow split',
      \ '<C-l>': 'NvimEdit vsplit',
      \ '<C-k>': 'NvimEdit rightbelow vsplit',
      \ }