Skip to content
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

init.toml not being applied #4936

Open
tu-andy opened this issue Sep 25, 2024 · 7 comments
Open

init.toml not being applied #4936

tu-andy opened this issue Sep 25, 2024 · 7 comments
Labels
bug bug of SpaceVim core can-not-reproduce Can not reproduce this issue

Comments

@tu-andy
Copy link

tu-andy commented Sep 25, 2024

Expected behavior.

Add layers and config options to $HOME/.SpaceVim.d/init.toml and have them be applied on restart.

The reproduce ways from Vim starting.

  1. install SpaceVim via cURL method (2.4.0-dev as of this report)
  2. start vim
  3. edit init.toml and add layers and config options (see below)
  4. restart vim
  5. changes not applied, no errors in log (no colorscheme or fzf shortcuts available, line numbers still relative)
#=============================================================================
# basic.toml --- basic configuration example for SpaceVim
# Copyright (c) 2016-2023 Wang Shidong & Contributors
# Author: Wang Shidong < [wsd...@outlook.com](https://groups.google.com/) >
# URL: https://spacevim.org/
# License: GPLv3
#=============================================================================

# All SpaceVim option below [option] section
[options]
    # set spacevim theme. by default colorscheme layer is not loaded,
    # if you want to use more colorscheme, please load the colorscheme
    # layer
    colorscheme = "molokai"
    colorscheme_bg = "dark"
    # Disable guicolors in basic mode, many terminal do not support 24bit
    # true colors
    enable_guicolors = true
    # Disable statusline separator, if you want to use other value, please
    # install nerd fonts
    statusline_separator = "nil"
    statusline_iseparator = "bar"
    buffer_index_type = 4
    windows_index_type = 3
    enable_tabline_filetype_icon = false
    enable_statusline_mode = false
    statusline_unicode = false
    # Enable vim compatible mode, avoid changing origin vim key bindings
    vimcompatible = true
    relativenumber = false

# Enable autocomplete layer
[[layers]]
name = 'autocomplete'
auto_completion_return_key_behavior = "complete"
auto_completion_tab_key_behavior = "cycle"

[[layers]]
name = 'shell'
default_position = 'top'
default_height = 30

[[layers]]
name = 'colorscheme'

[[layers]]
name = 'fzf'

Output of the :SPDebugInfo!

SpaceVim debug information

