~razzi/dev-env#3: 
vim terminal nested vim from command line

Rather than opening a file in the first vim editor, running vim from the vim :terminal will open a new vim within it. This vim has conflicts in keybindings and modes with the original one. The solution here is to use some sort of combination of vim server and vim terminal communication: https://vimhelp.org/terminal.txt.html#terminal-api

Status
RESOLVED CLOSED
Submitter
~razzi
Assigned to
No-one
Submitted
1 year, 7 days ago
Updated
5 months ago
Labels
No labels applied.

~razzi REPORTED CLOSED 5 months ago

Much simpler, if vim detects it is in vim terminal, call edit with the filename in the parent vim:

if !empty($VIM_TERMINAL)
  let tapi_args = '["call", "Tapi_TerminalEdit", ["' . argv()[0] . '"]]'
  let escaped_args = '\033]51;' . tapi_args . '\x07'
  execute "!echo -e '" . escaped_args . "'"
endif
Register here or Log in to comment, or comment via email.