vim-notes icon indicating copy to clipboard operation
vim-notes copied to clipboard

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

Open ccolorado opened this issue 8 years ago • 2 comments

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 avatar Dec 29 '17 12:12 ccolorado

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 e465a0a987dbacdf7291688215b8545f8584d409) :

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.

BenjaminBrandtner avatar Jul 01 '18 22:07 BenjaminBrandtner

Thanks, will do. Again, love the plugin

ccolorado avatar Jul 16 '18 19:07 ccolorado