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

Fix completing of <a/b/...> on Windows
Author: xaizek
Author date (UTC): 2012-02-03 20:32
Committer name: xaizek
Committer date (UTC): 2012-02-03 20:32
Parent(s): 4394b1dbff0453819640532754a2e11c5ee53dc4
Signing key:
Tree: 4794d6bed7a8e67a6b8dbf3dbf4b15efe4677713
File Lines added Lines deleted
plugin/inccomplete.vim 16 3
File plugin/inccomplete.vim changed (mode: 100644) (index d55ec91..7b646ce)
1 1 " Name: inccomplete " Name: inccomplete
2 2 " Author: xaizek <xaizek@gmail.com> " Author: xaizek <xaizek@gmail.com>
3 " Version: 1.6.24
3 " Version: 1.6.25
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! ICComplete(findstart, base)
139 139 let l:item = { let l:item = {
140 140 \ 'word': l:increc[1].l:bracket, \ 'word': l:increc[1].l:bracket,
141 141 \ 'abbr': l:increc[1].l:slash, \ 'abbr': l:increc[1].l:slash,
142 \ 'menu': fnamemodify(l:increc[0], ':p:.'),
143 \ 'dup': 1
142 \ 'menu': s:ICModifyPath(l:increc[0]),
143 \ 'dup': 0
144 144 \} \}
145 145 call add(l:comlst, l:item) call add(l:comlst, l:item)
146 146 endfor endfor
 
... ... function s:Comparer(i1, i2)
168 168 \ (a:i1['abbr'] ># a:i2['abbr'] ? 1 : -1) \ (a:i1['abbr'] ># a:i2['abbr'] ? 1 : -1)
169 169 endfunction endfunction
170 170
171 " modifies path correctly on Windows
172 function! s:ICModifyPath(path)
173 let l:drive_regexp = '\C^[a-zA-Z]:'
174 let l:modified = fnamemodify(a:path, ':p:.')
175 let l:prefix = ''
176 if has('win32') && a:path =~ l:drive_regexp && !empty(l:modified)
177 let l:prefix = matchstr(a:path, l:drive_regexp)
178 endif
179 return l:prefix.l:modified
180 endfunction
181
171 182 " filters search results " filters search results
172 183 function! s:ICFilterIncLst(user, inclst, base) function! s:ICFilterIncLst(user, inclst, base)
173 184 let [l:pos, l:sl1, l:sl2] = s:ICParsePath(a:base) let [l:pos, l:sl1, l:sl2] = s:ICParsePath(a:base)
 
... ... function! s:ICGetClangIncludes()
331 342 let l:lst = split(b:clang_user_options.' '.g:clang_user_options, ' ') let l:lst = split(b:clang_user_options.' '.g:clang_user_options, ' ')
332 343 let l:lst = filter(l:lst, 'v:val =~ "\\C^-I"') let l:lst = filter(l:lst, 'v:val =~ "\\C^-I"')
333 344 let l:lst = map(l:lst, 'v:val[2:]') let l:lst = map(l:lst, 'v:val[2:]')
345 let l:lst = map(l:lst, 'fnamemodify(v:val, ":p")')
346 let l:lst = map(l:lst, 'substitute(v:val, "\\\\", "/", "g")')
334 347 return l:lst return l:lst
335 348 endfunction endfunction
336 349
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