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

ReplaceWithCurly replaces all quotes with right curly #38

Open
tomory opened this issue Oct 3, 2023 · 1 comment
Open

ReplaceWithCurly replaces all quotes with right curly #38

tomory opened this issue Oct 3, 2023 · 1 comment

Comments

@tomory
Copy link

tomory commented Oct 3, 2023

After doing map <silent> <leader>qc <Plug>ReplaceWithCurly per the README, I tried \qc. Instead of replacing pairs of straight quotes with matching curlies, it instead replaced all straight quotes with right curly quotes.

@telemachus
Copy link
Collaborator

I can't reproduce that here. Can you give a sample of text you were using and list exactly what commands you ran and what mode you were in when you ran the commands?

It may also be useful to try starting vim with a minimal vimrc and no other plugins (except vim-textobj-user and vim-textobj-quote).

For example, save this as vimrc (no dot in that filename).

set vif=NONE
set nocompatible
filetype on
packadd vim-textobj-user
packadd vim-textobj-quote

function! StartQuote()
    call textobj#quote#init()
    map <silent> ; <Plug>ReplaceWithCurly
    map <silent> \ <Plug>ReplaceWithStraight
endfunction

augroup test
    autocmd!
    autocmd FileType markdown call StartQuote()
augroup END

And edit this (as foo.md).

This is a test. "This is only a test."

Start up vim with this command: vim --noplugin -u vimrc foo.md

You should be able to swap the quotes around the second sentence from normal mode and visual mode using \ and ;.

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

2 participants