Skip to content

Instantly share code, notes, and snippets.

@akemrir
Created August 3, 2022 19:04
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 akemrir/17e27ee30adbf45ae364fb2c39be6a06 to your computer and use it in GitHub Desktop.
Save akemrir/17e27ee30adbf45ae364fb2c39be6a06 to your computer and use it in GitHub Desktop.
vim minisnip minimal
" # VIMRC minisnip sample #
if &compatible
set nocompatible
endif
filetype plugin indent on
syntax enable
let mapleader = "\<Space>"
if &shell =~# 'fish$'
set shell=sh
endif
set path=**,./
set tags+=.git/tags
call plug#begin('~/.vim/plugged')
Plug 'Shougo/ddc.vim'
Plug 'Shougo/ddc-matcher_head'
Plug 'Shougo/ddc-converter_remove_overlap'
Plug 'Shougo/ddc-sorter_rank'
Plug 'vim-denops/denops.vim'
Plug 'akemrir/ddc-tags-exec'
Plug 'akemrir/ddc-minisnip'
" Plug 'Jorengarenar/miniSnip'
Plug '~/code/miniSnip'
call plug#end()
let g:miniSnip_dirs = [expand('~/.vim/miniSnip')]
let g:miniSnip_trigger = '<c-s>'
let g:miniSnip_expandpattern = '[a-zA-Z0-9_-]'
" Use around source.
call ddc#custom#patch_global('sources', ['minisnip'])
call ddc#custom#patch_global('sourceOptions', {
\ '_': {
\ 'converters': ['converter_remove_overlap'],
\ 'matchers': ['matcher_head'],
\ 'sorters': ['sorter_rank'],
\ 'minAutoCompleteLength': 1
\ }})
call ddc#custom#patch_global('sourceOptions', {
\ 'minisnip': {
\ 'mark': 'µ',
\ 'minAutoCompleteLength': 0
\ }})
call ddc#custom#patch_global('sourceParams', {
\ 'minisnip': { 'home': $HOME, 'dirs': g:miniSnip_dirs }
\ })
" " <TAB>: completion.
" inoremap <silent><expr> <TAB>
" \ pumvisible() ? '<C-n>' :
" \ (col('.') <= 1 <Bar><Bar> getline('.')[col('.') - 2] =~# '\s') ?
" \ '<TAB>' : ddc#manual_complete()
" " <S-TAB>: completion back.
" inoremap <expr><S-TAB> pumvisible() ? '<C-p>' : '<C-h>'
" Use ddc.
call ddc#enable()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment