Skip to content

Instantly share code, notes, and snippets.

@akemrir
Created August 3, 2022 19:04
Show Gist options
  • Save akemrir/17e27ee30adbf45ae364fb2c39be6a06 to your computer and use it in GitHub Desktop.
Save akemrir/17e27ee30adbf45ae364fb2c39be6a06 to your computer and use it in GitHub Desktop.

Revisions

  1. Karol created this gist Aug 3, 2022.
    64 changes: 64 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,64 @@
    " # 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()