SpaceVim options :

  auto_disable_touchpad = 1
  autocomplete_method = 'asyncomplete'
  autocomplete_parens = 1
  buffer_index_type = 4
  checkinstall = 1
  code_runner_focus = 0
  colorscheme = 'gruvbox'
  colorscheme_bg = 'dark'
  colorscheme_default = 'desert'
  commandline_prompt = '>'
  custom_color_palette = []
  custom_plugins = []
  data_dir = '/Users/x/.cache/'
  debug_level = 1
  default_custom_leader = '<Space>'
  default_indent = 2
  disabled_plugins = []
  enable_bepo_layout = 0
  enable_cursorcolumn = 0
  enable_cursorline = 1
  enable_debug = 0
  enable_googlesuggest = 0
  enable_guicolors = 0
  enable_javacomplete2_py = 0
  enable_key_frequency = 0
  enable_language_specific_leader = 1
  enable_list_mode = 0
  enable_neocomplcache = 0
  enable_os_fileformat_icon = 0
  enable_powerline_fonts = 1
  enable_projects_cache = 1
  enable_statusline_bfpath = 0
  enable_statusline_mode = 0
  enable_statusline_tag = 1
  enable_tabline_ft_icon = 0
  enable_vimfiler_welcome = 1
  enable_ycm = 0
  error_symbol = ''
  escape_key_binding = 'jk'
  expand_tab = 1
  file_searching_tools = []
  filemanager = 'nerdtree'
  filetree_direction = 'right'
  filetype_icons = {}
  force_global_config = 0
  gitcommit_issue_icon = ''
  gitcommit_pr_icon = ''
  github_username = ''
  guifont = 'SauceCodePro Nerd Font Mono:h11'
  hiddenfileinfo = 1
  home_files_number = 6
  hosts_url = 'https://raw.githubusercontent.com/racaljk/hosts/master/hosts'
  if_ruby = 1
  info_symbol = ''
  keep_server_alive = 1
  language = ''
  lazy_conf_timeout = 200
  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_theme = 'leaderguide'
  leader_guide_vertical = 0
  lint_engine = 'neomake'
  lint_on_save = 1
  lint_on_the_fly = 0
  max_column = 120
  plugin_bundle_dir = '/Users/x/.cache/vimfiles/'
  plugin_manager = 'dein'
  plugin_manager_processes = 16
  plugin_name = 'open-browser.vim'
  project_auto_root = 1
  project_non_root = ''
  project_rooter_outermost = 1
  project_rooter_patterns = ['.git/', '_darcs/', '.hg/', '.bzr/', '.svn/', '.SpaceVim.d/']
  projects_cache_num = 20
  realtime_leader_guide = 1
  relativenumber = 1
  search_tools = ['rg', 'ag', 'pt', 'ack', 'grep', 'findstr', 'git']
  sidebar_direction = ''
  sidebar_width = 30
  smartcloseignoreft = ['tagbar', 'neo-tree', 'vimfiler', 'defx', 'NvimTree', 'SpaceVimRunner', 'SpaceVimREPL', 'SpaceVimQuickFix', 'HelpDescribe', 'VebuggerShell', 'VebuggerTerminal', 'SpaceVimTabsManager', 'SpaceVimGitRemoteManager']
  smartcloseignorewin = ['__Tagbar__', 'vimfiler:default']
  snippet_engine = 'neosnippet'
  src_root = 'E:\sources\'
  statusline_iseparator = 'nil'
  statusline_left = ['winnr', 'filename', 'major mode', 'search count', 'syntax checking', 'minor mode lighters']
  statusline_right = ['fileformat', 'cursorpos', 'percentage']
  statusline_separator = 'nil'
  statusline_unicode = 1
  terminal_cursor_shape = 2
  todo_close_list = 0
  todo_labels = ['fixme', 'question', 'todo', 'idea']
  todo_prefix = '@'
  update_retry_cnt = 3
  version = '2.4.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'
  windisk_encoding = 'cp936'
  windows_index_type = 3
  windows_leader = 's'
  windows_smartclose = 'q'
  wrap_line = 0

SpaceVim layers :

[[layers]]
  name="autocomplete"
[[layers]]
  name="checkers"
[[layers]]
  name="format"
[[layers]]
  name="edit"
[[layers]]
  name="ui"
[[layers]]
  name="core"
[[layers]]
  name="core#banner"
[[layers]]
  name="core#statusline"
[[layers]]
  name="core#tabline"

SpaceVim Health checking :

SpaceVim clipboard support check report:
Checking +clipboard:
SUCCEED!
SpaceVim environment check report:
Current progpath: vim(vim)
version: 900
OS: mac
[shell, shellcmdflag, shellslash]: ['/bin/zsh', '-c', 0]
SpaceVim lua support check report:
Checking +lua:
Failed : to support +lua, you need recompile your vim with +lua support.
SpaceVim python support check report:
Checking +python3:
Failed : to support +python3, Please install vim-gtk, or build from sources.
Checking +python:
Failed : to support +python, Please install vim-gtk, or build from sources.
Checking SpaceVim layer health:

  • autocomplete:ok
  • checkers:ok
  • format:ok
  • edit:ok
  • ui:ok
  • core:ok
  • core#banner:ok
  • core#statusline:ok
  • core#tabline:ok

SpaceVim runtime log :

