Vim and azerty keyboards
Asked Answered
S

3

8

I recently started learning Vim and before I go deeper I have a question I need answered.

Using a AZERTY keyboard, should I remap the keys for the commands and shortcuts to fit the position of the keys of a QWERTY keyboard?

I am asking this because obviously quite a lot of thinking must have being put creating thoses commands, and when I see how far the '$' is on a AZERTY keyboard compared to the QWERTY one for example I can't help but think it might feel wrong at some point.

Here is the AZERTY layout: http://www.nathael.org/Data/vi-vim-cheat-sheet.svg

I don't even know if it will be possible to remap the way I would need, basically only remapping for command input, so I need so opinions from the 'pros' and/or azerty users.

Snub answered 20/10, 2015 at 19:33 Comment(4)
I've been using Vim for 5 years with an AZERTY keyboard and didn't encounter a single issue.Spatial
@Spatial you did not remap anything is that right? Everything is a matter of getting used to in the end then?Snub
just to chime in, i've switched to dvorak about 3 years ago, and haven't looked back. I never changed any of the mappings either. In the end, it's all about muscle memory, so i wouldn't fret too much about remapping stuff if there's no really good reason for itDinnage
I also use vim with azerty, but I changed my keyboard layout a bit to make it more developer friendly: github.com/r03/azertyOrvas
P
4

I also use an azerty keyboard, and I didn't remap the keys in order to fit the qwerty keyboard.

But I take profit of the very easy accessibility of some unused chars, like é, è, à, ç (all the accentuated characters) and have some maps like this:

noremap à @
noremap ç @@
noremap § \

(The last one is so useful that I remapped it outside of Vim, on my linux system-wide keyboard configuration)

But I think that remapping all keys to fit the qwerty keyboard is more a source of confusion, than a good solution.

Perpetuate answered 20/10, 2015 at 19:56 Comment(0)
M
1

I do not know any plugins, or reference for what you ask but I can share what I personally use.

With this you can use the top row symbols of your keyboards to use the numbers without shift ! Very useful and decreases the risk of RSI.

  nnoremap <silent> à 0
  nnoremap <silent> & 1
  nnoremap <silent> é 2
  nnoremap <silent> " 3
  nnoremap <silent> ' 4
  nnoremap <silent> ( 5
  nnoremap <silent> - 6
  nnoremap <silent> è 7
  nnoremap <silent> _ 8
  nnoremap <silent> ç 9

  nnoremap <silent> 0 à
  nnoremap <silent> 1 &
  nnoremap <silent> 2 é
  nnoremap <silent> 3 "
  nnoremap <silent> 4 '
  nnoremap <silent> 5 (
  nnoremap <silent> 6 -
  nnoremap <silent> 7 è
  nnoremap <silent> 8 _
  nnoremap <silent> 9 ç

  nmap <silent> ù `
Muldon answered 21/3 at 13:38 Comment(0)
A
0

My current remapping for AZERTY in ~/.vimrc:

" 1. Move to the end of the line
noremap m $
" 2. Search backward for the word under the cursor
noremap µ #
" 3. Navigate to the help tag under the cursor
noremap ' <C-]>

Further explanations:

  1. I don't use marks, so decided to remap m in normal mode. This is practical since the m key is just after the movement keys hjkl on the AZERTY keyboard.
  2. µ is on the same key as * which searches forward for the word under the cursor. This is a logical choice, similar to n and N for forward and backward searches.
  3. The key ' is actually the result of pressing CTRL-ù in the terminal. This key is next to m on the keyboard. Its use for tag navigation was inspired by two questions here how do i type CTRL ] on a QUERTZ keyboard and on vi.stackexchange tag navigation using CTRL ] does not work.

In addition, I mapped caps lock to escape at a system level (how to do it in debian). I'm not a really experienced vim user so these mappings are likely to change.

Alcala answered 4/6, 2020 at 13:1 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.