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

Allow g:inccomplete_localsources to include paths
Author: xaizek
Author date (UTC): 2020-01-09 17:20
Committer name: xaizek
Committer date (UTC): 2020-01-09 17:20
Parent(s): 5e44b84adfe62e98eb9dab6220f69ba6cd36a16d
Signing key: 99DC5E4DB05F6BE2
Tree: fce36e3563e6aedda511e4a6c1ffc5fb0a650382
File Lines added Lines deleted
doc/inccomplete.txt 4 1
plugin/inccomplete.vim 14 10
File doc/inccomplete.txt changed (mode: 100644) (index 921c1a6..e97c248)
1 *inccomplete.txt* For Vim version 7.3. Last change: 2019 Apr 19
1 *inccomplete.txt* For Vim version 7.3. Last change: 2020 Jan 9
2 2
3 3
4 4 inccomplete plugin documentation by xaizek inccomplete plugin documentation by xaizek
 
... ... items:
155 155 - 'relative-paths' to complete paths relative to location of current buffer - 'relative-paths' to complete paths relative to location of current buffer
156 156 - 'clang-buffer' to complete paths from '-I' keys in b:clang_user_options - 'clang-buffer' to complete paths from '-I' keys in b:clang_user_options
157 157 - 'clang-global' to complete paths from '-I' keys in g:clang_user_options - 'clang-global' to complete paths from '-I' keys in g:clang_user_options
158 - paths to directories to complete from (the path needs to include slash
159 somewhere and be an existing directory)
158 160
159 161 ============================================================================== ==============================================================================
160 162 3. ToDo *inccomplete-todo* 3. ToDo *inccomplete-todo*
 
... ... items:
165 167 buffer instead of assuming that working directory is correct? buffer instead of assuming that working directory is correct?
166 168 - Add optional caching for local includes (ones in the double quotes). - Add optional caching for local includes (ones in the double quotes).
167 169 - Maybe filter out includes that already present in the buffer. - Maybe filter out includes that already present in the buffer.
170 - Can we follow symbolic links on completion?
168 171
169 172 vim:tw=78:ts=8:ft=help:norl: vim:tw=78:ts=8:ft=help:norl:
File plugin/inccomplete.vim changed (mode: 100644) (index b2d12b0..c4edf0e)
1 1 " Name: inccomplete " Name: inccomplete
2 2 " Author: xaizek <xaizek@posteo.net> " Author: xaizek <xaizek@posteo.net>
3 " Version: 1.8.52
3 " Version: 1.8.53
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.
 
... ... endfunction
391 391 " ""-completion " ""-completion
392 392 function! s:ICGetUserSources() function! s:ICGetUserSources()
393 393 let l:dirs = [] let l:dirs = []
394 if index(g:inccomplete_localsources, 'relative-paths') >= 0
395 let l:dirs += [s:ICGetDir()]
396 endif
397 if index(g:inccomplete_localsources, 'clang-buffer') >= 0
398 let l:dirs = s:ICAddNoDupPaths(l:dirs, s:ICGetClangIncludes(1))
399 endif
400 if index(g:inccomplete_localsources, 'clang-global') >= 0
401 let l:dirs = s:ICAddNoDupPaths(l:dirs, s:ICGetClangIncludes(0))
402 endif
394
395 for l:source in g:inccomplete_localsources
396 if l:source ==# 'relative-paths'
397 let l:dirs += [s:ICGetDir()]
398 elseif l:source ==# 'clang-buffer'
399 let l:dirs = s:ICAddNoDupPaths(l:dirs, s:ICGetClangIncludes(1))
400 elseif l:source ==# 'clang-global'
401 let l:dirs = s:ICAddNoDupPaths(l:dirs, s:ICGetClangIncludes(0))
402 elseif l:source ~= '/' && isdirectory(l:source)
403 let l:dirs += [ l:source ]
404 endif
405 endfor
406
403 407 if exists('b:inccomplete_root') if exists('b:inccomplete_root')
404 408 let l:dirs = s:ICAddNoDupPaths(l:dirs, [b:inccomplete_root]) let l:dirs = s:ICAddNoDupPaths(l:dirs, [b:inccomplete_root])
405 409 endif endif
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