0

I broke nvim and now it's unusable.

I was experimenting with ways of executing a command under the cursor (while editing) and having the command's output inserted into the buffer. In my buffer, I had a single line with echo hi

Live, within the nvim session (not in my init.vim) I tried a few remappings like this:

  • :nnoremap ,b :.w !bash<CR>
  • :nnoremap ,r :.!bash<CR>
  • :nnoremap ,x :.!!<CR>

At some point, I mistyped something and BAM! Whenever I run nvim, I get "hi." That's it. I can no longer use nvim! I tried nvim -i NONE and I get hi

How do I even start to fix this?! Any help would be greatly appreciated.

LiamF
  • 185
  • 7
  • 1
    Use :scriptnames to see what files have been read by vim. Check each of those files for changes – Christian Brabandt Oct 05 '23 at 07:26
  • That first example remapping has me wondering if you may have done something like move the ! one character to the left, thus writing your buffer out to a file, rather than piping it through a command. Although I wouldn't expect a file named "bash" to interfere with nvim's startup like that, unless nvim is for some reason dependent on bash. I don't suppose you tried making a remapping that piped through nvim? Or, perhaps a more useful question, what does type nvim say? – 8bittree Oct 05 '23 at 16:14
  • It seems like a classic case for How to debug my vimrc – D. Ben Knoble Oct 05 '23 at 18:25
  • Try nvim --clean (It runs with no configuration at all). If you still get hi, then there is something wrong with neovim and not any configuration file :) – Bog Oct 13 '23 at 07:56

0 Answers0