10

So I searched the web far and wide and I can not for the life of me figure out how to do this.

I have the following key binding:

nnoremap <leader>o :below 10sp term://.//$SHELL <cr> :set winfixheight <cr> i

Which works initially and if I open horizontal splits above the :term but if I open anything below the :term, fzf for example the :term resizes once I close the fzf window.

I know the above is a bit difficult to understand so I have attached a gif trying to demonstrate.

enter image description here

7
  • have you tried something with autocommands ? see vimdoc.sourceforge.net/htmldoc/autocmd.html
    – nobe4
    Apr 19, 2016 at 8:42
  • @Nobe4 I have used autocmd before but I am not sure how I would use them is this case? Apr 19, 2016 at 9:02
  • 2
    My first guess would be to trigger a custom function on each resizing (e.g. WinEnter, WinLeave, but others may be more suitable) that apply :resize 60 to the desired split. Or maybe with the 'winheight' option.
    – nobe4
    Apr 19, 2016 at 9:06
  • Hey @Nobe4 any idea how I would target that window/split specifically I have looked at setting a custom ID but I can't quite seem to get it working. Apr 19, 2016 at 9:27
  • Not a true solution, and won't apply in all cases, but I find myself reflexively doing <C-a>_ from the split you want to fix. Resolves the issue for me, but would love a real solution, so I wouldn't have to do this. May 16, 2020 at 17:37

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.