My ideal editing layout would look like this (in Gvim):
----------------------------------------------------------
| | | |
| N | |
| E | | |
| R | Editing Area |
| D |- - - - - - - - - - - - |
| | (various splits, horizontal and/or vertical) |
| T | | |
| r | |
| e | | |
| e |------------------------------------------------|
| | |
| | Terminal window (:terminal) |
| | |
| | |
----------------------------------------------------------
Note in particular:
- I want the terminal window to open at the bottom. Setting
splitbelowmight work for this, but it would affect all splits, not only the terminal window. - I can move the terminal to the bottom with
<C-W>J, but this puts it below NERDTree, requiring me to then toggle NERDTree.
I'm looking to create a mapping that will allow me to open a terminal and place it where indicated in my diagram. Any ideas?
nmap <silent> <leader>s :belowright split terminal<CR>:terminal ++curwin ++close<CR><F2>(note that I'm explicitly using nmap so that I can use my tnoremapCtrl-W J(or equivalent) on the terminal followed byCtrl-W Hon NERDTree rather than try to maneuver things around conditionally. – B Layer Jan 18 '19 at 01:11:wincmd J | wincmd k | wincmd H....or something like that. (of course, you'd only do that conditionally...if there were a split on the left taking up full height). This is probably going to make more sense with a function rather than just in a mapping. Suggest you define very clearly what the "rules" are if you want that answered for y ou. – B Layer Jan 18 '19 at 01:14nmap <silent> <leader>s :wincmd b<CR>\t:belowright split terminal<CR><C-W>J10<C-W>_\t:wincmd b<CR>:terminal ++curwin ++close<CR>, which is good enough for now. (\tis<leader>t, my mapping to toggle NERDTree.) Thanks. – Scott Severance Jan 18 '19 at 01:43