Skip to content

cannot re-source from inside nvim with a keybinding #243

Description

@amtoine

Describe the bug

i've this keybinding

vim.keymap.set('n', '<leader>so', ':source ~/.config/nvim/init.lua<CR>', { silent = true })

to reload the config when pressing <leader>so.

but i get the following error in the footer of vim:

Re-sourcing your config is not supported with lazy.nvim

❓ i'm wondering if this is normal and if there is anything to do to reload a config from inside nvim 😋

To Reproduce

Steps to reproduce the behavior:

  1. add vim.keymap.set('n', '<leader>so', ':source ~/.config/nvim/init.lua<CR>', { silent = true }) to init.lua
  2. restart nvim
  3. press <leader>so
  4. see the error at the bottom

Desktop

  • OS: arch on linux
  • Terminal: alacritty

Neovim Version

NVIM v0.8.3
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by builduser

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/share/nvim"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions