From 82b02ae2f2af439a8c678ed6b55a43121055f279 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Sat, 12 Oct 2024 11:23:31 +0200 Subject: [PATCH] fix(runtime): clean up one-off scripts Problem: Some runtime files no longer spark joy. Solution: Kondo the place up. Still sparks _some_ joy (moved to new `runtime/scripts` folder): * `macros/less.*` * `mswin.vim` * `tools/emoji_list.lua` No longer sparks joy (removed): * `macmap.vim` (gvimrc file; not useful in Nvim) * `tools/check_colors.vim` (no longer useful with new default colorscheme and treesitter) * `macros/editexisting.vim` (throws error on current Nvim) * `macros/justify.vim` (obsolete shim for `packadd! justify`) * `macros/matchit.vim` (same) * `macros/shellmenu.vim` (same) * `macros/swapmous.vim` (same) --- runtime/CMakeLists.txt | 2 +- runtime/autoload/README.txt | 2 +- runtime/autoload/paste.vim | 2 +- runtime/colors/README.txt | 3 - runtime/doc/builtin.txt | 2 +- runtime/doc/various.txt | 4 +- runtime/doc/vim_diff.txt | 4 + runtime/ftplugin/ada.vim | 2 +- runtime/ftplugin/erlang.vim | 2 +- runtime/ftplugin/plaintex.vim | 2 +- runtime/ftplugin/spec.vim | 2 +- runtime/ftplugin/tex.vim | 2 +- runtime/lua/vim/_meta/vimfn.lua | 2 +- runtime/macmap.vim | 75 ------- runtime/macros/editexisting.vim | 119 ---------- runtime/macros/justify.vim | 3 - runtime/macros/matchit.vim | 2 - runtime/macros/shellmenu.vim | 3 - runtime/macros/swapmous.vim | 3 - runtime/{tools => scripts}/emoji_list.lua | 0 runtime/{macros => scripts}/less.bat | 4 +- runtime/{macros => scripts}/less.sh | 4 +- runtime/{macros => scripts}/less.vim | 0 runtime/{ => scripts}/mswin.vim | 0 runtime/tools/check_colors.vim | 252 ---------------------- src/nvim/eval.lua | 2 +- 26 files changed, 21 insertions(+), 477 deletions(-) delete mode 100644 runtime/macmap.vim delete mode 100644 runtime/macros/editexisting.vim delete mode 100644 runtime/macros/justify.vim delete mode 100644 runtime/macros/matchit.vim delete mode 100644 runtime/macros/shellmenu.vim delete mode 100644 runtime/macros/swapmous.vim rename runtime/{tools => scripts}/emoji_list.lua (100%) rename runtime/{macros => scripts}/less.bat (51%) rename runtime/{macros => scripts}/less.sh (74%) rename runtime/{macros => scripts}/less.vim (100%) rename runtime/{ => scripts}/mswin.vim (100%) delete mode 100644 runtime/tools/check_colors.vim diff --git a/runtime/CMakeLists.txt b/runtime/CMakeLists.txt index c171fab9e9..9f108b4df4 100644 --- a/runtime/CMakeLists.txt +++ b/runtime/CMakeLists.txt @@ -118,4 +118,4 @@ foreach(D ${RUNTIME_DIRS}) endforeach() # only foo.sh script in runtime/ -install_helper(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/macros/less.sh DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/nvim/runtime/macros/) +install_helper(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/scripts/less.sh DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/nvim/runtime/scripts/) diff --git a/runtime/autoload/README.txt b/runtime/autoload/README.txt index 3b18d3dde5..bca86a2a4c 100644 --- a/runtime/autoload/README.txt +++ b/runtime/autoload/README.txt @@ -7,7 +7,7 @@ gzip.vim for editing compressed files netrw*.vim browsing (remote) directories and editing remote files tar.vim browsing tar files zip.vim browsing zip files -paste.vim common code for mswin.vim, menu.vim and macmap.vim +paste.vim common code for mswin.vim and menu.vim spellfile.vim downloading of a missing spell file Omni completion files: diff --git a/runtime/autoload/paste.vim b/runtime/autoload/paste.vim index 1ba336c2b3..84d4d77401 100644 --- a/runtime/autoload/paste.vim +++ b/runtime/autoload/paste.vim @@ -4,7 +4,7 @@ " Former Maintainer: Bram Moolenaar " Define the string to use for items that are present both in Edit, Popup and -" Toolbar menu. Also used in mswin.vim and macmap.vim. +" Toolbar menu. Also used in mswin.vim. let paste#paste_cmd = {'n': ":call paste#Paste()"} let paste#paste_cmd['v'] = '"-c' . paste#paste_cmd['n'] diff --git a/runtime/colors/README.txt b/runtime/colors/README.txt index bc6b8f0965..7a13312ed2 100644 --- a/runtime/colors/README.txt +++ b/runtime/colors/README.txt @@ -84,9 +84,6 @@ The default color settings can be found in the source file If you think you have a color scheme that is good enough to be used by others, please check the following items: -- Source the $VIMRUNTIME/colors/tools/check_colors.vim script to check for - common mistakes. - - Does it work in a color terminal as well as in the GUI? Is it consistent? - Is "g:colors_name" set to a meaningful value? In case of doubt you can do diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt index 8916c434e7..1022565b87 100644 --- a/runtime/doc/builtin.txt +++ b/runtime/doc/builtin.txt @@ -8702,7 +8702,7 @@ setcellwidths({list}) *setcellwidths()* To clear the overrides pass an empty {list}: >vim call setcellwidths([]) -< You can use the script $VIMRUNTIME/tools/emoji_list.lua to see +< You can use the script $VIMRUNTIME/scripts/emoji_list.lua to see the effect for known emoji characters. Move the cursor through the text to check if the cell widths of your terminal match with what Vim knows about each emoji. If it doesn't diff --git a/runtime/doc/various.txt b/runtime/doc/various.txt index 33da539c66..52e38a9872 100644 --- a/runtime/doc/various.txt +++ b/runtime/doc/various.txt @@ -548,9 +548,9 @@ gO Show a filetype-specific, navigable "outline" of the If you use the less or more program to view a file, you don't get syntax highlighting. Thus you would like to use Vim instead. You can do this by -using the shell script "$VIMRUNTIME/macros/less.sh". +using the shell script "$VIMRUNTIME/scripts/less.sh". -This shell script uses the Vim script "$VIMRUNTIME/macros/less.vim". It sets +This shell script uses the Vim script "$VIMRUNTIME/scripts/less.vim". It sets up mappings to simulate the commands that less supports. Otherwise, you can still use the Vim commands. diff --git a/runtime/doc/vim_diff.txt b/runtime/doc/vim_diff.txt index 137e78801b..d032baf55c 100644 --- a/runtime/doc/vim_diff.txt +++ b/runtime/doc/vim_diff.txt @@ -801,6 +801,10 @@ Plugins: - logiPat - rrhelper - *vimball* +- macmap.vim +- tools/check_colors.vim +- macros/{justify,matchit,shellmenu,swapmous}.vim: use `packadd! justify` etc. + directly Providers: diff --git a/runtime/ftplugin/ada.vim b/runtime/ftplugin/ada.vim index 688d912126..50e1388c80 100644 --- a/runtime/ftplugin/ada.vim +++ b/runtime/ftplugin/ada.vim @@ -103,7 +103,7 @@ endif if !exists ("b:match_words") && \ exists ("loaded_matchit") " - " The following lines enable the macros/matchit.vim plugin for + " The following lines enable the matchit.vim plugin for " Ada-specific extended matching with the % key. " let s:notend = '\%(\vim --- call setcellwidths([]) --- ---- -" Last Change: Thu Mar 09 09:00 AM 2006 EST -" -" Define Mac-standard keyboard shortcuts. - -" We don't change 'cpoptions' here, because it would not be set properly when -" a .vimrc file is found later. Thus don't use line continuation and use -" in mappings. - -nnoremap :confirm enew -vmap gv -imap -cmap -omap - -nnoremap :browse confirm e -vmap gv -imap -cmap -omap - -nnoremap :if winheight(2) < 0 confirm enew else confirm close endif -vmap gv -imap -cmap -omap - -nnoremap :if expand("%") == ""browse confirm w elseconfirm wendif -vmap gv -imap -cmap -omap - -nnoremap :browse confirm saveas -vmap gv -imap -cmap -omap - -" From the Edit menu of SimpleText: -nnoremap u -vmap gv -imap -cmap -omap - -vnoremap "+x - -vnoremap "+y - -cnoremap - -nnoremap "+gP -cnoremap + -execute 'vnoremap