[ SpaceVim ] : logger file  does not exists, only log for current process will be shown!
[ SpaceVim ] [11:52:48] [   0.000] [  Info ] Loading SpaceVim from: /Users/x/.SpaceVim/
[ SpaceVim ] [11:52:48] [   0.000] [  Info ] default rtp is:
[ SpaceVim ] [11:52:48] [   0.000] [  Info ]   > /Users/x/.SpaceVim/
[ SpaceVim ] [11:52:48] [   0.000] [  Info ]   > /usr/share/vim/vim90
[ SpaceVim ] [11:52:48] [   0.003] [  Info ] v:argv is:['vim']
[ SpaceVim ] [11:52:48] [   0.003] [  Info ] startup status:[0]
[ SpaceVim ] [11:52:48] [   0.003] [  Info ] Startup with no argv, current dir is used: ~
[ SpaceVim ] [11:52:48] [   0.003] [  Info ] init default layer list.
[ SpaceVim ] [11:52:48] [   0.003] [  Info ] load layer:autocomplete
[ SpaceVim ] [11:52:48] [   0.004] [  Info ] layer loaded.
[ SpaceVim ] [11:52:48] [   0.004] [  Info ] load layer:checkers
[ SpaceVim ] [11:52:48] [   0.004] [  Info ] layer loaded.
[ SpaceVim ] [11:52:48] [   0.004] [  Info ] load layer:format
[ SpaceVim ] [11:52:48] [   0.004] [  Info ] layer loaded.
[ SpaceVim ] [11:52:48] [   0.004] [  Info ] load layer:edit
[ SpaceVim ] [11:52:48] [   0.006] [  Info ] layer loaded.
[ SpaceVim ] [11:52:48] [   0.006] [  Info ] load layer:ui
[ SpaceVim ] [11:52:48] [   0.006] [  Info ] layer loaded.
[ SpaceVim ] [11:52:48] [   0.006] [  Info ] load layer:core
[ SpaceVim ] [11:52:48] [   0.007] [  Info ] layer loaded.
[ SpaceVim ] [11:52:48] [   0.007] [  Info ] load layer:core#banner
[ SpaceVim ] [11:52:48] [   0.008] [  Info ] layer loaded.
[ SpaceVim ] [11:52:48] [   0.008] [  Info ] load layer:core#statusline
[ SpaceVim ] [11:52:48] [   0.009] [  Info ] core#statusline layer do not implement loadable function
[ SpaceVim ] [11:52:48] [   0.009] [  Info ] layer loaded.
[ SpaceVim ] [11:52:48] [   0.009] [  Info ] load layer:core#tabline
[ SpaceVim ] [11:52:48] [   0.010] [  Info ] layer loaded.
[ SpaceVim ] [11:52:48] [   0.010] [  Info ] layer list init done
[ SpaceVim ] [11:52:48] [   0.011] [  Info ] start loading global config >>>
[ SpaceVim ] [11:52:48] [   0.011] [  Info ] global_dir is: /Users/x/.SpaceVim.d/
[ SpaceVim ] [11:52:48] [   0.011] [  Info ] find global config: /Users/x/.SpaceVim.d/init.toml
[ SpaceVim ] [11:52:48] [   0.016] [  Info ] start to apply config [glob]
[ SpaceVim ] [11:52:48] [   0.017] [  Info ] current directory is $HOME, skip local config
[ SpaceVim ] [11:52:48] [   0.042] [  Info ] core#statusline layer do not implement plugins function
[ SpaceVim ] [11:52:48] [   0.063] [  Info ] finished loading SpaceVim!
[ SpaceVim ] [11:52:48] [   0.086] [  Info ] lsp client: vim-lsp
[ SpaceVim ] [11:52:48] [   0.089] [  Info ] try to open SpaceVim welcome page
[ SpaceVim ] [11:52:48] [   0.099] [  Info ] run root changed callback on VimEnter!
[   rooter ] [11:52:48] [   0.099] [  Info ] Load projects cache from: /Users/x/.cache/SpaceVim/projects.json
[ SpaceVim ] [11:52:48] [   0.233] [  Info ] init default key bindings.
[ SpaceVim ] [11:52:48] [   0.234] [  Info ] default key binding init done
[   rooter ] [11:52:48] [   0.607] [  Info ] Start to find root for: /Users/x/
[   rooter ] [11:52:48] [   0.625] [  Info ] Start to find root for: /Users/x/NERD_tree_1
[   rooter ] [11:52:48] [   0.663] [  Info ] Start to find root for: /Users/x/
[   rooter ] [11:52:51] [   2.860] [  Info ] Start to find root for: /Users/x/.SpaceVim.d/init.toml
@tu-andy tu-andy added the bug bug of SpaceVim core label Sep 25, 2024
@ideadsnow
Copy link

