On Thu, Mar 06, 2003 at 02:32:57PM -0700, Michael Brailsford wrote: > > At one point hans gave me a tab completion script. Very nice... now if > > only I knew where I put it. > > There are a few such tab completion scripts on vim.sf.net. I just use > the simple one that was posted above. It just maps tab to <c-p> if the > the char right before the cursor is a word character.
CORRECTION:
I use this tab completion script.
function! InsertTabWrapper()
let col = col('.') - 1
if !col || getline('.')[col - 1] !~ '\k'
return "\<tab>"
else
return "\<c-p>"
endif
endfunction
Then I map:
inoremap <silent> <tab> <c-r>=InsertTabWrapper()<cr>
-- and --
inoremap <s-tab> <tab>
--
Michael
GnuPG Fingerprint: 4C56 7C23 8BD9 8B39 C4D4 B8F3 42FB 3634 31B5 E963
pgp00000.pgp
Description: PGP signature
