One thing interests me. If one were want to map a mapping specific to some buffer, one can go either way
a) do it with
nnoremap <buffer> d dd
b) or with
nnoremap <localleader>d dd
which will effectively, because localleader is specific to that buffer, make that mapping specific to that buffer too.
That in a way, seems like two overlapping ways to do one same thing. Is there a reason for using one way instead of the other? Is one way preffered over the other for some reason maybe?
As far as I can tell maplocalleader
is shared between buffers. This means that your second map would not be specific to a buffer.
Really, if you're defining a map that is specific to a buffer (e.g. the map only pertains to a specific filetype) I believe convention is to use both <buffer>
and <localleader>
. If you're defining a map that is not specific to a buffer you should just use <leader>
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With