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

Need instructions for "Configurable to support international variations in quotation marks" #21

Open
boydkelly opened this issue May 2, 2020 · 5 comments

Comments

@boydkelly
Copy link

boydkelly commented May 2, 2020

In French also there is a non breakable space between the quote mark and text.
I just tried as a test to put u00a0 twice between the french quotes as below but it did' work.
autocmd FileType *.adoc call textobj#quote#init({ 'double':'« »', 'single':'«»', 'educate': 1 })
Can textobj help me out here? Or any other suggestions?

@alerque
Copy link
Member

alerque commented May 2, 2020

I use vim-surround which handles (with and without) whites-pace inside parenthesis/brace/bracket/caret text objects (( example ) and (example)), so there must be a way to do this. I don't think this plugin is setup to do it now but somehow somebody should implement this for French!

@boydkelly
Copy link
Author

boydkelly commented May 4, 2020

Hi Caleb. Thanks for the comment. Just an FYI, I got something working; I found this mapping on an old 2011 forum post.
http://vim.1045645.n5.nabble.com/Function-to-write-correctly-French-quotation-marks-td4259054.html

function! LanguageSettings()
      if &spelllang =~ 'fr'
         set keymap=french 
         :imap <expr> " getline('.')[col('.')-2]=~'\S' ?  ' »' : '« '
         :imap <expr> ' getline('.')[col('.')-2]=~'\S' ?  ' »' : '« '
      elseif &spelllang =~ 'en'
         :silent! iunmap  "
         :silent! iunmap  '
      endif
endfunction 

To complete this in my French keymap, I have the mappings for the question mark and exclamation mark including the nonbreakable space which also works fine:

loadkeymap
?   ?
!   !

My only issue now is I can't seem to get everything in one place. The keymap file doesn't seem to support an expression as with imap. And if I try to load the ?! mappings with imap (that include a tab and u-00a0 it totally hangs my terminal. Anyways it is possible now for me to painlessly type in French with my favorite editor!
Cheers!

@telemachus
Copy link
Collaborator

I think that this is out of scope for this plugin.

I'd like to close the issue with a pointer to vim-sandwich,
which could maybe handle something like what the OP wanted.

/ping @alerque

@alerque
Copy link
Member

alerque commented Feb 10, 2022

I'm not quite sure why this would be out of scope? Or perhaps I misunderstand what the OP wanted. Is the problem just that French quote styles include two characters on each end instead of one? Other than the series of glyphs used what is fundamentally different about what they want to accomplish?

@telemachus
Copy link
Collaborator

telemachus commented Feb 10, 2022

Sorry, I wasn't clear. By "out of scope," I meant that I didn't think that we would implement this directly in the plugin itself.

On the README, we offer advice about non-English quote characters, but I didn't think that we would ever directly implement them in the plugin. (We could, but so far nobody seems to have taken on that work.)

That said, I was mostly trying to clean up the issues that seemed stale to me. If you want to leave this open to gather other suggestions or as a note for a future enhancement, that makes sense too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants