]> git.rmz.io Git - dotfiles.git/commitdiff
vim: set g:mapleader instead of remapping <space>
authorSamir Benmendil <me@rmz.io>
Mon, 10 Apr 2023 22:36:29 +0000 (23:36 +0100)
committerSamir Benmendil <me@rmz.io>
Tue, 31 Oct 2023 23:08:51 +0000 (23:08 +0000)
This is technically the correct way, I used the remap before to support
both <space> and the default \ as leader keys.

Remapping interferes with nvim's which-key though. It's just a warning
and I'm not sure if it actually causes features to break. I'm only
setting mapleader for now to silence this.

I think the mapping was also convenient to be able to map \<key> ad hoc
rather than use <space><key> or something. We'll deal with this later.

vim/vimrc

index 2f0a7ca67a91004a32f72207d6ede9133fa07df8..5f0dea313f1de9c5b23c7a44790b004185c5690c 100644 (file)
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -1,6 +1,9 @@
 " force python3
 if has('python3') | endif
 
+" space is leader
+let g:mapleader = " "
+
 " runtimepath {{{1
 set runtimepath ^=$XDG_CONFIG_HOME/vim
 set runtimepath +=$XDG_CONFIG_HOME/vim/after
@@ -422,9 +425,6 @@ command! ToggleAutoChecktime let b:autochecktime=!get(b:, 'autochecktime', 0) |
 
 " bindings {{{1
 
-" allow both <space> and \ to be <leader>
-map <space> <leader>
-
 " make
 function! MakeWithOpt()
   " TODO only do this if makeprg matches make