From ef458d9a1c8b511a1e0bd1e9a101d94536d029d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yasuhiro=20=D0=AF=D1=88=D0=B0=20Asaka?= Date: Thu, 9 Feb 2023 10:22:20 +0900 Subject: [PATCH 1/2] Suppress unmap errors at undo_ftplugin This change is needed because nmap/vmap are both conditionally set only if those mappings aren't set yet by others. So, if these buffer local mappings are not set, then an error occurs on unloading of this plugin, since they don't exist. Let's suppress them. --- ftplugin/racket.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ftplugin/racket.vim b/ftplugin/racket.vim index 551084d..ae66e8b 100644 --- a/ftplugin/racket.vim +++ b/ftplugin/racket.vim @@ -77,6 +77,6 @@ endif let b:undo_ftplugin = \ "setl iskeyword< lispwords< lisp< comments< formatoptions<" \. "| setl makeprg< commentstring<" - \. "| nunmap K" - \. "| vunmap K" + \. "| silent! nunmap K" + \. "| silent! vunmap K" \. "| unlet! b:browsefilter" From 32d9d12bd3cadd8a2f042733095e746a21a2d242 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yasuhiro=20=D0=AF=D1=88=D0=B0=20Asaka?= Date: Fri, 10 Feb 2023 07:17:43 +0900 Subject: [PATCH 2/2] Add unmappings to be evaluated by execute command --- ftplugin/racket.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ftplugin/racket.vim b/ftplugin/racket.vim index ae66e8b..cc11c6c 100644 --- a/ftplugin/racket.vim +++ b/ftplugin/racket.vim @@ -77,6 +77,6 @@ endif let b:undo_ftplugin = \ "setl iskeyword< lispwords< lisp< comments< formatoptions<" \. "| setl makeprg< commentstring<" - \. "| silent! nunmap K" - \. "| silent! vunmap K" + \. "| silent! execute 'nunmap K'" + \. "| silent! execute 'vunmap K'" \. "| unlet! b:browsefilter"