Switching Key Map to Insert Normal Mode in Neovim (NvChad) while Keeping QWERTY Mapping
For those who are familiar with Vim's alternate keyboard layout in insert mode, they might want to switch to the ordinary QWERTY mapping while keeping the same functionality in Normal mode. This article will focus on achieving this effect in Neovim, specifically with the NvChad plugin.
Why use QWERTY Mapping in Normal Mode?
One of the main reasons for using QWERTY mapping in Normal mode is that it is the standard keyboard layout. This means that it is easier for newcomers to Vim or Neovim to get started as they won't have to learn a new keyboard layout. Additionally, it can be easier to switch between different text editors or applications if you're using the same keyboard layout.
Setting up NvChad
NvChad is a configuration layer for Neovim that provides a development environment with features such as tree-sitter, telescope, and lspconfig. To get started with NvChad, you can follow the installation instructions on their GitHub page here.
Mapping QWERTY to Normal Mode
To map QWERTY to Normal mode, we will need to create a new mapping for each key that we want to use in Normal mode. For example, to map the 'j' key to the 'j' motion in Normal mode, we would add the following line to our configuration:
nnoremap j jThis will map the 'j' key to the 'j' motion in Normal mode, allowing us to move down one line. We would need to add similar mappings for each key that we want to use in Normal mode.
Mapping Insert Mode to QWERTY
Since we want to keep the QWERTY mapping in Insert mode, we won't need to create any new mappings. Instead, we can use Vim's default behavior of using the QWERTY layout in Insert mode.
Testing the New Mapping
To test the new mapping, we can open a new file in Neovim and switch to Normal mode using the Esc key. We can then use the 'j' key to move down one line. If everything is set up correctly, we should be able to move down one line using the 'j' key in Normal mode while still using the QWERTY layout in Insert mode.
Summary and References
- NvChad: https://github.com/NvChad/NvChad
- Vim Mappings: https://vimhelp.org/map.txt.html#mapping
In this article, we covered how to switch the key map to Insert Normal Mode in Neovim (NvChad) while keeping the QWERTY mapping. This can be useful for those who are familiar with Vim's alternate keyboard layout in insert mode but prefer the QWERTY layout in Normal mode. We also provided detailed instructions for setting up NvChad and mapping the QWERTY layout to Normal mode. Finally, we tested the new mapping and included a summary and references for further reading.