CmdlineComplete : complete command-line (: / etc.) from the current file
| script karma
Downloaded by 2700
Comments, bugs, improvements
script versions (upload new version)
|When editing the command-line (: / etc.), press Ctrl-P or Ctrl-N to complete the word before the cursor, using keywords in the current file. E.g: you want to search for "elephant" in the buffer, just type /ele and press Ctrl-P. So long as "elephant" is in the buffer, you will get "ele" completed into "elephant".
This script is functional similar with (but far more better than) SearchComplete vimscript #474 (version 1.1).
|Just drop the script file "cmdline-complete.vim" into the plugin directory. Restart VIM.
If you want to use other keys instead of default <c-p> <c-n>, you may say in your .vimrc
cmap <c-y> <Plug>CmdlineCompleteBackward
cmap <c-e> <Plug>CmdlineCompleteForward
this will use Ctrl-Y for search backward and Ctrl-E for search forward.
Note: I don't think it's good to use Tab and Shift-Tab for completion, since it will disable vim's original cmdline-completion.
Without python, speed will be a bit slow with large file (e.g. > 100K). Compile your vim with python is recommended.
Click on the package to download.
ip used for rating: 126.96.36.199