inoremap <F5> <C-R>=ListMonths()<CR>
func! ListMonths()
call complete(col('.'), ['January', 'February', 'March',
\ 'April', 'May', 'June', 'July', 'August', 'September',
\ 'October', 'November', 'December'])
return ''
endfunc
Found it! Tucked away in that Grimoire they are trying to tell us are docs =)
======================= My final script is something like
inoremap <F5> <C-R>=CustomComplete()<CR>
func! CustomComplete()
echom 'move to start of last word'
normal b
echom 'select word under cursor'
let b:word = expand('<cword>')
echom '->'.b:word.'<-'
echom 'save position'
let b:position = col('.')
echom '->'.b:position.'<-'
normal e
normal l
echom 'move to end of word'
let b:list = ["spoogle","spangle","frizzle"]
let b:matches = []
echom 'begin checking for completion'
for item in b:list
echom 'checking '
echom '->'.item.'<-'
if(match(item,'^'.b:word)==0)
echom 'adding to matches'
echom '->'.item.'<-'
call add(b:matches,item)
endif
endfor
call complete(b:position, b:matches)
return ''
endfunc
I don't think you can disable it, but you could use a mapping and append <CR>
:
map <F4> :!mv file1 file2<CR><CR>
Best Answer
You may move up and down through the commands saved in Vim's command history by using the Up and Down keys after having typed :.
If you enter the start of a command and press Up, Vim will give you the most recent saved command with the same prefix string. In this respect it works in the reverse order from what Bash uses in that you first type in a bit of a command and then press Up (rather than, as in Bash, first press Ctrl+R and then type something).
This also works for search strings.