From 920ef1fd71482d078cd095f68fd5f58cb22b0f33 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Mon, 18 Mar 2024 20:33:35 +0100 Subject: [PATCH] vim-patch:ef21bcaab145 runtime(rust): Respect no_plugin_maps and no_rust_maps globals (vim/vim#14221) https://github.com/vim/vim/commit/ef21bcaab145d6b22fb7c823607de23700f82653 Co-authored-by: MyyPo <110892040+MyyPo@users.noreply.github.com> --- runtime/ftplugin/rust.vim | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/runtime/ftplugin/rust.vim b/runtime/ftplugin/rust.vim index 7f1a86ea95023d..fb15b444d008c8 100644 --- a/runtime/ftplugin/rust.vim +++ b/runtime/ftplugin/rust.vim @@ -1,7 +1,7 @@ " Language: Rust " Description: Vim ftplugin for Rust " Maintainer: Chris Morgan -" Last Change: 2023-09-11 +" Last Change: 2024-03-17 " For bugs, patches and license go to https://github.com/rust-lang/rust.vim if exists("b:did_ftplugin") @@ -94,14 +94,15 @@ if has('conceal') && get(g:, 'rust_conceal', 0) endif " Motion Commands {{{1 - -" Bind motion commands to support hanging indents -nnoremap [[ :call rust#Jump('n', 'Back') -nnoremap ]] :call rust#Jump('n', 'Forward') -xnoremap [[ :call rust#Jump('v', 'Back') -xnoremap ]] :call rust#Jump('v', 'Forward') -onoremap [[ :call rust#Jump('o', 'Back') -onoremap ]] :call rust#Jump('o', 'Forward') +if !exists("g:no_plugin_maps") && !exists("g:no_rust_maps") + " Bind motion commands to support hanging indents + nnoremap [[ :call rust#Jump('n', 'Back') + nnoremap ]] :call rust#Jump('n', 'Forward') + xnoremap [[ :call rust#Jump('v', 'Back') + xnoremap ]] :call rust#Jump('v', 'Forward') + onoremap [[ :call rust#Jump('o', 'Back') + onoremap ]] :call rust#Jump('o', 'Forward') +endif " Commands {{{1 @@ -176,12 +177,12 @@ let b:undo_ftplugin = " \|delcommand -buffer RustInfoToClipboard \|delcommand -buffer RustInfoToFile \|delcommand -buffer RustTest - \|nunmap [[ - \|nunmap ]] - \|xunmap [[ - \|xunmap ]] - \|ounmap [[ - \|ounmap ]] + \|silent! nunmap [[ + \|silent! nunmap ]] + \|silent! xunmap [[ + \|silent! xunmap ]] + \|silent! ounmap [[ + \|silent! ounmap ]] \|setlocal matchpairs-=<:> \|unlet b:match_skip \"