xaizek / vim-includefixer (License: BSLv1) (since 2018-12-07)
Vim plugin to automatically categorize and alphabetize #include headers
Commit 8d542d8db89d522912e0c3ececa8c00d92684ed3

Add <system> kind of includes
Author: xaizek
Author date (UTC): 2016-09-03 19:14
Committer name: xaizek
Committer date (UTC): 2016-09-03 19:14
Parent(s): 313ff4038414c31a08a584696729d6e449991ef2
Signing key: 99DC5E4DB05F6BE2
Tree: 14158ecdf52327b8e1a1a19bdf255ddde9be9006
File Lines added Lines deleted
plugin/includefixer.vim 8 0
File plugin/includefixer.vim changed (mode: 100644) (index 6a219ba..16365f6)
... ... function! s:IsCxxStd(include)
139 139 return 0 return 0
140 140 endfunction endfunction
141 141
142 function! s:IsSystem(include)
143 return a:include =~# '<[^>]\+>'
144 endfunction
145
142 146 function! s:SetupCustom(list) function! s:SetupCustom(list)
143 147 if exists('g:include_fixer_custom') == 0 if exists('g:include_fixer_custom') == 0
144 148 return return
 
... ... function! s:FixIncludes()
209 213 let l:qt = [] let l:qt = []
210 214 let l:cstd = [] let l:cstd = []
211 215 let l:cxxstd = [] let l:cxxstd = []
216 let l:system = []
212 217 let l:custom = [] let l:custom = []
213 218 call <SID>SetupCustom(l:custom) call <SID>SetupCustom(l:custom)
214 219
 
... ... function! s:FixIncludes()
227 232 call add(l:cstd,l:i) call add(l:cstd,l:i)
228 233 elseif <SID>IsCxxStd(l:i) elseif <SID>IsCxxStd(l:i)
229 234 call add(l:cxxstd,l:i) call add(l:cxxstd,l:i)
235 elseif <SID>IsSystem(l:i)
236 call add(l:system,l:i)
230 237 elseif <SID>IsCustom(l:custom,l:i) elseif <SID>IsCustom(l:custom,l:i)
231 238 else else
232 239 call add(l:local,l:i) call add(l:local,l:i)
 
... ... function! s:FixIncludes()
235 242
236 243 " write out all the groups " write out all the groups
237 244 let l:next = <SID>WriteOut(l:start,l:module) let l:next = <SID>WriteOut(l:start,l:module)
245 let l:next = <SID>WriteOut(l:next,l:system)
238 246 let l:next = <SID>WriteOut(l:next,l:local) let l:next = <SID>WriteOut(l:next,l:local)
239 247
240 248 let l:i = 0 let l:i = 0
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-includefixer

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

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