vim-markdown
vim-markdown copied to clipboard
Issue with `<Enter>` in `:Toc`
The documentation for :Toc
says:
Hit
<Enter>
on a line to jump to the corresponding line of the markdown file.
However, I already have a mapping for <Enter>
on my vimrc:
" use ENTER to add new lines without going into insert mode
nnoremap <CR> o<Esc>k
Which causes <Enter>
inside the :Toc
buffer to return an error:
E21: Cannot make changes, 'modifiable' is off
If I disable my mapping with :unmap <CR>
then the :Toc
jump-to-line behavior starts working. However, that causes my <CR>
mapping to be lost for all buffers.
Is there a way to remove my <CR>
mapping only in the :Toc
buffer?
Or a way to make the Toc
mapping for <CR>
be more specific than my .vimrc
mapping?
Or a way to use a different key for the jump-to-line behavior?
Having the same issue.
I had the same issue
My ~/.vimrc had the following mappings (for vim-go)
map <C-m> :cprevious<CR>
I've turned it into
autocmd FileType go map <C-m> :cprevious<CR>
This fixes <ENTER>
in :Toc
for me.