Neovim plugin to use NORMAL and CMDLINE modes with Russian keyboard layout.
With this plugin you can avoid switching between Russian/English keyboard layouts when you need to enter:
- almost any command in NORMAL mode;
- frequently used (it's configurable) command in Command-line mode.
-
Supported Neovim versions: 0.9+.
-
Supported Russian keyboard layouts: ЙЦУКЕН.
-
Support all NORMAL mode keys except (keys are shown in English layout):
Key English layout Russian layout Shift- \|- to screen column [count] in the current line/- search forward//- search forward.- repeat last changeShift- /?- search backward,- repeat latest f, t, F or T in opposite directionShift- 2@- execute the contents of register"- use {register} for next delete, yank or putShift- 4$- to the end of the line;- repeat latest f, t, F or T [count] timesShift- 6^- to the first non-blank character of the line:- command-line modeShift- 7&- repeat last substitute?- search backward -
Support user-provided global mappings. Neovim global default-mappings are enabled by default:
Y-defaultv_Q-defaultgc-default v_gc-default o_gc-defaultgcc-default]d-default[d-defaultCTRL-W_d-defaultK-lsp-default
-
Support user-provided command-line mode commands. These commands are enabled by default:
bdbnqqawwqwqa
Install the plugin with your preferred package manager:
return {
'powerman/ruscmd.nvim',
opts = {
-- Your configuration here, if any.
},
}You should call setup() to start using the plugin (package managers configured as shown
above will do this for you).
require('ruscmd').setup {
-- Your configuration here, if any.
}local defaults = {
cabbrev = { 'bd', 'bn', 'q', 'qa', 'w', 'wq', 'wqa' },
map = { -- :help default-mappings
n = { 'Y', 'gc', 'gcc', ']d', '[d', '<C-W>d', 'K' },
v = {},
x = { 'Q', 'gc' },
s = {},
o = { 'gc' },
i = {},
l = {},
c = {},
t = {},
},
}Example. Add more commands and global mappings:
require('ruscmd').setup {
cabbrev = { 'tabnew', 'Lazy' },
map = {
n = { 'sa', ']c', '[c' },
},
}Example. Disable default commands and global mappings:
require('ruscmd').setup {
replace = true, -- If true then user-provided keys will replace defaults for these keys.
cabbrev = {},
map = {
n = {},
x = {},
o = {},
},
}Just do not switch from Russian to English keyboard layout in most cases.
If simple commands without args like :й (:q) does not work then most likely
reason is a conflict between cabbrev used by this plugin and cnoremap <CR>
used by some other plugin (e.g. one implementing completions for the command-line mode).
The right fix is to ask that other plugin author to change cnoremap <CR> to cmap <CR>.
Sometimes you can work around this in your nvim config, see
example for nvim-cmp.
- Why do we need such a plugin: neovim/neovim#27776.
- Similar plugin for Vim: https://github.com/powerman/vim-plugin-ruscmd.
- Alternative plugin for Neovim: https://github.com/Wansmer/langmapper.nvim.