vim-textobj-quote icon indicating copy to clipboard operation
vim-textobj-quote copied to clipboard

ReplaceWithCurly replaces all quotes with right curly

Open tomory opened this issue 2 years ago • 1 comments

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.

tomory avatar Oct 03 '23 19:10 tomory

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 ;.

telemachus avatar Oct 13 '23 19:10 telemachus