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

The default mapping for <Plug>AddVimFootnote add additional spaces #22

Open
jdhao opened this issue Aug 11, 2020 · 0 comments
Open

The default mapping for <Plug>AddVimFootnote add additional spaces #22

jdhao opened this issue Aug 11, 2020 · 0 comments

Comments

@jdhao
Copy link

jdhao commented Aug 11, 2020

Currently, the default mapping for <Plug>AddVimFootnote is:

nnoremap <buffer> <Plug>AddVimFootnote :<C-U>call markdownfootnotes#VimFootnotes('a')<CR>      
inoremap <buffer> <Plug>AddVimFootnote <C-O>:<C-U>call markdownfootnotes#VimFootnotes('a')<CR> 

As a result, when the cursor is in the position where we want to insert footnote, an extra space will be inserted before the footnote mark, which is annoying.

For example, if we have (| indicates cursor position):

some| text

when we use the mapping to insert footnote, the text becomes:

some [^1]text

Instead, it will be more reasonable for text to be:

some[^1] text

To achieve this, the above mapping should be changed to:

nnoremap <buffer> <Plug>AddVimFootnote :<C-U>call markdownfootnotes#VimFootnotes('i')<CR>      
inoremap <buffer> <Plug>AddVimFootnote <C-O>:<C-U>call markdownfootnotes#VimFootnotes('i')<CR> 
jdhao added a commit to jdhao/nvim-config that referenced this issue Aug 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant