Spacevim: Change <leader> key

Created on 30 Apr 2020  ·  2Comments  ·  Source: SpaceVim/SpaceVim

Expected behavior, english is recommend

I would like to change the <leader> key (defaults to "\").
I tried the steps from #170 but it does not work...
Sorry noob

Environment Information

  • OS: linux
  • vim version: -
  • neovim version: 0.3.8
  • SpaceVim version: 1.5.0-dev
  • SpaceVim status:
On branch master
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean

The reproduce ways from Vim starting (Required!)

~/.SpaceVim.d/init.vim:

let mapleader = ';'

Output of the :SPDebugInfo!

SpaceVim debug information

SpaceVim options :

  auto_disable_touchpad = 1
  autocomplete_method = 'deoplete'
  autocomplete_parens = 1
  buffer_index_type = 0
  checkinstall = 1
  colorscheme = 'SpaceVim'
  colorscheme_bg = 'dark'
  colorscheme_default = 'desert'
  commandline_prompt = '➭'
  custom_color_palette = []
  custom_plugins = []
  data_dir = '/home/romain/.cache/'
  debug_level = 1
  default_indent = 2
  disabled_plugins = []
  enable_ale = 0
  enable_bepo_layout = 0
  enable_cursorcolumn = 0
  enable_cursorline = 1
  enable_debug = 0
  enable_googlesuggest = 0
  enable_guicolors = 1
  enable_insert_leader = 1
  enable_javacomplete2_py = 0
  enable_key_frequency = 0
  enable_language_specific_leader = 1
  enable_neocomplcache = 0
  enable_neomake = 1
  enable_os_fileformat_icon = 0
  enable_powerline_fonts = 1
  enable_statusline_bfpath = 0
  enable_statusline_mode = 0
  enable_statusline_tag = 1
  enable_tabline_filetype_icon = 1
  enable_tabline_ft_icon = 0
  enable_vimfiler_filetypeicon = 0
  enable_vimfiler_gitstatus = 0
  enable_vimfiler_welcome = 1
  enable_ycm = 0
  error_symbol = '✖'
  expand_tab = 1
  filemanager = 'vimfiler'
  filetree_direction = 'right'
  filetype_icons = {}
  force_global_config = 0
  gitcommit_issue_icon = ''
  gitcommit_pr_icon = ''
  github_username = ''
  guifont = ''
  hiddenfileinfo = 1
  home_files_number = 6
  hosts_url = 'https://raw.githubusercontent.com/racaljk/hosts/master/hosts'
  info_symbol = 'ⓘ'
  keep_server_alive = 1
  language = ''
  leader_guide_default_group_name = ''
  leader_guide_flatten = 1
  leader_guide_hspace = 5
  leader_guide_max_size = 0
  leader_guide_position = 'botright'
  leader_guide_run_map_on_popup = 1
  leader_guide_sort_horizontal = 0
  leader_guide_submode_mappings = {'<C-C>': 'win_close'}
  leader_guide_vertical = 0
  lint_on_save = 1
  lint_on_the_fly = 0
  max_column = 120
  plugin_bundle_dir = '/home/romain/.cache/vimfiles/'
  plugin_manager = 'dein'
  plugin_manager_processes = 16
  plugin_name = 'vim-jsdoc'
  project_rooter_automatically = 1
  project_rooter_patterns = ['.git/', '_darcs/', '.hg/', '.bzr/', '.svn/', 'Cargo.toml', '.SpaceVim.d/']
  realtime_leader_guide = 1
  relativenumber = 1
  search_tools = ['rg', 'ag', 'pt', 'ack', 'grep', 'findstr']
  sidebar_direction = ''
  sidebar_width = 30
  smartcloseignoreft = ['tagbar', 'vimfiler', 'defx', 'SpaceVimRunner', 'SpaceVimREPL', 'SpaceVimQuickFix', 'HelpDescribe', 'VebuggerShell', 'VebuggerTerminal', 'SpaceVimTabsManager']
  smartcloseignorewin = ['__Tagbar__', 'vimfiler:default']
  snippet_engine = 'neosnippet'
  src_root = 'E:\sources\'
  statusline_inactive_separator = 'arrow'
  statusline_iseparator = 'nil'
  statusline_left_sections = ['winnr', 'filename', 'major mode', 'search count', 'syntax checking', 'minor mode lighters', 'vcs', 'hunks']
  statusline_right_sections = ['fileformat', 'cursorpos', 'percentage']
  statusline_separator = 'arrow'
  statusline_unicode_symbols = 1
  terminal_cursor_shape = 2
  todo_labels = ['@fixme', '@question', '@todo', '@idea']
  update_retry_cnt = 3
  version = '1.5.0-dev'
  vim_help_language = 'en'
  vimcompatible = 0
  warning_symbol = '⚠'
  wildignore = '*/tmp/*,*.so,*.swp,*.zip,*.class,tags,*.jpg,*.ttf,*.TTF,*.png,*/target/*,.git,.svn,.hg,.DS_Store,*.svg'
  windows_index_type = 3
  windows_leader = 'ù'
  windows_smartclose = 'q'

SpaceVim layers :

[[layers]]
  name="autocomplete"
  auto_completion_return_key_behavior='smart'
  auto_completion_tab_key_behavior='complete'
[[layers]]
  name="checkers"
[[layers]]
  name="format"
[[layers]]
  name="edit"
[[layers]]
  name="ui"
[[layers]]
  name="core"
  filetree_show_hidden=1
[[layers]]
  name="core#banner"
[[layers]]
  name="core#statusline"
[[layers]]
  name="core#tabline"
[[layers]]
  name="shell"
  default_position='bottom'
  default_height=30
[[layers]]
  name="VersionControl"
[[layers]]
  name="default"
[[layers]]
  name="colorscheme"
[[layers]]
  name="github"
[[layers]]
  name="gtags"
  gtagslabel='ctags'
[[layers]]
  name="lsp"
  filetypes=['typescript', 'rust']
[[layers]]
  name="lang#typescript"
[[layers]]
  name="lang#rust"
[[layers]]
  name="-l"

SpaceVim Health checking :

SpaceVim clipboard support check report:
Checking +clipboard:
SUCCEED!
SpaceVim environment check report:
Current progpath: nvim(/usr/bin/nvim)
version: 800
OS: linux
SpaceVim lua support check report:
Checking +lua:
Failed : Known issue, neovim do not support lua now.
SpaceVim python support check report:
Checking +python3:
SUCCEED!
Checking +python:
SUCCEED!

SpaceVim runtime log :

[ SpaceVim ] : logger file  does not exists, only log for current process will be shown!
[ SpaceVim ] [19:12:19] [ Info ] Startup with no argv, current dir is used: ~/
[ SpaceVim ] [19:12:19] [ Info ] find local conf: /home/romain/.SpaceVim.d/init.toml
[ SpaceVim ] [19:12:19] [ Info ] loading cached local conf: /home/romain/.cache//SpaceVim/conf/_home_romain__SpaceVim_d_init_toml.json
[ SpaceVim ] [19:12:19] [ Info ] start to apply config [local]
[ SpaceVim ] [19:12:19] [ Info ] Start to find root for: /home/romain/
[ SpaceVim ] [19:12:19] [ Info ]         (.SpaceVim.d/):/home/romain
[ SpaceVim ] [19:12:19] [ Info ] buffer name: 
[ SpaceVim ] [19:12:19] [ Info ] change to root: /home/romain
[ SpaceVim ] [19:12:19] [ Info ] try to open SpaceVim welcome page
[ SpaceVim ] [19:12:19] [ Info ] buffer name: 
[ SpaceVim ] [19:12:19] [ Info ] change to root: /home/romain
[ SpaceVim ] [19:12:23] [ Info ] Start to find root for: /home/romain/.SpaceVim.d/init.toml
[ SpaceVim ] [19:12:23] [ Info ]         (.SpaceVim.d/):/home/romain
[ SpaceVim ] [19:12:23] [ Info ] buffer name: /home/romain/.SpaceVim.d/init.toml
[ SpaceVim ] [19:12:23] [ Info ] change to root: /home/romain
[ SpaceVim ] [19:14:29] [ Info ] Start to find root for: /home/romain/.SpaceVim.d/init.vim
[ SpaceVim ] [19:14:29] [ Info ]         (.SpaceVim.d/):/home/romain
[ SpaceVim ] [19:14:29] [ Info ] buffer name: /home/romain/.SpaceVim.d/init.vim
[ SpaceVim ] [19:14:29] [ Info ] change to root: /home/romain
[ SpaceVim ] [19:27:52] [ Info ] Start to find root for: /home/romain/SpaceVimLayers
[ SpaceVim ] [19:27:52] [ Info ]         (.SpaceVim.d/):/home/romain
[ SpaceVim ] [19:27:52] [ Info ] buffer name: SpaceVimLayers
[ SpaceVim ] [19:27:52] [ Info ] change to root: /home/romain
[ SpaceVim ] [19:28:28] [ Info ] Start to find root for: /tmp/nvimuV1LQ4/2/issue_report.md
[ SpaceVim ] [19:28:28] [ Info ] buffer name: /tmp/nvimuV1LQ4/2/issue_report.md
[ SpaceVim ] [19:28:28] [ Info ] change to root: /home/romain

Screenshots

N/C

Most helpful comment

What you need is the bootstrap functions :

In your ~/.SpaceVim.d/init.toml (this file is in Yaml format, so you could not use let var = ... here, but you can load a config file) :

[options]
bootstrap_after = "config#after"                                                                                 
bootstrap_before = "config#before"

In your ~/.SpaceVim.d/autoload/config.vim (the loaded vim scricpt file where you can define anything you get in your vim.rc legacy file) :

func! config#before() abort
   let g:mapleader  = ';'
   " after this line, when you using <leader> to defind key bindings
   " the leader is ;  for example:
   nnoremap <leader>w :w<cr> " this mapping means using `;w` to save current file.
endf

Note that you need to redefine the leader key in bootstrap_before so all the keys defined by vim use your new leader key :-)

All 2 comments

What you need is the bootstrap functions :

In your ~/.SpaceVim.d/init.toml (this file is in Yaml format, so you could not use let var = ... here, but you can load a config file) :

[options]
bootstrap_after = "config#after"                                                                                 
bootstrap_before = "config#before"

In your ~/.SpaceVim.d/autoload/config.vim (the loaded vim scricpt file where you can define anything you get in your vim.rc legacy file) :

func! config#before() abort
   let g:mapleader  = ';'
   " after this line, when you using <leader> to defind key bindings
   " the leader is ;  for example:
   nnoremap <leader>w :w<cr> " this mapping means using `;w` to save current file.
endf

Note that you need to redefine the leader key in bootstrap_before so all the keys defined by vim use your new leader key :-)

Thanks bro it works!
The other issue is outdated then. Should I link to here?

(Un breton!)

Was this page helpful?
0 / 5 - 0 ratings