All Projects → machakann → vim-multiselect

machakann / vim-multiselect

Licence: MIT license
A library plugin to handle multiple visual selections

Programming Languages

Vim Script
2826 projects

Projects that are alternatives of or similar to vim-multiselect

miniSnip
Lightweight snippet plugin for Vim
Stars: ✭ 45 (+66.67%)
Mutual labels:  vim-plugin
skim.vim
vim support for skim
Stars: ✭ 127 (+370.37%)
Mutual labels:  vim-plugin
vim-syntax-christmas-tree
Vim filetype plugin for X'mas
Stars: ✭ 20 (-25.93%)
Mutual labels:  vim-plugin
vim-mdnquery
Query the Mozilla Developer Network documentation without leaving Vim
Stars: ✭ 19 (-29.63%)
Mutual labels:  vim-plugin
vim9-stargate
modern alternative to easymotion written in vim9
Stars: ✭ 76 (+181.48%)
Mutual labels:  vim-plugin
vim-viler
Editable file explorer for Vim
Stars: ✭ 24 (-11.11%)
Mutual labels:  vim-plugin
vim-readme-viewer
📖 Viewing plugin's README easily like vim help
Stars: ✭ 26 (-3.7%)
Mutual labels:  vim-plugin
doorboy.vim
Vim plugin for auto closing brackets ( => (|) and quotations " => "|" , and more
Stars: ✭ 19 (-29.63%)
Mutual labels:  vim-plugin
vim-emberlayout
Open Ember files in a grid
Stars: ✭ 18 (-33.33%)
Mutual labels:  vim-plugin
bash-support
Edit Bash scripts in Vim/gVim. Insert code snippets, run, check, and debug the code and look up help.
Stars: ✭ 76 (+181.48%)
Mutual labels:  vim-plugin
vim-plugin-ruscmd
Vim plugin: support command mode in Russian keyboard layout
Stars: ✭ 60 (+122.22%)
Mutual labels:  vim-plugin
stable-windows
Keeps vim windows stable on layout changes
Stars: ✭ 41 (+51.85%)
Mutual labels:  vim-plugin
Extract
👻 Neovim yank ring plugin with completion for registers, ring, pinning, and replacing with register.
Stars: ✭ 39 (+44.44%)
Mutual labels:  vim-plugin
vim-pairs
Punctuation text objects: ci/ da; vi@ yiq da<space> ...
Stars: ✭ 35 (+29.63%)
Mutual labels:  vim-plugin
vim-sass-colors
sass/scss/less/css color literal and color variable highlighting (works with imports)
Stars: ✭ 24 (-11.11%)
Mutual labels:  vim-plugin
PICO-8.vim
A vim plugin package for PICO-8 programming.
Stars: ✭ 42 (+55.56%)
Mutual labels:  vim-plugin
vim-strip-trailing-whitespace
🎞️ Vim plugin that removes trailing whitespace from *modified* lines on save
Stars: ✭ 66 (+144.44%)
Mutual labels:  vim-plugin
vim
个人私用的vim配置
Stars: ✭ 12 (-55.56%)
Mutual labels:  vim-plugin
vim-plugin-autosess
Vim plugin: auto save/load sessions
Stars: ✭ 32 (+18.52%)
Mutual labels:  vim-plugin
ime.vim
A Vim input method engine
Stars: ✭ 74 (+174.07%)
Mutual labels:  vim-plugin

vim-multiselect

A library plugin to handle multiple visual selections

!!! This is a highly experimental plugin. Its behavior might be changed a lot for future. !!!

Mission

To explore a new ability of Vim to edit texts, here is a conceptual implementation to handle multiple selections. This plugin itself provides only basic functions to select and unselect regions on a buffer, and the further editing operations would be supplied by other external plugins (vim-masquerade). Its Application Programming Interfaces are opened. Hope it would spawn fresh ideas!

Dependency

  • Vim 8.0 or higher

Usage

This plugin does not define default keymappings. Thus you should make your keymappings as you prefer.

Check

Use <Plug>(multiselect), <Plug>(multiselect-check), <Plug>(multiselect-checksearched) to select regions on a buffer.

<Plug>(multiselect) selects a word under the cursor over the current buffer.

nmap <Space>v <Plug>(multiselect)
xmap <Space>v <Plug>(multiselect)

<Plug>(multiselect-check) selects a word under the cursor.

nmap <Space>v <Plug>(multiselect-check)
xmap <Space>v <Plug>(multiselect-check)

<Plug>(multiselect-checksearched) selects texts matching with the last searched pattern.

nmap @/ <Plug>(multiselect-checksearched)
xmap @/ <Plug>(multiselect-checksearched)

Broadcasting textobjects

Another way is to use a series of wrapped textobjects, broadcasting textobjects. This textobject works just as the original textobject does, except in only linewise-visual mode. In line-wise visual mode, it tries to use the original textobject for each lines of selection at the cursor column. If it is succeeded, the region will be multiselected. :help multiselect-broadcasting-textobject

xmap iw <Plug>(multiselect-iw)
xmap i( <Plug>(multiselect-i()
xmap i' <Plug>(multiselect-i')

demo:broadcasting textobjects

Uncheck

Use <Plug>(multiselect-uncheck) or <Plug>(multiselect-uncheckall) to unselect the selections.

<Plug>(multiselect-uncheck) unselects a selection under the cursor.

nmap <Space>V <Plug>(multiselect-uncheck)
xmap <Space>V <Plug>(multiselect-uncheck)

<Plug>(multiselect-uncheckall) unselects all selections.

nmap <Space>V <Plug>(multiselect-uncheckall)
xmap <Space>V <Plug>(multiselect-uncheckall)

Example

There is an example in macros/multiselect/keymap/ directry. You also can use it by copying the lines into your vimrc or by :runtime command.

runtime macros/multiselect/keymap/example1.vim

It defines the keymappings like:

nmap <Space>v <Plug>(multiselect)
xmap <Space>v <Plug>(multiselect)
nmap <Space>V <Plug>(multiselect-uncheckall)
xmap <Space>V <Plug>(multiselect-uncheck)
nmap @/ <Plug>(multiselect-checksearched)
xmap @/ <Plug>(multiselect-checksearched)
map [v <Plug>(multiselect-previous)
map ]v <Plug>(multiselect-next)

Got interested?

Check out vim-masquerade!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].