obsidian-vimrc-support icon indicating copy to clipboard operation
obsidian-vimrc-support copied to clipboard

Cannot `nnoremap` `t` and `r`, only `map`

Open B4rc1 opened this issue 2 years ago • 2 comments

Hey long time vim user here, As I am on an alternate keyboard with a homerow of hieao dtrns I use these mappings for my vim config:

noremap h d
noremap d h
noremap k r
noremap r k
noremap j t
noremap t j
noremap l n
noremap n l

noremap H D
noremap D H
noremap K R
noremap R K
noremap J T
noremap T J
noremap L N
noremap N L

If I try do use these same mappings using this plugin (or obsidian in general) wierdness happens:

The mappings for h d and n l get swapped correctly, but for t j and r k j and k don't get remapped. j still moves a line down (and does not search for a character as it should) and k still moves up (and does not replace as it should).

It seems like t and r cannot be noremapped, only mapped:

noremap j t
noremap k r

does not work.

map j t
map k r

does, but now the mapping for j and k is gone, making this a non practical workaround.

Am I missing something or is this a bug in Code Mirror?

B4rc1 avatar Oct 12 '21 09:10 B4rc1

related: #16

B4rc1 avatar Oct 12 '21 09:10 B4rc1

Having a similar problem. My movement config looks like:

noremap t j
noremap s k
noremap <C-w>t <C-w>j
noremap <C-w><C-t> <C-w>j
noremap <C-w>s <C-w>k
noremap <C-w><C-s> <C-w>k
noremap n h
noremap e l

noremap k t
noremap K T
noremap h e
noremap H E
noremap l n
noremap L N

Most of this works correctly, but as noted above, the noremap k t does not work. Was there a workaround to noremap targeting t?

michaelolson avatar Jul 06 '22 06:07 michaelolson