jalvesaq / vimcmdline

Send code to command line interpreter
GNU General Public License v2.0
223 stars 38 forks source link

tmux split appears on vim pane and not on active pane #88

Closed dominik-schwabe closed 4 years ago

dominik-schwabe commented 4 years ago

I use vimcmdline in combination with tmuxinator. On startup i want to create a editor and a pane where i can experiment using vimcmdline. I also want to create the experiment console directly. Following is an example script:

name: test
root: ~/

windows:
  - editor: vim
  - experiments: nvim --cmd "au VimEnter *.py :call VimCmdLineStartApp()" experiments.py

When i use this script the experiment console gets created on the editor pane and not on the experiments pane. I think this is not intended. The reason for this is that the editor pane is the active pane, when the environment is created. This commit uses the TMUX_PANE environment variable to fix this.

jalvesaq commented 4 years ago

It doesn't work. I started editing a Python file. Then:

dominik-schwabe commented 4 years ago

you are right, i thougth it was fixed by the change, but i didn't test this, i look into this

dominik-schwabe commented 4 years ago

i added

let s:cmdline_app_pane = GetTmuxActivePane()

It causes the problem, but it didn't fix it, because it gets send to the vim instance

dominik-schwabe commented 4 years ago

it works now. I tested it with a python and javascript file

jalvesaq commented 4 years ago

It works now. But why did you create the function VimCmdLineSelectionToString()? What bug did you fix with it?

dominik-schwabe commented 4 years ago

i didn't create any function i couldn't find VimCmdLineSelectionToString() in my or the previous commit.

jalvesaq commented 4 years ago

You are right, there is no VimCmdLineSelectionToString() in your commits. I have seen it while looking at the differences between plugin/vimcmdline.vim in my repository and in yours.

I'm going to merge the changes.

jalvesaq commented 4 years ago

It's merged now. But could you, please, tell us why do you still prefer to use a tmux split pane rather than the built-in Neovim terminal?

dominik-schwabe commented 4 years ago
  1. I normally develop in a tmux environment.
  2. I love that you can fullsize a tmux pane.
  3. I use minibufexplorer for switching between open files/buffer. It seems to interact very badly with the neovim terminal (a reason for this could be, that the last commit for this plugin was made in 2013)

If there's a way to fullsize a vim pane temporarily and a plugin like minibufexplorer that allows me better interaction with the terminal (like open a other buffer in the pane where the terminal is and reshow the terminal buffer later when i need it again), then i would instantly switch to the neovim terminal.

jalvesaq commented 4 years ago

I don't know about the minibufexplorer, but I open a buffer in a new tab when I want it full size. I have this in my init.vim:

" Emulate Tmux ^az
function ZoomWindow()
    let cpos = getpos(".")
    tabnew %
    redraw
    call cursor(cpos[1], cpos[2])
    normal! zz
endfunction
nmap gz :call ZoomWindow()<CR>
dominik-schwabe commented 4 years ago

thank you this is awesome, i definitely put this in my resource