]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
runtime(misc): use :hor :term to ensure new term window is split horizontally
authorphanium <91544758+phanen@users.noreply.github.com>
Wed, 23 Jul 2025 19:01:40 +0000 (21:01 +0200)
committerChristian Brabandt <cb@256bit.org>
Wed, 23 Jul 2025 19:01:40 +0000 (21:01 +0200)
Problem:  :term splits new window above in vim, but in nvim it change
          the buffer for current window
Solution: :hor term to ensure consistent splitting for Vim and Neovim

closes: #17822

Signed-off-by: phanium <91544758+phanen@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
runtime/ftplugin/gpg.vim
runtime/ftplugin/modconf.vim
runtime/ftplugin/muttrc.vim
runtime/ftplugin/ps1.vim
runtime/ftplugin/readline.vim
runtime/ftplugin/sh.vim
runtime/ftplugin/sshconfig.vim
runtime/ftplugin/sudoers.vim
runtime/ftplugin/udevrules.vim
runtime/ftplugin/zsh.vim

index bb4e0c9a19ed7e3b1215cfbd3cde62dc484a8dc2..82ba10e679de0aea321fd89cd83efe5d2e1dd009 100644 (file)
@@ -1,7 +1,8 @@
 " Vim filetype plugin file
 " Language:             gpg(1) configuration file
+" Maintainer:           This runtime file is looking for a new maintainer.
 " Previous Maintainer:  Nikolai Weibull <now@bitwi.se>
-" Latest Revision:      2024-09-19 (simplify keywordprg #15696)
+" Latest Revision:      2025-07-22 (use :hor term #17822)
 
 if exists("b:did_ftplugin")
   finish
@@ -17,7 +18,7 @@ setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql
 
 if has('unix') && executable('less') && exists(':terminal') == 2
   command -buffer -nargs=1 GpgKeywordPrg
