Skip to content

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

@jdhao

Description

@jdhao

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> 

Activity

added a commit that references this issue on Aug 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @jdhao

        Issue actions

          The default mapping for <Plug>AddVimFootnote add additional spaces · Issue #22 · vim-pandoc/vim-markdownfootnotes