I am trying to create a mapping that has 2 functions:
On 1st use: redefine itself to be used
After: execute the newly saved mapping
The workflow could be :
<leader>r
-> map <leader>r dd
<leader>r
-> dd
<leader>r
-> dd
...
So I came up with this mapping :
map <Leader>r :nnoremap <Leader>r
And I get :
<leader>r
-> :nnoremap r
My leader key is \<Space>
and so a space is inserted and now I can trigger the mapping but with only pressing r
.
Do you know a method to "escape" the leader key in a mapping ?