PatternComplete : Insert mode completion for matches of queried / last search pattern.
| script karma |
Rating 1/1,
Downloaded by 65
|
Comments, bugs, improvements
|
Vim wiki
|
| created by |
| Ingo Karkat |
| |
| script type |
| utility |
| |
| description |
DESCRIPTION
This plugin offers completions that either use the last search pattern or
query for a regular expression, and then offer all matches for completion.
No completion base is used.
Without this plugin, you can just directly insert the contents of the last
search pattern register via CTRL-R /, but the register can contain \<word\>
boundary characters from a star search or other non-literal regexp atoms
like \V, .*, etc., which you usually don't want inserted into the text.
SEE ALSO
- Check out the CompleteHelper.vim plugin page (vimscript #3914) for a full
list of insert mode completions powered by it.
USAGE
CTRL-X / The completion first queries for {pattern} (press
<Enter> to conclude), then finds matches for
{pattern}.
CTRL-X * The completion first queries for {pattern} (press
<Enter> to conclude), then finds matches for
\<{pattern}\>, or {pattern} surrounded by whitespace
as a fallback.
CTRL-X & Find matches for the last search pattern, quote/.
CTRL-R & Insert first match for the last search pattern
quote/ into the command-line. |
| |
| install details |
INSTALLATION
This script is packaged as a vimball. If you have the "gunzip" decompressor
in your PATH, simply edit the *.vmb.gz package in Vim; otherwise, decompress
the archive first, e.g. using WinZip. Inside Vim, install by sourcing the
vimball or via the :UseVimball command.
vim PatternComplete*.vmb.gz
:so %
To uninstall, use the :RmVimball command.
DEPENDENCIES
- Requires Vim 7.0 or higher.
- Requires the CompleteHelper.vim plugin (vimscript #3914).
CONFIGURATION
For a permanent configuration, put the following commands into your vimrc:
Analoguous to the 'complete' option, you can specify which buffers will be
scanned for completion candidates. Currently, '.' (current buffer), 'w'
(buffers from other windows), and 'b' (other listed buffers) are supported.
let g:PatternComplete_complete = '.,w,b'
The global setting can be overridden for a particular buffer
(b:PatternComplete_complete).
If you want to use different mappings, map your keys to the
<Plug>(PatternComplete) mapping targets _before_ sourcing the script (e.g.
in your vimrc):
imap <C-x>/ <Plug>(PatternCompleteInput)
imap <C-x>* <Plug>(PatternCompleteWordInput)
imap <C-x>& <Plug>(PatternCompleteSearch)
cmap <C-r>& <Plug>(PatternCompleteSearchMatch) |
| |
script versions (upload new version)
Click on the package to download.
ip used for rating: 107.20.129.212
|