### vim-visual-multi Configuration Example Source: https://github.com/mg979/vim-visual-multi/blob/master/test/README.md An example of an optional configuration file (`config.json`) for vim-visual-multi, specifying constraints such as maximum CPU time. ```json { "max_cpu_time": 2.7 } ``` -------------------------------- ### Install vim-visual-multi with vim-plug (test branch) Source: https://github.com/mg979/vim-visual-multi/wiki/Home This snippet shows how to install the vim-visual-multi plugin using the 'vim-plug' package manager. It specifically targets the 'test' branch of the repository, which is recommended for installation. ```vimscript Plug 'mg979/vim-visual-multi', {'branch': 'test'} ``` -------------------------------- ### Vim Visual Multi: Colemak Mappings Configuration Example Source: https://github.com/mg979/vim-visual-multi/blob/master/doc/vm-mappings.txt This section provides an example of how to configure custom mappings for Colemak users or for remapping Vim Visual Multi commands. It demonstrates remapping 'i' and 'a' keys and explains the underlying mechanism of mapping Vim Visual Multi plugs. ```vim let g:VM_maps['i'] = 'a' let g:VM_maps['I'] = 'A' let g:VM_maps['a'] = 'o' let g:VM_maps['A'] = 'O' nmap a (VM-i) nmap A (VM-I) nmap o (VM-a) nmap O (VM-A) ``` -------------------------------- ### Install vim-visual-multi with vim-plug Source: https://github.com/mg979/vim-visual-multi/blob/master/README.md This snippet shows how to install the vim-visual-multi plugin using the vim-plug package manager. It specifies the repository and the branch to use for installation. ```vimscript Plug 'mg979/vim-visual-multi', {'branch': 'master'} ``` -------------------------------- ### Vim Visual Multi: Start Search with Pattern Source: https://github.com/mg979/vim-visual-multi/blob/master/doc/vm-faq.txt To initiate a search using a pattern in Vim Visual Multi, use the ':VMSearch' command. It accepts a pattern and an optional range, such as '%' for all matches. ```vimscript :VMSearch ``` -------------------------------- ### Install vim-visual-multi with Vim 8+ Packages Source: https://github.com/mg979/vim-visual-multi/blob/master/README.md This snippet demonstrates how to install the vim-visual-multi plugin manually for Vim 8 and later using the built-in package management system. It involves cloning the repository into the designated plugin directory. ```bash mkdir -p ~/.vim/pack/plugins/start && git clone https://github.com/mg979/vim-visual-multi ~/.vim/pack/plugins/start/vim-visual-multi ``` -------------------------------- ### Configure VM Case Setting Source: https://github.com/mg979/vim-visual-multi/blob/master/doc/vm-settings.txt Sets the starting case matching behavior for patterns within Vim Visual Multi. Possible values include 'smart', 'sensitive', and 'ignore'. ```vimscript let g:VM_case_setting = 'smart' let g:VM_case_setting = 'sensitive' let g:VM_case_setting = 'ignore' ``` -------------------------------- ### Vim Visual Multi: Advanced Colemak Mappings Configuration Source: https://github.com/mg979/vim-visual-multi/blob/master/doc/vm-mappings.txt This example illustrates a more complex scenario for remapping keys in Vim Visual Multi, specifically when multiple keys need to be swapped to avoid conflicts. It shows how to remap 'i', 'I', 'a', 'A', 'o', and 'O' to ensure all desired functionalities work correctly. ```vim let g:VM_maps['i'] = 'a' let g:VM_maps['I'] = 'A' let g:VM_maps['a'] = 'o' let g:VM_maps['A'] = 'O' let g:VM_maps['o'] = 'i' let g:VM_maps['O'] = 'I' ``` -------------------------------- ### Vim Visual-Multi Quick Reference Mappings Source: https://github.com/mg979/vim-visual-multi/blob/master/doc/visual-multi.txt Provides a quick reference guide to common mappings provided by the vim-visual-multi plugin. These mappings allow for efficient manipulation of multiple cursors and selections. ```Vimscript Find Word |vm-find-word| Next/Previous/Skip n / N / q |vm-find-next| Remove Region Q |vm-remove-region| Add Cursors Down/Up / |vm-add-cursors| Add Cursor at Position \ |vm-add-cursor| Select Right/Left , |vm-shift-select| Select All Words \A |vm-select-all| Slash motion g/ |vm-slash| Find with Regex \/ |vm-regex-search| Reselect Last \gS |vm-reselect-last| Toggle Mappings \ |vm-mappings-toggle| Select Operator s |vm-select-operator| Find Operator m |vm-find-operator| Alignment \a |vm-align| Transposition \t |vm-transpose| ``` -------------------------------- ### Vim Visual Multi: Numbering Regions Source: https://github.com/mg979/vim-visual-multi/blob/master/doc/visual-multi.txt Appends or prepends numbers to selected regions using a specified expression format. It supports start and step values, with different output formats depending on whether the command is initiated with \n or \N. ```vimscript Default mapping: `\n`, `\N` Appends or prepends numbers with an expression. Accepts [count]. Expression syntax is: > start=[count]/step/separator < For example, started with `\N`: > 2/2/, < will generate: > 2, text 4, text ... < If started with `\n`, the result will be instead: > text, 2 text, 4 ... < ``` -------------------------------- ### Configure VM Leader Mapping Source: https://github.com/mg979/vim-visual-multi/blob/master/doc/visual-multi.txt Sets the leader key for VM mappings to reduce conflicts with other plugins. The default leader is '\\'. This example shows how to change it to a single backslash. ```vimscript let g:VM_leader = '\\' ``` -------------------------------- ### Configure Vim Visual Multi Mappings Source: https://github.com/mg979/vim-visual-multi/wiki/2. Starting VM This snippet shows how to customize the key mappings for the vim-visual-multi plugin by defining a dictionary `g:VM_maps` in your vimrc. It allows remapping default actions like 'Find Under' or 'Select Cursor Down' to different key combinations. ```vimscript let g:VM_maps = {} let g:VM_maps['Find Under'] = '' let g:VM_maps['Find Subword Under'] = '' let g:VM_maps["Select l"] = '' let g:VM_maps["Select h"] = '' let g:VM_maps["Select Cursor Down"] = '' let g:VM_maps["Select Cursor Up"] = '' ``` -------------------------------- ### Vim: Accessing and Manipulating VM Regions Source: https://github.com/mg979/vim-visual-multi/wiki/Api Demonstrates how to access the VM selection buffer, retrieve region data, and manipulate text content using Vimscript. It shows how to get region text, process it with a function, and fill the VM register for pasting. ```vim let VM = b:VM_Selection let Regions = VM.Regions " where VM regions are stored let t1 = Regions[0].txt " get a region's content by index " get all regions contents in a list let regions_text = VM.Global.regions_text() " process regions contents with a function, creating a new list let new_text = [] for t in regions_text call add(new_text, function(t)) endfor " fill VM register and paste the new contents call VM.Edit.fill_register('"', new_text, 0) normal p ``` -------------------------------- ### Configure VM Statusline Behavior Source: https://github.com/mg979/vim-visual-multi/blob/master/doc/vm-settings.txt Enables or configures the statusline behavior when Vim Visual Multi is active. Options include setting it once on start, refreshing on CursorHold, or refreshing on CursorMoved. ```vimscript let g:VM_set_statusline = 1 let g:VM_set_statusline = 2 let g:VM_set_statusline = 3 ``` -------------------------------- ### Conditional Autocommand for VM Source: https://github.com/mg979/vim-visual-multi/blob/master/doc/vm-troubleshooting.txt This example shows how to write an autocommand that only executes if vim-visual-multi is not active, preventing conflicts. ```vimscript au InsertLeave * if !exists('b:visual_multi') | silent! update | endif ``` -------------------------------- ### Select Right/Left Source: https://github.com/mg979/vim-visual-multi/blob/master/doc/visual-multi.txt Extends all regions to the right or left. If VM hasn't started, it initiates selection. It forces 'extend-mode'. For adding new regions instead of extending, and can be used, though they might not work in all Vim versions. These commands do not create new patterns. ```vimscript noremap :call ExtendSelectionRight() noremap :call ExtendSelectionLeft() noremap :call AddRegionRight() noremap :call AddRegionLeft() ``` -------------------------------- ### Find with Regex Source: https://github.com/mg979/vim-visual-multi/blob/master/doc/visual-multi.txt Enables searching for a regex pattern and creating selections based on it. The default mapping is '\\/'. Subsequent searches using 'n'/'N' will find the next VM match, not the next occurrence of the pattern. When started from visual mode, it selects all occurrences within the visual selection. ```vimscript noremap \/ :call RegexSearch() ``` -------------------------------- ### Select Operator Source: https://github.com/mg979/vim-visual-multi/blob/master/doc/visual-multi.txt Reshapes selections across all active regions based on a given text object. This mapping is only available after VM has started. The default mapping is 's'. For example, 'si[' selects text inside brackets. ```vimscript omap s :call SelectOperator() ``` -------------------------------- ### Running the vim-visual-multi Tutorial Source: https://github.com/mg979/vim-visual-multi/blob/master/README.md This command launches the tutorial for vim-visual-multi. It requires specifying the path to the tutorialrc file within the plugin's directory. ```bash vim -Nu path/to/visual-multi/tutorialrc ``` -------------------------------- ### Initialize and Customize VM Mappings Source: https://github.com/mg979/vim-visual-multi/blob/master/doc/vm-mappings.txt Demonstrates how to initialize the g:VM_maps variable and assign custom key mappings for various actions within the vim-visual-multi plugin. This includes setting specific operators and enabling/disabling features like undo/redo. ```vimscript let g:VM_maps = {} let g:VM_maps["Select Operator"] = 'gs' let g:VM_maps["Select Operator"] = '' let g:VM_maps["Undo"] = 'u' let g:VM_maps["Redo"] = '' let g:VM_maps['Find Under'] = '' let g:VM_maps['Find Subword Under'] = '' let g:VM_maps["Select Cursor Down"] = '' let g:VM_maps["Select Cursor Up"] = '' let g:VM_maps['Select All'] = '' let g:VM_maps['Visual All'] = '' let g:VM_maps['Skip Region'] = '' let g:VM_maps['Increase'] = '+' let g:VM_maps['Decrease'] = '-' ``` -------------------------------- ### Accessing vim-visual-multi Documentation Source: https://github.com/mg979/vim-visual-multi/blob/master/README.md This shows the Vim commands to access the plugin's documentation. ':help visual-multi' provides general help, while ':help vm-some-topic' is used for specific features. ```vimscript :help visual-multi :help vm-some-topic ``` -------------------------------- ### Vim Visual Multi: Running Ex, Visual, and Normal Modes Source: https://github.com/mg979/vim-visual-multi/blob/master/doc/vm-mappings.txt This section covers commands for executing Vim's Ex, Visual, and Normal modes, as well as their last executed counterparts and macro execution. This allows for powerful scripting and automation within multiple regions. ```vim \z Run Normal \v Run Visual \x Run Ex \Z Run Last Normal \V Run Last Visual \X Run Last Ex \@ Run Macro ``` -------------------------------- ### Run Tests with vim-visual-multi Source: https://github.com/mg979/vim-visual-multi/blob/master/test/README.md This section details how to execute tests for the vim-visual-multi project using the provided Python script. It covers running all tests, specific tests, listing available tests, setting time intervals, showing diffs for failed tests, and disabling live editing. ```bash ./test.py ``` ```bash ./test.py [test] ``` ```bash ./test.py -l ``` ```bash ./test.py -t 0.3 ``` ```bash ./test.py -d ``` ```bash ./test.py -L ``` -------------------------------- ### VMQfix: Populate quickfix window Source: https://github.com/mg979/vim-visual-multi/blob/master/doc/vm-ex-commands.txt The :VMQfix command populates the quickfix window with the lines corresponding to the current regions. If executed with a '!' flag, it uses the positions and contents of the regions instead. If run from cursor mode, the text will be empty but positions will be valid. ```vimscript :VMQfix[!] ``` -------------------------------- ### Vim Visual Multi: Find Regex in Visual Selection Source: https://github.com/mg979/vim-visual-multi/wiki/Visual Starts a regex search that selects all matches within the visual selection in Vim. If block mode is active, the search is restricted to the visual block. ```vimscript noremap / :VMSearchRegex ``` -------------------------------- ### Configure Verbose VM Commands Source: https://github.com/mg979/vim-visual-multi/blob/master/doc/vm-settings.txt Enables more informative command prompts within Vim Visual Multi. Setting this to 1 provides detailed feedback rather than minimal prompts. ```vimscript let g:VM_verbose_commands = 1 ``` -------------------------------- ### Configure Adding Cursor at Position Without Mappings Source: https://github.com/mg979/vim-visual-multi/blob/master/doc/vm-settings.txt When starting Vim Visual Multi by adding a single cursor at a position, this setting prevents buffer mappings from being enabled, allowing free cursor movement for adding more cursors. ```vimscript let g:VM_add_cursor_at_pos_no_mappings = 1 ``` -------------------------------- ### Vim Visual Multi: Options, Menus, and Search Toggles Source: https://github.com/mg979/vim-visual-multi/blob/master/doc/vm-mappings.txt This snippet details commands for accessing menus, controlling search behavior, and toggling various modes like whole word search, case sensitivity, and single region mode. It also includes options for showing VM registers. ```vim \` filter lines to buffer, etc \C case conversion menu \" show VM registers in the command line \w toggle whole word search \c cycle case setting ('scs' -> 'noic' -> 'ic') \ toggle VM mappings \ toggle single region mode ``` -------------------------------- ### Vim Visual Multi: Create Cursors from Visual Selection Source: https://github.com/mg979/vim-visual-multi/wiki/Visual Creates cursors based on a visual selection in Vim. If the visual mode is 'v', the starting column is conserved. If the visual mode is 'V', cursors are created at column 1. ```vimscript noremap c :VMCursorColumn ``` -------------------------------- ### Add New Test Case in vim-visual-multi Source: https://github.com/mg979/vim-visual-multi/blob/master/test/README.md Instructions for adding a new test case to the vim-visual-multi project. This involves creating a directory in `tests/` and adding `input_file.txt`, `commands.py`, and `expected_output_file.txt`. Special character escaping in `commands.py` is demonstrated. ```python r'\\' ``` ```python r'\"' ``` ```python r'' ``` -------------------------------- ### Remap Standard Motions in VM Source: https://github.com/mg979/vim-visual-multi/blob/master/doc/vm-settings.txt Allows remapping standard Vim motion commands (like h, j, k, l) within Vim Visual Multi. This is useful for keyboard layouts other than QWERTY, for example, inverting 'h' and 'l'. ```vimscript let g:VM_custom_motions = {'h': 'l', 'l': 'h'} ``` -------------------------------- ### Vim Visual Multi: User Autocommands for Events Source: https://github.com/mg979/vim-visual-multi/blob/master/doc/vm-faq.txt Hook into Vim Visual Multi events using user autocommands. Define functions like 'VM_Start()' and 'VM_Exit()', or use 'visual_multi_start', 'visual_multi_exit', 'visual_multi_mappings', 'visual_multi_before_cmd', and 'visual_multi_after_cmd' for custom actions. ```vimscript function! VM_Start() function! VM_Exit() autocmd User visual_multi_start call MyVmStart() autocmd User visual_multi_exit call MyVmExit() autocmd User visual_multi_mappings call MyVmMappings() autocmd User visual_multi_before_cmd call MyFunc1() autocmd User visual_multi_after_cmd call MyFunc2() ``` -------------------------------- ### Vim Visual Multi: Remap Keys with Functions Source: https://github.com/mg979/vim-visual-multi/blob/master/doc/vm-faq.txt Remap keys within Vim Visual Multi by defining functions that are called on VM start and exit. These functions can use nmap and imap for normal and insert modes, and nunmap/iunmap to unmap keys. ```vimscript function! VM_Start() nmap imap endfunction function! VM_Exit() nunmap iunmap endfunction ``` -------------------------------- ### Load VM Theme in Colorscheme Source: https://github.com/mg979/vim-visual-multi/blob/master/doc/vm-settings.txt Shows how to load a specific vim-visual-multi theme from within a Vim colorscheme script. This ensures the theme is applied automatically when the colorscheme is loaded. ```vimscript silent! VMTheme theme_name ``` -------------------------------- ### Vim Visual Multi: Leader Commands (Run, Adjust Regions) Source: https://github.com/mg979/vim-visual-multi/wiki/Mappings Mappings for executing different Vim modes (Normal, Visual, Ex), running last commands, manipulating macros, and adjusting region sizes. ```vimscript noremap z :call VM#RunNormal() ``` ```vimscript noremap v :call VM#RunVisual() ``` ```vimscript noremap x :call VM#RunEx() ``` ```vimscript noremap Z :call VM#RunLastNormal() ``` ```vimscript noremap V :call VM#RunLastVisual() ``` ```vimscript noremap X :call VM#RunLastEx() ``` ```vimscript noremap @ :call VM#RunMacro() ``` ```vimscript noremap - :call VM#ShrinkRegions() ``` ```vimscript noremap + :call VM#EnlargeRegions() ``` ```vimscript noremap < :call VM#AlignByChar() ``` ```vimscript noremap > :call VM#AlignWithRegex() ``` ```vimscript noremap n :call VM#InsertNumbers() ``` ```vimscript noremap N :call VM#AppendNumbers() ``` ```vimscript noremap 0n :call VM#InsertNumbersFromZero() ``` ```vimscript noremap 0N :call VM#AppendNumbersFromZero() ``` -------------------------------- ### Link VM Highlight Groups Source: https://github.com/mg979/vim-visual-multi/blob/master/doc/vm-settings.txt Demonstrates how to link the default vim-visual-multi highlight groups (VM_Mono, VM_Extend, VM_Cursor, VM_Insert) to existing Vim highlight groups like DiffText, DiffAdd, Visual, and DiffChange. This allows customization of the plugin's appearance. ```vimscript hi! link VM_Mono DiffText hi! link VM_Extend DiffAdd hi! link VM_Cursor Visual hi! link VM_Insert DiffChange ``` -------------------------------- ### Vim Visual-Multi Plugin Requirements Source: https://github.com/mg979/vim-visual-multi/blob/master/doc/visual-multi.txt This section outlines the essential requirements for using the vim-visual-multi plugin. It specifies the minimum Vim or Neovim version needed for the plugin to function correctly. ```Vimscript Vim 8/Neovim is required. ``` -------------------------------- ### VM Plugin Compatibility Configuration Source: https://github.com/mg979/vim-visual-multi/blob/master/doc/vm-troubleshooting.txt Defines a dictionary structure for managing plugin compatibility with vim-visual-multi, allowing for conditional enabling and disabling of plugins. ```vimscript let g:VM_plugins_compatibilty = { \'plugin_name': { \ 'test': { -> exists('plugin_is_enabled') }, \ 'enable': ':PluginEnableCommand', \ 'disable': ':PluginDisableCommand'}, \} ``` -------------------------------- ### Vim Visual Multi: Basic Mappings Source: https://github.com/mg979/vim-visual-multi/wiki/Mappings Provides fundamental mappings for switching between cursor and extend modes, and for moving cursors or extending selections. ```vimscript noremap :call VM#ToggleMode() ``` ```vimscript noremap j :call VM#Motion('j') ``` ```vimscript noremap k :call VM#Motion('k') ``` ```vimscript noremap h :call VM#Motion('h') ``` ```vimscript noremap l :call VM#Motion('l') ``` -------------------------------- ### Vim Visual Multi: Custom Mappings with Plugs Source: https://github.com/mg979/vim-visual-multi/blob/master/doc/vm-faq.txt Create custom mappings in Vim Visual Multi using plugs like '(VM-Visual-Cursors)' for specific actions, such as creating a column of cursors over a paragraph. You can also use direct key mappings. ```vimscript nmap cp vip(VM-Visual-Cursors) nmap cp vip\c ``` -------------------------------- ### Create New Test Template with vim-visual-multi Source: https://github.com/mg979/vim-visual-multi/blob/master/test/README.md This snippet shows how to use a Vimscript function to create a template for a new test case within the vim-visual-multi project. The function `vm#special#commands#new_test()` generates the necessary files and structure. ```vimscript :call vm#special#commands#new_test() ``` -------------------------------- ### Vim Visual Multi: Leader Commands (Case, Search, Align) Source: https://github.com/mg979/vim-visual-multi/wiki/Mappings Mappings utilizing the leader key for changing case, toggling whole word search, transposing text, aligning cursors, and splitting/filtering regions. ```vimscript noremap c :call VM#ChangeCase() ``` ```vimscript noremap w :call VM#ToggleWholeWordSearch() ``` ```vimscript noremap t :call VM#Transpose() ``` ```vimscript noremap a :call VM#AlignCursors() ``` ```vimscript noremap s :call VM#SplitRegions() ``` ```vimscript noremap f :call VM#FilterRegions() ``` ```vimscript noremap e :call VM#TransformRegions() ``` ```vimscript noremap r :call VM#RewriteLastPattern() ``` ```vimscript noremap m :call VM#MergeRegions() ``` ```vimscript noremap d :call VM#DuplicateRegions() ``` ```vimscript noremap " :call VM#ShowVMRegisters() ``` ```vimscript noremap ` :call VM#ToolsMenu() ``` ```vimscript noremap C :call VM#CaseConversionMenu() ``` ```vimscript noremap S :call VM#SearchMenu() ``` ```vimscript noremap M :call VM#ToggleMultiline() ``` ```vimscript noremap :call VM#ToggleVMMappings() ``` ```vimscript noremap :call VM#ToggleOnlyMode() ``` -------------------------------- ### Vim Visual Multi: Customize Main Mappings Source: https://github.com/mg979/vim-visual-multi/blob/master/doc/vm-faq.txt Customize Vim Visual Multi's main mappings by initializing the 'g:VM_maps' dictionary and replacing individual mappings. Set a mapping to an empty string to disable it. ```vimscript let g:VM_maps = {} let g:VM_maps["Exit"] = '' let g:VM_maps['Find Under'] = '' let g:VM_maps['Find Subword Under'] = '' let g:VM_maps["Add Cursor Down"] = '' let g:VM_maps["Add Cursor Up"] = '' let g:VM_maps["Toggle Mappings"] = '' let g:VM_maps["Select Operator"] = '' ``` -------------------------------- ### Customize Vim-Visual-Multi Mappings Source: https://github.com/mg979/vim-visual-multi/wiki/Quick start This snippet shows how to customize the key mappings for the 'Find Under' and 'Find Subword Under' actions in the vim-visual-multi plugin. It allows users to replace the default '' mapping with '' for easier access. ```vimscript let g:VM_maps = {} let g:VM_maps['Find Under'] = '' let g:VM_maps['Find Subword Under'] = '' ``` -------------------------------- ### Define Custom Leader Dictionaries Source: https://github.com/mg979/vim-visual-multi/blob/master/doc/vm-mappings.txt Illustrates how to define a custom leader dictionary for vim-visual-multi, allowing different leader keys for normal, visual, and buffer modes. This provides granular control over mapping prefixes. ```vimscript let g:VM_leader = {'default': '\', 'visual': '\', 'buffer': 'z'} ``` -------------------------------- ### Vim: Tools Menu Access Source: https://github.com/mg979/vim-visual-multi/wiki/Special commands Provides access to various tools and functionalities of the vim-visual-multi plugin through a menu. Key mappings are provided for direct access to specific tools like registers, pasting, filtering, and region information. ```vimscript noremap ` :VMTools ``` -------------------------------- ### Change VM Theme Dynamically Source: https://github.com/mg979/vim-visual-multi/blob/master/doc/vm-settings.txt Provides a command to change the vim-visual-multi theme while Vim is running. This is useful for testing different themes or adapting to color scheme changes. ```vimscript :VMTheme ``` -------------------------------- ### Vim Visual Multi: Basic Navigation and Region Operations Source: https://github.com/mg979/vim-visual-multi/blob/master/doc/vm-mappings.txt This snippet covers fundamental commands for navigating between selected regions and manipulating them. It includes finding next/previous occurrences, moving between regions, skipping, removing, and extending cursors. ```vim n find next occurrence N find previous occurrence ] go to next selected region [ go to previous selected region fast go to next (from next page) fast go to previous (from previous page) q skip and find to next Q remove region under cursor g/ extend/move cursors with / R replace in regions, or start replace mode M toggle multiline mode ``` -------------------------------- ### Run Command at Cursors Source: https://github.com/mg979/vim-visual-multi/blob/master/doc/visual-multi.txt Allows execution of any normal, visual, or ex command at each cursor position. The default mapping is '\\z'. This enables repeating edits, operations like 'daw' or 'ciw', and the last VM normal command. ```vimscript noremap \z :call RunAtCursors() ``` -------------------------------- ### Vim Visual Multi: Region Transformation and Manipulation Commands Source: https://github.com/mg979/vim-visual-multi/blob/master/doc/vm-mappings.txt This snippet details various commands for transforming, aligning, splitting, filtering, merging, duplicating, shrinking, and enlarging regions based on patterns or expressions. It also includes options for managing regions per line and numbering. ```vim \t transpose \a align regions \< align by character \> align by regex \s subtract pattern from regions \f filter regions by pattern/expression \e transform regions with expression \r rewrite last pattern to match current region \m merge overlapping regions \d duplicate regions \- reduce regions from the sides \+ enlarge regions from the sides \L keep at most one region per line \n see |vm-numbering| \N see |vm-numbering| ``` -------------------------------- ### Vim Visual Multi: Operators Source: https://github.com/mg979/vim-visual-multi/wiki/Mappings Mappings for applying operators like yank, delete, and change at the cursors, and for finding or selecting operators. ```vimscript noremap y :call VM#Operator('y') ``` ```vimscript noremap d :call VM#Operator('d') ``` ```vimscript noremap c :call VM#Operator('c') ``` ```vimscript noremap m :call VM#FindOperator() ``` ```vimscript noremap s :call VM#SelectOperator() ``` ```vimscript noremap gs :call VM#SelectOperatorNewRegion() ``` -------------------------------- ### Enable Mouse Mappings in vim-visual-multi Source: https://github.com/mg979/vim-visual-multi/wiki/Quick start This snippet shows how to enable mouse mappings for the vim-visual-multi plugin. Setting 'g:VM_mouse_mappings' to 1 activates basic mouse interactions. Alternatively, specific nmap commands can be used to bind mouse actions like cursor placement, word selection, and column selection to plugin functions. ```vimscript let g:VM_mouse_mappings = 1 nmap (VM-Mouse-Cursor) nmap (VM-Mouse-Word) nmap (VM-Mouse-Column) ``` -------------------------------- ### Configure VM Highlight Matches Source: https://github.com/mg979/vim-visual-multi/blob/master/doc/vm-settings.txt Controls the default highlighting style for matched patterns in Vim Visual Multi. Users can set values like 'underline', 'red', or a custom highlight command. ```vimscript let g:VM_highlight_matches = 'hi Search ctermfg=228 cterm=underline' let g:VM_highlight_matches = 'hi! link Search PmenuSel' ``` -------------------------------- ### Vim Visual Multi: Insert Mode Commands in Extend Mode Source: https://github.com/mg979/vim-visual-multi/wiki/4. Motions and Modes Explains how insert mode commands behave when initiated from Vim's extend mode in the vim-visual-multi plugin. Covers insertion, appending, and changing text. ```vimscript i I a A c C ``` -------------------------------- ### Configure VM Warning Display Source: https://github.com/mg979/vim-visual-multi/blob/master/doc/vm-settings.txt Controls the display of warnings when entering Vim Visual Multi if mapping conflicts are detected. Setting this to 0 disables the warning messages. ```vimscript let g:VM_show_warnings = 0 ``` -------------------------------- ### Vim Visual Multi: Clear VM Highlight Matches Source: https://github.com/mg979/vim-visual-multi/blob/master/doc/vm-faq.txt If Vim Visual Multi quits with errors related to highlight matches, run the ':VMClear' command to resolve the issue. ```vimscript :VMClear ``` -------------------------------- ### Vim Visual Multi: Insert Mode and Operator Commands Source: https://github.com/mg979/vim-visual-multi/blob/master/doc/vm-mappings.txt This snippet outlines commands specific to insert mode and general operator commands for selecting and finding operations within regions. It includes moving between cursors in insert mode and selecting operators. ```vim move to next cursor (insert mode) move to previous cursor (insert mode) s select operator m find operator ``` -------------------------------- ### Vim Visual Multi: Integration with vim-surround and Region Movement Source: https://github.com/mg979/vim-visual-multi/blob/master/doc/vm-mappings.txt This section details commands that interact with the vim-surround plugin and provide advanced region movement capabilities. It includes using vim-surround for region manipulation and moving selections. ```vim S requires |vim-surround| plugin move all selections to the right move all selections to the left ``` -------------------------------- ### Vim Visual Multi: Vim-Surround Integration Source: https://github.com/mg979/vim-visual-multi/wiki/4. Motions and Modes Demonstrates the usage of vim-surround commands with multiple cursors in Vim's cursor and extend modes via the vim-visual-multi plugin. ```vimscript cs cS ds ys yS ```