(Change to TipImported template + severe manual clean) |
(Standard category names + minor manual clean.) |
||
(2 intermediate revisions by the same user not shown) | |||
Line 4: | Line 4: | ||
|previous=525 |
|previous=525 |
||
|next=527 |
|next=527 |
||
− | |created= |
+ | |created=2003 |
|complexity=intermediate |
|complexity=intermediate |
||
|author=Adrian von Bidder |
|author=Adrian von Bidder |
||
− | |version= |
+ | |version=6.0 |
|rating=-1/1 |
|rating=-1/1 |
||
+ | |category1=Automated Text Insertion |
||
+ | |category2=Plugin |
||
}} |
}} |
||
I suggest you first look at the script itself: {{script|id=73}} |
I suggest you first look at the script itself: {{script|id=73}} |
||
Line 21: | Line 23: | ||
call DoWordComplete() |
call DoWordComplete() |
||
set nopaste |
set nopaste |
||
− | nunmap |
+ | nunmap <F12> |
− | iunmap |
+ | iunmap <F12> |
− | nmap |
+ | nmap <F12> :call UnsetComplete()<CR> |
− | imap |
+ | imap <F12> <Esc>:call UnsetComplete()<CR>a |
echo |
echo |
||
endfun |
endfun |
||
Line 31: | Line 33: | ||
call EndWordComplete() |
call EndWordComplete() |
||
set paste |
set paste |
||
− | nunmap |
+ | nunmap <F12> |
− | iunmap |
+ | iunmap <F12> |
− | nmap |
+ | nmap <F12> :call SetComplete()<CR> |
− | imap |
+ | imap <F12> <Esc>:call SetComplete()<CR>a |
echo |
echo |
||
endfun |
endfun |
||
− | nmap |
+ | nmap <F12> :call UnsetComplete()<CR> |
− | imap |
+ | imap <F12> <Esc>:call UnsetComplete()<CR>a |
</pre> |
</pre> |
||
Line 48: | Line 50: | ||
==Comments== |
==Comments== |
||
− | |||
− | ---- |
||
− | [[Category:Automated_Text_Insertion]] |
||
− | [[Category:Plugin]] |
Latest revision as of 04:11, 16 May 2012
Tip 526 Printable Monobook Previous Next
created 2003 · complexity intermediate · author Adrian von Bidder · version 6.0
I suggest you first look at the script itself: script#73
Since the script has some problems (at least for me) when I paste text in X11 with the mouse, and since I need to switch to paste more anyway, I now use this in my vimrc:
" the word_complete.vim plugin just *rocks* autocmd VimEnter * call DoWordComplete() fun! SetComplete() call DoWordComplete() set nopaste nunmap <F12> iunmap <F12> nmap <F12> :call UnsetComplete()<CR> imap <F12> <Esc>:call UnsetComplete()<CR>a echo endfun fun! UnsetComplete() call EndWordComplete() set paste nunmap <F12> iunmap <F12> nmap <F12> :call SetComplete()<CR> imap <F12> <Esc>:call SetComplete()<CR>a echo endfun nmap <F12> :call UnsetComplete()<CR> imap <F12> <Esc>:call UnsetComplete()<CR>a
Issues
In insert mode, F12 switches to paste mode, but not back again. In normal mode, it works.