sponsor Vim development Vim logo Vim Book Ad

LineEndComplete : Insert mode completion that completes the rest of the line.

 script karma  Rating 10/4, Downloaded by 1069  Comments, bugs, improvements  Vim wiki

created by
Ingo Karkat
 
script type
utility
 
description
DESCRIPTION
The i_CTRL-X_CTRL-L completion completes entire, identical lines. Sometimes,
you need completion of an almost-identical line with differences in indent or
a prefix string.
This plugin provides a completion mapping that takes the base text before the
cursor, and offers the missing parts of other lines that also have this base
text. If you know the exact common text, or to whittle down the number of
matches, you can also select the completion base yourself before invoking the
mapping.

SEE ALSO
- Check out the CompleteHelper.vim plugin page (vimscript #3914) for a full
  list of insert mode completions powered by it.

USAGE
In insert mode, invoke the completion via CTRL-X $.
Alternatively, you can pre-select the base (via select or visual mode) before
invoking the completion. This ensures that the best context for completion is
chosen.

You can then search forward and backward via CTRL-N / CTRL-P, as usual.

CTRL-X $                Find matches starting with the MotionComplete-base
                        text before the cursor, until the end of that line.

{Visual}CTRL-X $        Find matches starting with the selected text, until
                        the end of that 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 LineEndComplete*.vmb.gz
    :so %
To uninstall, use the :RmVimball command.

DEPENDENCIES
- Requires Vim 7.0 or higher.
- Requires the MotionComplete.vim plugin (vimscript #4265).

CONFIGURATION
The general MotionComplete-configuration applies here, too.

For a permanent configuration, put the following commands into your vimrc:

If you want to use different mappings, map your keys to the
<Plug>(LineEndComplete...) mapping targets _before_ sourcing the script
(e.g. in your vimrc):
    imap <C-x>$ <Plug>(LineEndComplete)
    vmap <C-x>$ <Plug>(LineEndComplete)
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
LineEndComplete-1.00.vmb.gz 1.00 2012-10-12 7.0 Ingo Karkat Initial upload
ip used for rating: 142.132.191.50

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
Vim at Github