Created
September 30, 2023 00:36
-
-
Save wolandark/6af85607ee26055bb519ac69d03edb07 to your computer and use it in GitHub Desktop.
Settings for using an alternative keymapping in Vim
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let g:alt_keymap = 'persian' " Change to your prefered keymap located at $VIMRUNTIME/keymap/ | |
let g:alt_enabled = 1 | |
function! CallToggleKeymap() | |
if g:alt_enabled | |
call ToggleKeymap() | |
endif | |
endfunction | |
function! ToggleKeymap() | |
if &keymap == '' | |
execute 'setlocal keymap=' . g:alt_keymap | |
silent !echo -ne "\033]12;cyan\007" | |
redraw! | |
autocmd VimLeave * silent !echo -ne "\033]112\007" | |
else | |
set keymap= | |
silent !echo -ne "\033]112\007" | |
redraw! | |
endif | |
endfunction | |
command! SwitchKeymap call CallToggleKeymap() | |
function! ListKeymapFiles() | |
:Explore $VIMRUNTIME/keymap/ | |
endfunction | |
" Optionally create custom key mappings to SwitchKeymap command |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
keymap-2023-09-30_05.36.13.mp4