I'm facing the same issue🤔

@girogio
Copy link

girogio commented Oct 4, 2024

Same here, can't seem to pinpoint the cause - the init.toml is not malformed.

@wsdjeg
Copy link
Member

wsdjeg commented Dec 7, 2024

sorry, I can not reproduce it, it works well for me, and I am using neovim 0.10.0

@wsdjeg wsdjeg added the can-not-reproduce Can not reproduce this issue label Dec 7, 2024
@Jabin94
Copy link

Jabin94 commented Dec 16, 2024

i am using VIM - Vi IMproved 9.0. SpaceVim is master(f49958d)

the s:TOML.parse_file(global_config) return a empty dictionary
append:
function! s:_skip(input) abort in toml.vim change a:input.p directly to the end of the file


function! s:_parse(input) abort
  let data = {}
  call SpaceVim#logger#info('parse toml enter: ' . string(a:input))
  call s:_skip(a:input)
  call SpaceVim#logger#info('parse toml skip: ' . string(a:input))
  while !s:_eof(a:input)
     ......
endfunction

SPDebugInfo

[ SpaceVim ] [14:28:46] [   0.010] [  Info ] parse toml enter: {'p': 0, 'length': 1397, ....
[ SpaceVim ] [14:28:46] [   0.010] [  Info ] parse toml skip: {'p': 1397, 'length': 1397, ....

init.toml file

#=============================================================================
# basic.toml --- basic configuration example for SpaceVim
# Copyright (c) 2016-2023 Wang Shidong & Contributors
# Author: Wang Shidong < wsdjeg@outlook.com >
# URL: https://spacevim.org
# License: GPLv3
#=============================================================================

# All SpaceVim option below [option] section
[options]
    # set spacevim theme. by default colorscheme layer is not loaded,
    # if you want to use more colorscheme, please load the colorscheme
    # layer
    colorscheme = "gruvbox"
    colorscheme_bg = "dark"
    # Disable guicolors in basic mode, many terminal do not support 24bit
    # true colors
    enable_guicolors = false
    # Disable statusline separator, if you want to use other value, please
    # install nerd fonts
    statusline_separator = "nil"
    statusline_iseparator = "bar"
    buffer_index_type = 4
    windows_index_type = 3
    enable_tabline_filetype_icon = false
    enable_statusline_mode = true
    statusline_unicode = true
    # Enable vim compatible mode, avoid changing origin vim key bindings
    vimcompatible = true

# Enable autocomplete layer
[[layers]]
name = 'autocomplete'
auto_completion_return_key_behavior = "complete"
auto_completion_tab_key_behavior = "cycle"

[[layers]]
name = 'shell'
default_position = 'top'
default_height = 30

@wsdjeg
Copy link
Member

wsdjeg commented Dec 17, 2024

I do not know why, but the test for vim is successed, the vader file is:

https://github.com/SpaceVim/SpaceVim/blob/master/test/lua/data/toml.vader

and this:

https://github.com/SpaceVim/SpaceVim/blob/master/test/api/data/toml.vader

@Jabin94
Copy link

Jabin94 commented Dec 18, 2024

it has a wrong with vim's matchend function, seems not recognized '\n'.

it's normal to use neovim. (but need to modify ~/.SpaceVim.d/init.toml once before using neovim, otherwise the configuration in ~/.cache/SpaceVim/conf/init.json will be used.)

vim also can be used normally when the ~/.cache/SpaceVim/conf/init.json through neovim load ~/.SpaceVim.d/init.toml regenerated.

@pj-connect
Copy link

pj-connect commented Dec 25, 2024

I had the same issue. There was another init.toml overriding my init.toml in ~/.SpaceVim.d. It was in ~/.local/SpaceVim.d. Took me hours to find out. So I moved the file into ~/.local, and solved the problem. Still dont remember why i created that directory.

Did a manual installation, did not use the installer.

VIM - Vi IMproved 9.0
Kubuntu 22.04

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug bug of SpaceVim core can-not-reproduce Can not reproduce this issue
Development

No branches or pull requests

6 participants