xaizek / vim-inccomplete (License: Vim) (since 2018-12-07)
Vim plugin for #include directive completion in C family of languages.
Commit 40b8952ff2df6ae328e3b0a41f51288a278f0d38

Undo addition of closing " or > on backspace
Thanks to BTNC.

See #5 on GitHub.
Author: xaizek
Author date (UTC): 2016-11-09 15:48
Committer name: xaizek
Committer date (UTC): 2016-11-09 15:48
Parent(s): 91632597196a1672f1aa6816f202b52293a144b7
Signing key: 99DC5E4DB05F6BE2
Tree: bfcac59d77f29f77a83e22cef1f7d4113ae285c6
File Lines added Lines deleted
plugin/inccomplete.vim 14 1
File plugin/inccomplete.vim changed (mode: 100644) (index 9f15322..6ed5eaf)
1 1 " Name: inccomplete " Name: inccomplete
2 2 " Author: xaizek <xaizek@openmailbox.org> " Author: xaizek <xaizek@openmailbox.org>
3 " Version: 1.7.45
3 " Version: 1.7.46
4 4 " License: Same terms as Vim itself (see :help license) " License: Same terms as Vim itself (see :help license)
5 5 " "
6 6 " See :help inccomplete for documentation. " See :help inccomplete for documentation.
 
... ... function! s:ICInit()
64 64 " remap < and " " remap < and "
65 65 inoremap <expr> <buffer> < ICCompleteInc('<') inoremap <expr> <buffer> < ICCompleteInc('<')
66 66 inoremap <expr> <buffer> " ICCompleteInc('"') inoremap <expr> <buffer> " ICCompleteInc('"')
67 if g:inccomplete_addclosebracket == 'always'
68 inoremap <expr> <buffer> <bs> ICBackspace()
69 endif
67 70 if g:inccomplete_showdirs if g:inccomplete_showdirs
68 71 inoremap <expr> <buffer> / ICCompleteInc('/') inoremap <expr> <buffer> / ICCompleteInc('/')
69 72 inoremap <expr> <buffer> \ ICCompleteInc('\') inoremap <expr> <buffer> \ ICCompleteInc('\')
 
... ... function! ICCompleteInc(bracket)
136 139 endif endif
137 140 endfunction endfunction
138 141
142 " cleans up possibly automatically added closing bracket
143 function ICBackspace()
144 let l:line = getline('.')
145 if l:line =~ '^\s*#\s*include\s*\%(<>\|""\)' &&
146 \ l:line[:col('.') - 2] =~ '^\s*#\s*include\s*\%(<\|"\)$'
147 return "\<right>\<bs>\<bs>"
148 endif
149 return "\<bs>"
150 endfunction
151
139 152 " this is the 'omnifunc' " this is the 'omnifunc'
140 153 function! ICComplete(findstart, base) function! ICComplete(findstart, base)
141 154 let l:curbuf = s:ICGetBufferName() let l:curbuf = s:ICGetBufferName()
Hints

Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://code.reversed.top/user/xaizek/vim-inccomplete

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@code.reversed.top/user/xaizek/vim-inccomplete

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a pull request:
... clone the repository ...
... make some changes and some commits ...
git push origin master