christoomey / vim-quicklink

A Vim plugin for quickly looking up a topic in google and inserting the relevant link
MIT License
55 stars 4 forks source link

Use `normal!` vs `normal` to avoid mapping conflicts #14

Closed geoffharcourt closed 8 years ago

geoffharcourt commented 8 years ago

Executing normal mode commands with :normal will take into account a user's remapping, and might not perform the expected action. This change updates all instances of :normal in the plugin to use :normal!, which will execute the normal mode commands using the default, expected mappings supplied with Vim. This change fixes #13, where ConvertSelectionToLink was selecting more than the desired search term due to user remapping of gv.

Fix #13.

christoomey commented 8 years ago

Hey @geoffharcourt, thanks for the update! This all makes sense, and frankly I'm surprised I wrote any of this using :normal and not :normal! as I'm aware what you're describing. I'm going to run with this locally just to confirm, but I assume this will be fine and I'll merge in a few days.

geoffharcourt commented 8 years ago

@christoomey no problem.

I've been using Google's Vim styleguide recently. There's some resistance to conforming on a styleguide at tb due to how little VimL we write (vs. other languages), but I've found a number of practices in there that have been extremely helpful when editing VimL.

christoomey commented 8 years ago

Hey @geoffharcourt, thanks again for this update!