!!! For VS 2022 support see the other PeasyMotion https://marketplace.visualstudio.com/items?itemName=maksim-vorobiev.PeasyMotion2022 !!!Implements "word-motion", line motions, two char search modes ~same way as it is done in vim-easymotion. Implements fast text selection via jump label motion. Implements jumping to open document via jump label combo. This extension differs from other motion/jump extensions as it assigns jump labels to all words in text viewport, without asking specific "jump" key (in word-motion mode). Such a behaviour may lead to faster motion and navigation in certain scenarios. Inspired by original vim-easymotion script for VIM. InstallingDownload this extension from the VS Gallery: [VS 2019] https://www.vsixgallery.com/extension/PeasyMotion.a87d2837-6b54-4518-b014-3b29b4dcd902 [VS 2022] https://www.vsixgallery.com/extension/PeasyMotion.14f4a247-6617-4f0c-aac4-76844ffe053c or get the CI build. IMPORTANT Key binding & options (for VsVim or ViEmu see 'Compatibility with other plugins' section)Assign key combination through Tools->Options->Keyboard commands available:
Two jump label assignment algorithms are available (Tools->Options->PeasyMotion options):
In caret relative mode you can adjust 'proximity' sensitivity via "Caret position sensitivity " option. When caret sensitivity is not equal to 0, caret position is quantized into blocks of (sensitivity +1) caret positions and is treated as being located in the middle of encasing block. Colors for jump labelsOne can configure jump label colors, with live preview also. Color options for 'First motion' and 'Final motion' jump labels are available. Just invoke PeasyMotion and goto Tools->Options and adjust style with live preview. When 'Color source' options is not equal to PeasyMotionJumpLabel****Motion, one can sync label color style to other classification items from Tools->Options->Fonts And Colors->Text Editor. When 'Color source' is equal to PeasyMotionJumpLabel****Motion one can configure classification style manually trough Tools->Options->PeasyMotion or Tools->Options->Fonts And Colors->Text Editor->'PeasyMotion **** Motion Jump label color'. Assign allowed jump label charactersOne can assign allowed jump label characters through Tools->Options->PeasyMotion options->Allowed jump label characters If one observes any kind of unexpected behaviour when pressing certain key/labels during motion, there is an option to replace/remove unwanted characters from list. Beware that order of characters in this options affects ergonomics of jump-motions. Lowercase letters, digits and punctuation symbols are all valid jump label characters. Compatibility with other pluginsVsVim and ViEmu just bind PeasyMotion command in your .vimrc (or .vsvimrc) file:
Text selection via Tools.InvokePeasyMotionTextSelect commandInvoking Tools.InvokePeasyMotionTextSelect command lets you to specify jump label to select in [ current caret position -> jump label ] range (!) in forward and reverse directions. Jump to word beginning or ending in current lineJump to word beginning or ending in current line via Tools.InvokePeasyMotionLineJumpToWordBegining or Tools.InvokePeasyMotionLineJumpToWordEnding Jump to document tabJump to any open document tab via Tools.InvokePeasyMotionJumpToDocumentTab The only way to prevent UI 'jumping' when tabs caption are changed is to use monospaced font for Tools->Fonts And Colors -> show settings for Environment. This will help making tab captions keep stable. In case of non-monospaced fonts in 'Environment' - when jump labels are assigned to document tab title -> title's width can change it's width (get shorter or longer, depends on particular characters combination in caption). When document tab title changes, the re-adjustment of tab document title positions happen -> jump labels and whole doc tab title shifts either side. When user's gaze was fixed on the jump label or document tab title user will lose his 'point of focus'/ gaze point. When monospaced fonts are used in environment -> each character lower/upper of any kind occupies strictly the same space in title. This prevents any changes/adjustments to captions widths/doc title positions in combination with fact, that jump label replaces part of document name (to help with keeping document title the same width as it was). Jump to beginning of lineJump to beginning of any visible line via Tools.InvokePeasyMotionJumpToLineBegining Two char searchExecute two character search for visible text portion via Tools.InvokePeasyMotionTwoCharJump. Jump labels are placed at each match. When activated, two keys are queried, search and all matched are labeled. After that PM awaits for jump label keys to execute final motion and deactivate. Bugreports, Feature requests and contributionsPeasyMotion can be developed using Visual Studio 2017 or 2019. Contributions are welcomed. Check out the contribution guidelines LicenseAll code in this project is covered under the MIT license a copy of which is available in the same directory under the name LICENSE.txt. Latest BuildsThe build representing the latest source code can be downloaded from the Open Vsix Gallery. BuildingFor cloning and building this project yourself, make sure to install the Extensibility Essentials extension for Visual Studio which enables some features used by this project. You may also want to check awesome Mads Kristensen guide |