Skip to content

Instantly share code, notes, and snippets.

@seyDoggy
Created February 3, 2016 14:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save seyDoggy/5d0286fa3cd4f5e214ff to your computer and use it in GitHub Desktop.
Save seyDoggy/5d0286fa3cd4f5e214ff to your computer and use it in GitHub Desktop.
neocomplete settings
" Use neocomplete.
let g:neocomplete#enable_at_startup = 1
" Neocomplete Plugin key-mappings.
inoremap <expr><C-g> neocomplete#undo_completion()
inoremap <expr><C-l> neocomplete#complete_common_string()
" Neosnippet Recommended key-mappings.
" <CR>: close popup and save indent.
inoremap <silent> <CR> <C-r>=<SID>my_cr_function()<CR>
function! s:my_cr_function()
return neocomplete#close_popup() . "\<CR>"
endfunction
" <C-h>, <BS>: close popup and delete backword char.
inoremap <expr><C-h> neocomplete#smart_close_popup()."\<C-h>"
inoremap <expr><BS> neocomplete#smart_close_popup()."\<C-h>"
inoremap <expr><C-y> neocomplete#close_popup()
inoremap <expr><C-e> neocomplete#cancel_popup()
" Plugin key-mappings.
imap <C-k> <Plug>(neosnippet_expand_or_jump)
smap <C-k> <Plug>(neosnippet_expand_or_jump)
xmap <C-k> <Plug>(neosnippet_expand_target)
" For snippet_complete marker.
if has('conceal')
set conceallevel=2 concealcursor=i
endif
" <tab> mapping
imap <expr><TAB>
\ neosnippet#expandable_or_jumpable() ? "\<Plug>(neosnippet_expand_or_jump)" :
\ emmet#isExpandable() ? emmet#expandAbbrIntelligent("\<tab>") :
\ pumvisible() ? "\<C-n>" :
\ "\<TAB>"
smap <expr><TAB>
\ neosnippet#expandable_or_jumpable() ? "\<Plug>(neosnippet_expand_or_jump)" :
\ emmet#isExpandable() ? emmet#expandAbbrIntelligent("\<tab>") :
\ "\<TAB>"
" Multiple Cursors - Called once right before you start selecting multiple cursors
function! Multiple_cursors_before()
if exists(':NeoCompleteLock')==2
exe 'NeoCompleteLock'
endif
endfunction
" Multiple Cursors - Called once only when the multiple selection is canceled (default <Esc>)
function! Multiple_cursors_after()
if exists(':NeoCompleteUnlock')==2
exe 'NeoCompleteUnlock'
endif
endfunction
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment