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

Dont substitute -- for — way to many commands use --word [ENHANCEMENT REQUEST] #162

Open
ccolorado opened this issue Dec 29, 2017 · 2 comments

Comments

@ccolorado
Copy link

ccolorado commented Dec 29, 2017

Hi, I am using your super useful plugin to document some bash use cases
Things that I use every now and again but tend to forget, instead of having to re-hunt them on the web
more often than not I notice commands like
git update-index --assume-unchanged file
substituted for
git update-index —assume-unchanged file

maybe switch for 3 dashes for the substitution, or ignore the rule when inside `

I think that the substitution is already ignored when inside triple {}, but doesn't serve my purpose as much as `

Thanks

@ccolorado ccolorado changed the title Dont substitute -- for — way to many commands use --word [FEATURE REQUEST] Dont substitute -- for — way to many commands use --word [ENHANCEMENT REQUEST] Dec 29, 2017
@BenjaminBrandtner
Copy link

BenjaminBrandtner commented Jul 1, 2018

Removing the substitution

If you'd like to remove the -- to — substitution completely, put iunmap <buffer> -- in your vimrc.
Edit: Actually that's probably not enough. The mapping is defined when you open Notes files, which happens after reading your vimrc.
This should really be executed after opening a Notes file and after the plugin mappings have been defined. I'm not sure how to do that, so I can only offer the second solution:

Changing plugin code

The mapping is defined in ftplugin/notes.vim in line 62 (as of commit e465a0a) :

62| inoremap <buffer> <expr> -- xolox#notes#insert_em_dash()
63| let b:undo_ftplugin .= ' | execute "iunmap <buffer> --"'

Here you could change it to something else, like ---. If you do, remember to change line 63 as well. It contains an unmap function for the previosly defined mapping that is called at some point. If it differs, you'll get an error message when opening a Notes file.

@ccolorado
Copy link
Author

Thanks, will do. Again, love the plugin

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