-        \ silent exe ':term ' . 'env LESS= MANPAGER="less --pattern=''' . escape('^\s+--' . <q-args> . '\b', '\') . ''' --hilite-search" man ' . 'gpg'
+        \ silent exe ':hor term ' . 'env LESS= MANPAGER="less --pattern=''' . escape('^\s+--' . <q-args> . '\b', '\') . ''' --hilite-search" man ' . 'gpg'
   setlocal iskeyword+=-
   setlocal keywordprg=:GpgKeywordPrg
   let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc -buffer GpgKeywordPrg'
index 68ce69a446ff8c5eabff40cae6714dff36b121ef..58435525349738969cde678ef29b80d51543b9cd 100644 (file)
@@ -2,7 +2,7 @@
 " Language:             modules.conf(5) configuration file
 " Maintainer:           This runtime file is looking for a new maintainer.
 " Previous Maintainer:  Nikolai Weibull <now@bitwi.se>
-" Latest Revision:      2024-09-20 (remove erroneous endif)
+" Latest Revision:      2025-07-22 (use :hor term #17822)
 
 if exists("b:did_ftplugin")
   finish
@@ -19,7 +19,7 @@ setlocal formatoptions-=t formatoptions+=croql
 
 if has('unix') && executable('less') && exists(':terminal') == 2
   command -buffer -nargs=1 ModconfKeywordPrg
-        \ silent exe ':term ' . 'env LESS= MANPAGER="less --pattern=''' . escape('^\s{,8}' . <q-args> . '\b', '\') . ''' --hilite-search" man ' . 'modprobe.d'
+        \ silent exe ':hor term ' . 'env LESS= MANPAGER="less --pattern=''' . escape('^\s{,8}' . <q-args> . '\b', '\') . ''' --hilite-search" man ' . 'modprobe.d'
   setlocal iskeyword+=-
   setlocal keywordprg=:ModconfKeywordPrg
   let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc -buffer ModconfKeywordPrg'
index 7df61580bf332c15b5432c0e085f12f4b8bfa30e..84dfd63fc241db49944d1858f33c4d2bdc9b271c 100644 (file)
@@ -1,7 +1,8 @@
 " Vim filetype plugin file
 " Language:             mutt RC File
+" Maintainer:           This runtime file is looking for a new maintainer.
 " Previous Maintainer:  Nikolai Weibull <now@bitwi.se>
-" Latest Revision:      2024-09-19 (simplify keywordprg #15696)
+" Latest Revision:      2025-07-22 (use :hor term #17822)
 
 if exists("b:did_ftplugin")
   finish
@@ -20,7 +21,7 @@ let &l:include = '^\s*source\>'
 
 if has('unix') && executable('less') && exists(':terminal') == 2
   command -buffer -nargs=1 MuttrcKeywordPrg
-        \ silent exe 'term ' . 'env LESS= MANPAGER="less --pattern=''' . escape('^\s+' . <q-args> . '\b', '\') . ''' --hilite-search" man ' . 'muttrc'
+        \ silent exe 'hor term ' . 'env LESS= MANPAGER="less --pattern=''' . escape('^\s+' . <q-args> . '\b', '\') . ''' --hilite-search" man ' . 'muttrc'
   setlocal iskeyword+=-
   setlocal keywordprg=:MuttrcKeywordPrg
   let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc -buffer MuttrcKeywordPrg'
index e09bbf86dca9ed304f978d41e7f354401fb130b5..f1fe78df4c4126bd1403cef6c639b6748b7558cf 100644 (file)
@@ -5,6 +5,7 @@
 "              2024 Jan 14 by Vim Project (browsefilter)
 "              2024 May 23 by Riley Bruins <ribru17@gmail.com> ('commentstring')
 "              2024 Sep 19 by Konfekt (simplify keywordprg #15696)
+"              2025 Jul 22 by phanium (use :hor term #17822)
 
 " Only do this when not done yet for this buffer
 if exists("b:did_ftplugin") | finish | endif
@@ -51,7 +52,7 @@ endif
 
 if exists('s:pwsh_cmd')
   if exists(':terminal') == 2
-    command! -buffer -nargs=1 GetHelp silent exe 'term ' . s:pwsh_cmd . ' -NoLogo -NoProfile -NonInteractive -ExecutionPolicy RemoteSigned -Command Get-Help -Full "<args>"' . (executable('less') ? ' | less' : '')
+    command! -buffer -nargs=1 GetHelp silent exe 'hor term ' . s:pwsh_cmd . ' -NoLogo -NoProfile -NonInteractive -ExecutionPolicy RemoteSigned -Command Get-Help -Full "<args>"' . (executable('less') ? ' | less' : '')
   else
     command! -buffer -nargs=1 GetHelp echo system(s:pwsh_cmd . ' -NoLogo -NoProfile -NonInteractive -ExecutionPolicy RemoteSigned -Command Get-Help -Full <args>')
   endif
index 77fab2a61176d8d7c5e8a318eea7dff6bdd4f74e..d0b6c2d65445b77f4776da2733107a4dd2049144 100644 (file)
@@ -3,6 +3,7 @@
 " Maintainer:          Doug Kearns <dougkearns@gmail.com>
 " Previous Maintainer: Nikolai Weibull <now@bitwi.se>
 " Last Change:         2024 Sep 19 (simplify keywordprg #15696)
+" 2024 Jul 22 by Vim project (use :hor term #17822)
 
 if exists("b:did_ftplugin")
   finish
@@ -36,7 +37,7 @@ endif
 
 if has('unix') && executable('less') && exists(':terminal') == 2
   command -buffer -nargs=1 ReadlineKeywordPrg
-        \ silent exe 'term ' . 'env LESS= MANPAGER="less --pattern=''' . escape('^\s+' . <q-args> . '\b', '\') . ''' --hilite-search" man ' . '3 readline'
+        \ silent exe 'hor term ' . 'env LESS= MANPAGER="less --pattern=''' . escape('^\s+' . <q-args> . '\b', '\') . ''' --hilite-search" man ' . '3 readline'
   setlocal iskeyword+=-
   setlocal keywordprg=:ReadlineKeywordPrg
   let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc -buffer ReadlineKeywordPrg'
index 0038ee7dd436184b74d00744a03b1bf52c0b19b1..18cd219cdc0dbb4f38218e521e787faad395a4f5 100644 (file)
@@ -7,6 +7,7 @@
 " Last Change:         2024 Sep 19 by Vim Project (compiler shellcheck)
 "                      2024 Dec 29 by Vim Project (improve setting shellcheck compiler)
 "                      2025 Mar 09 by Vim Project (set b:match_skip)
+"                      2025 Jul 22 by phanium (use :hor term #17822)
 
 if exists("b:did_ftplugin")
   finish
@@ -53,7 +54,7 @@ let s:is_kornshell = get(b:, "is_kornshell", get(g:, "is_kornshell", 0))
 
 if s:is_bash
   if exists(':terminal') == 2
-    command! -buffer -nargs=1 ShKeywordPrg silent exe ':term bash -c "help "<args>" 2>/dev/null || man "<args>""'
+    command! -buffer -nargs=1 ShKeywordPrg silent exe ':hor term bash -c "help "<args>" 2>/dev/null || man "<args>""'
   else
     command! -buffer -nargs=1 ShKeywordPrg echo system('bash -c "help <args>" 2>/dev/null || MANPAGER= man "<args>"')
   endif
index 1cc4e609b00093a4662642a82bfa6c8e9a1868aa..8a7b0783098690beb664bd97374a9cc64dfe5035 100644 (file)
@@ -2,7 +2,7 @@
 " Language:    OpenSSH client configuration file
 " Maintainer:  This runtime file is looking for a new maintainer.
 " Previous Maintainer: Nikolai Weibull <now@bitwi.se>
-" Latest Revision:     2024-09-19 (simplify keywordprg #15696)
+" Latest Revision:     2025-07-22 (use :hor term #17822)
 
 if exists("b:did_ftplugin")
   finish
@@ -17,7 +17,7 @@ let b:undo_ftplugin = 'setlocal com< cms< fo<'
 
 if has('unix') && executable('less') && exists(':terminal') == 2
   command -buffer -nargs=1 SshconfigKeywordPrg
-        \ silent exe 'term ' . 'env LESS= MANPAGER="less --pattern=''' . escape('^\s+' . <q-args> . '$', '\') . ''' --hilite-search" man ' . 'ssh_config'
+        \ silent exe 'hor term ' . 'env LESS= MANPAGER="less --pattern=''' . escape('^\s+' . <q-args> . '$', '\') . ''' --hilite-search" man ' . 'ssh_config'
   setlocal iskeyword+=-
   setlocal keywordprg=:SshconfigKeywordPrg
   let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc -buffer SshconfigKeywordPrg'
index e87fedaa01f487a9af12f837f8842f22b763403b..32c08b19af541dc49b4667bb739256363042276d 100644 (file)
@@ -2,7 +2,7 @@
 " Language:    sudoers(5) configuration files
 " Maintainer:  This runtime file is looking for a new maintainer.
 " Previous Maintainer: Nikolai Weibull <now@bitwi.se>
-" Latest Revision:     2024-09-19 (simplify keywordprg #15696)
+" Latest Revision:     2025-07-22 (use :hor term #17822)
 
 if exists("b:did_ftplugin")
   finish
@@ -18,7 +18,7 @@ setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql
 
 if has('unix') && executable('less') && exists(':terminal') == 2
   command -buffer -nargs=1 SudoersKeywordPrg
-        \ silent exe ':term ' . 'env LESS= MANPAGER="less --pattern=''' . escape('\b' . <q-args> . '\b', '\') . ''' --hilite-search" man ' . 'sudoers'
+        \ silent exe ':hor term ' . 'env LESS= MANPAGER="less --pattern=''' . escape('\b' . <q-args> . '\b', '\') . ''' --hilite-search" man ' . 'sudoers'
   setlocal iskeyword+=-
   setlocal keywordprg=:SudoersKeywordPrg
   let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc -buffer SudoersKeywordPrg'
index e6c7f113c2dd45420db378c9b91ec3b2251cefbc..48f36e3dbe5073c2489769b7050f2765b6a693e1 100644 (file)
@@ -2,7 +2,7 @@
 " Language:    udev(8) rules file
 " Maintainer:  This runtime file is looking for a new maintainer.
 " Previous Maintainer: Nikolai Weibull <now@bitwi.se>
-" Latest Revision:     2024-09-19 (simplify keywordprg #15696)
+" Latest Revision:     2025-07-22 (use :hor term #17822)
 
 if exists("b:did_ftplugin")
   finish
@@ -18,7 +18,7 @@ setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql
 
 if has('unix') && executable('less') && exists(':terminal') == 2
   command -buffer -nargs=1 UdevrulesKeywordPrg
-        \ silent exe ':term ' . 'env LESS= MANPAGER="less --pattern=''' . escape('^\s{,8}' . <q-args> . '\b', '\') . ''' --hilite-search" man ' . 'udev'
+        \ silent exe ':hor term ' . 'env LESS= MANPAGER="less --pattern=''' . escape('^\s{,8}' . <q-args> . '\b', '\') . ''' --hilite-search" man ' . 'udev'
   setlocal iskeyword+=-
   setlocal keywordprg=:UdevrulesKeywordPrg
   let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc -buffer UdevrulesKeywordPrg'
index 5d4f4fe256e5aa3784401a1c6946b405035e9262..65e9f377bf11ab36e4ac08f35cf095d204c4fea4 100644 (file)
@@ -5,6 +5,8 @@
 " Latest Revision:      2024 Sep 19
 " License:              Vim (see :h license)
 " Repository:           https://github.com/chrisbra/vim-zsh
+" Last Change:
+" 2025 Jul 23 by Vim Project (use :hor term #17822)
 
 if exists("b:did_ftplugin")
   finish
@@ -20,7 +22,7 @@ let b:undo_ftplugin = "setl com< cms< fo< "
 
 if executable('zsh') && &shell !~# '/\%(nologin\|false\)$'
   if exists(':terminal') == 2
-    command! -buffer -nargs=1 ZshKeywordPrg silent exe ':term zsh -c "autoload -Uz run-help; run-help <args>"'
+    command! -buffer -nargs=1 ZshKeywordPrg silent exe ':hor term zsh -c "autoload -Uz run-help; run-help <args>"'
   else
     command! -buffer -nargs=1 ZshKeywordPrg echo system('MANPAGER= zsh -c "autoload -Uz run-help; run-help <args> 2>/dev/null"')
   endif