New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow replacing SpaceVim mappings with custom mappings #100

Closed
BenBergman opened this Issue Jan 12, 2017 · 3 comments

Comments

Projects
None yet
3 participants
@BenBergman

BenBergman commented Jan 12, 2017

Expected behavior, english is recommend

When adding mappings to my ~/.SpaceVim.d/init.vim, they get clobbered by mappings made in ~/.SpaceVim/autoload/SpaceVim/plugins.vim. I would like to disable some of the mappings in SpaceVim without having to modify files in the SpaceVim repository.

Looking at .SpaceVim/config/main.vim, .SpaceVim.d/init.vim is loaded during the call to SpaceVim#loadCustomConfig() and ~/.SpaceVim/autoload/SpaceVim/plugins.vim is loaded in the next step, SpaceVim#end(). Previously I was using spf13 for my vim configuration and they solved this problem by having one custom file that was loaded before the main files and one that was loaded after.

Environment Information

  • OS: Arch Linux
  • vim version: n/a
  • neovim version: NVIM 0.1.7

The reproduce ways from Vim starting (Required!)

Add the following line to ~/.SpaceVim.d/init.vim

nmap <C-l> <C-w>l

Press <C-l> in normal mode and it will try to run :Ydc instead of switching panes.

@wsdjeg wsdjeg added the question label Jan 12, 2017

@wsdjeg

This comment has been minimized.

Show comment
Hide comment
@wsdjeg

wsdjeg Jan 12, 2017

Member

I think you can use autocmd. SpaceVim has some lazy load config for mappings.
add this to your custom config

augroup custom_config
    au!
    au VimEnter * call s:customMappings()
augroup END
func s:customMappings()
     nnoremap <C-l> <C-w>l
endf
Member

wsdjeg commented Jan 12, 2017

I think you can use autocmd. SpaceVim has some lazy load config for mappings.
add this to your custom config

augroup custom_config
    au!
    au VimEnter * call s:customMappings()
augroup END
func s:customMappings()
     nnoremap <C-l> <C-w>l
endf
@AlphaLiu

This comment has been minimized.

Show comment
Hide comment
@AlphaLiu

AlphaLiu Jan 13, 2017

custom config is your ~/.local.vim

AlphaLiu commented Jan 13, 2017

custom config is your ~/.local.vim

@wsdjeg

This comment has been minimized.

Show comment
Hide comment
@wsdjeg

wsdjeg Jan 13, 2017

Member

@AlphaLiu
I just support ~/.SpaceVim.d/init.vim

Member

wsdjeg commented Jan 13, 2017

@AlphaLiu
I just support ~/.SpaceVim.d/init.vim

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment