xaizek / vim-inccomplete (License: Vim) (since 2018-12-07)
Vim plugin for #include directive completion in C family of languages.
<root> / autoload / inccomplete.vim (a099346269fd07664528d2e986792b8bd0f365d4) (19KiB) (mode 100644) [raw]
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617
" Name:            inccomplete
" Author:          xaizek <xaizek@posteo.net>
" License:         Same terms as Vim itself (see :help license)
"
" See :help inccomplete for documentation.

let g:inccomplete_cache = {}

if !exists('g:inccomplete_autoselect')
    let g:inccomplete_autoselect = 1
endif

if !exists('g:inccomplete_findcmd')
    let g:inccomplete_findcmd = ''
endif

if !exists('g:inccomplete_addclosebracket')
    let g:inccomplete_addclosebracket = 'always'
endif

if !exists('g:inccomplete_sort')
    let g:inccomplete_sort = ''
endif

if !exists('g:inccomplete_showdirs')
    let g:inccomplete_showdirs = 0
endif

if !exists('g:inccomplete_appendslash')
    let g:inccomplete_appendslash = 0
endif

if !exists('g:inccomplete_localsources')
    let g:inccomplete_localsources = [ 'relative-paths' ]
endif

function! inccomplete#ICInstallAutocommands()
    augroup inccomplete
        autocmd! BufRead,BufEnter,FileType * call s:ICInit()
    augroup END

    " VimEnter autocommand is executed after other autocommands we're
    " interested in, thus we need to do this for file passed on the command
    " line manually
    call s:ICInit()
endfunction

" maps <, ", / and \, sets 'omnifunc'
function! s:ICInit()
    " leave fast if we don't need to do anything for the buffer
    if !s:ICIsBufferSupported() || &l:omnifunc ==# 'ICComplete'
        return
    endif

    " remap < and "
    inoremap <expr> <buffer> < ICCompleteInc('<')
    inoremap <expr> <buffer> " ICCompleteInc('"')
    if g:inccomplete_showdirs
        inoremap <expr> <buffer> / ICCompleteInc('/')
        inoremap <expr> <buffer> \ ICCompleteInc('\')
    endif

    " save current 'omnifunc'
    let l:curbuf = s:ICGetBufferName()
    if !exists('s:oldomnifuncs')
        let s:oldomnifuncs = {}
    endif
    let s:oldomnifuncs[l:curbuf] = &omnifunc

    " force menuone. Without it, when there's only one completion result,
    " it can be confusing (not completing and no popup)
    if g:inccomplete_autoselect != 2
        setlocal completeopt-=menu
        setlocal completeopt+=menuone
    endif

    " set our omnifunc
    setlocal omnifunc=ICComplete
endfunction

" checks whether the plugin should be active in current buffer
function s:ICIsBufferSupported()
    for l:component in split(&l:filetype, '\.')
        if index(['c', 'cpp'], l:component) != -1
            return 1
        endif
    endfor
    return 0
endfunction

" checks whether we need to do completion after <, ", / or \ and starts it when
" we do
function! ICCompleteInc(bracket)
    let l:keycomp = "\<c-x>\<c-o>"
    if g:inccomplete_autoselect != 2
        let l:keycomp .= "\<c-p>"
        if g:inccomplete_autoselect == 1
            let l:keycomp .= "\<c-r>=(pumvisible() ? \"\\<down>\" : '')\<cr>"
        endif
    endif

    if a:bracket == '/' || a:bracket == '\'
        " complete when there are no closing character or we're right before
        " it
        let l:curline = getline('.')
        if l:curline =~ '^\s*#\s*include\s*["<][^">]*$' ||
         \ (l:curline =~ '^\s*#\s*include\s*["<][^">]*[">]$' &&
          \ (l:curline[col('.') - 1] == '"' || l:curline[col('.') - 1 ] == '>'))
            return a:bracket.l:keycomp
        endif
    endif

    " is it #include directive?
    if getline('.') !~ '^\s*#\s*include\s*$'
        return a:bracket
    endif

    if g:inccomplete_addclosebracket == 'always'
        " determine close bracket
        let l:closebracket = ['"', '>'][a:bracket == '<']

        " put brackets and start completion
        return a:bracket.l:closebracket."\<left>".l:keycomp
    else
        " put bracket and start completion
        return a:bracket.l:keycomp
    endif
endfunction

" this is the 'omnifunc'
function! ICComplete(findstart, base)
    let l:curbuf = s:ICGetBufferName()
    if a:findstart
        " did user request #include completion?
        let s:passnext = getline('.') !~ '^\s*#\s*include\s*\%(<\|"\)'
        if !s:passnext
            return match(getline('.'), '<\|"') + 1
        endif

        " no, call other omnifunc if there is one
        if !has_key(s:oldomnifuncs, l:curbuf)
            return col('.') - 1
        endif
        return eval(s:oldomnifuncs[l:curbuf].
                  \ "(".a:findstart.",'".a:base."')")
    elseif exists('s:passnext') && s:passnext
        " call previous 'omnifunc' when needed
        if !has_key(s:oldomnifuncs, l:curbuf)
            return []
        endif
        return eval(s:oldomnifuncs[l:curbuf].
                  \ "(".a:findstart.",'".a:base."')")
    else
        let l:pos = match(getline('.'), '<\|"')
        let l:bracket = getline('.')[l:pos : l:pos]

        if empty(a:base) && l:bracket == '<' && exists('s:fullCached')
            return s:fullCached
        endif

        let l:old_cwd = getcwd()
        lcd %:p:h

        " get list of all candidates and reduce it to those starts with a:base
        let l:inclst = s:ICGetList(l:bracket == '"', a:base)
        let l:inclst = s:ICFilterIncLst(l:bracket == '"', l:inclst, a:base)

        if g:inccomplete_addclosebracket != 'always'
            " determine close bracket
            let l:closebracket = ['"', '>'][l:bracket == '<']
            if getline('.')[l:pos + 1 :] =~ l:closebracket.'\s*$'
                let l:closebracket = ''
            endif
        else
            let l:closebracket = ''
        endif

        " form list of dictionaries
        let [l:pos, l:sl1, l:sl2] = s:ICParsePath(a:base)
        let l:comlst = []
        for l:increc in l:inclst
            if empty(l:increc[1])
                continue
            endif

            let l:isdir = isdirectory(l:increc[0].'/'.l:increc[1])
            if l:isdir
                let l:slashidx = strridx(l:increc[1], l:sl2)
                if l:increc[1][l:slashidx + 1] == '.'
                    continue
                endif

                let l:strend = g:inccomplete_appendslash ? l:sl2 : ''
                let l:slash = l:sl2
            else
                let l:strend = l:closebracket
                let l:slash = ''
            endif

            " XXX: set 'kind' to 'd'/'f' to indicate directory/file?  
            let l:item = {
                        \ 'word': l:increc[1].l:strend,
                        \ 'abbr': l:increc[1].l:slash,
                        \ 'menu': s:ICModifyPath(l:increc[0]),
                        \ 'dup': 0,
                        \ 'dir': l:isdir
                        \}
            call add(l:comlst, l:item)
        endfor

        execute 'lcd' l:old_cwd

        let l:result = s:SortList(l:comlst)

        if empty(a:base) && l:bracket == '<'
            let s:fullCached = l:result
        endif

        return l:result
    endif
endfunction

" sorts completion list
function s:SortList(lst)
    if g:inccomplete_sort == 'ignorecase'
        return sort(a:lst, 's:IgnoreCaseComparer')
    else
        return sort(a:lst, 's:Comparer')
    endif
endfunction
function s:IgnoreCaseComparer(i1, i2)
    if a:i1['dir'] != a:i2['dir']
        return a:i1['dir'] ? -1 : 1
    endif
    if a:i1['menu'] != a:i2['menu']
        return a:i1['menu'] < a:i2['menu'] ? -1 : 1
    endif
    return a:i1['abbr'] == a:i2['abbr'] ? 0 :
                \ (a:i1['abbr'] > a:i2['abbr'] ? 1 : -1)
endfunction
function s:Comparer(i1, i2)
    if a:i1['dir'] != a:i2['dir']
        return a:i1['dir'] ? -1 : 1
    endif
    if a:i1['menu'] != a:i2['menu']
        return a:i1['menu'] < a:i2['menu'] ? -1 : 1
    endif
    return a:i1['abbr'] ==# a:i2['abbr'] ? 0 :
                \ (a:i1['abbr'] ># a:i2['abbr'] ? 1 : -1)
endfunction

" modifies path correctly on Windows
function! s:ICModifyPath(path)
    let l:drive_regexp = '\C^[a-zA-Z]:'
    let l:modified = fnamemodify(a:path, ':p:.')
    let l:prefix = ''
    if has('win32') && a:path =~ l:drive_regexp && !empty(l:modified)
        let l:prefix = matchstr(a:path, l:drive_regexp)
    endif
    return l:prefix.l:modified
endfunction

" filters search results
function! s:ICFilterIncLst(user, inclst, base)
    let [l:pos, l:sl1, l:sl2] = s:ICParsePath(a:base)

    " filter by filename
    let l:filebegin = a:base[strridx(a:base, l:sl2) + 1:]
    let l:inclst = filter(copy(a:inclst),
                        \ '!empty(v:val[1]) && v:val[1] =~ "^".l:filebegin')

    " correct slashes in paths
    if l:sl1 == '/'
        call map(l:inclst, '[substitute(v:val[0], "\\\\", "/", "g"), v:val[1]]')
    else
        call map(l:inclst, '[substitute(v:val[0], "/", "\\\\", "g"), v:val[1]]')
    endif

    " handle multicomponent paths (e.g. "a/...", <boost/...>)
    if l:pos >= 0
        let l:lst = []
        for l:dir in s:ICGetUserSources()
            let l:lst += s:ICFilter(a:user, l:inclst, a:base, l:dir)
        endfor
        let l:inclst = l:lst
    endif

    return l:inclst
endfunction

" filters multicomponent paths
function! s:ICFilter(user, inclst, base, dir)
    let [l:pos, l:sl1, l:sl2] = s:ICParsePath(a:base)

    let l:inclst = copy(a:inclst)

    " filter by subdirectory name
    let l:dirend0 = a:base[:l:pos]
    if a:user
        let l:dirend1 = fnamemodify(s:ICChosp(a:dir).'/'.l:dirend0, ':p')
    else
        let l:dirend1 = l:dirend0
    endif
    if l:sl1 == '/'
        let l:dirend2 = substitute(l:dirend1, "\\\\", "/", "g")
    else
        let l:dirend2 = escape(l:dirend1, '\')
    endif
    if a:user
        " filter items by full path, leave only exact matches or direct children
        " (match full pattern or have at most one more trailing path entry)
        call filter(
          \ l:inclst,
          \ 'v:val[0]."/".v:val[1] =~ "^".l:dirend2."\\($\\|[\\/]*[^\\/]*$\\)"')
    else
        call filter(l:inclst, 'v:val[0] =~ "'.l:sl1.'".l:dirend2."\\?$"')
    endif

    " move end of each path to the beginning of filename
    let l:cutidx = - (l:pos + 2)
    if !empty(l:inclst) && l:inclst[0][0][l:cutidx + 1:] != l:dirend0
                      \ && a:user
        let l:dir = s:ICGetDir()
        let l:path = s:ICChosp(fnamemodify(l:dir.'/'.l:dirend0, ':p'))
        call map(l:inclst, '[ v:val[0] == l:path ? l:dir : v:val[0][:l:cutidx],'
                         \.'  l:dirend0.v:val[1] ]')
    else
        call map(l:inclst, '[v:val[0][:l:cutidx], l:dirend0.v:val[1]]')
    endif

    return l:inclst
endfunction

" drops all trailing slashes from path
function! s:ICChosp(path)
    let l:path = a:path
    while len(l:path) > 1 && (l:path[-1:] == '/' || l:path[-1:] == '\')
        let l:path = l:path[:-2]
    endwhile
    return l:path
endfunction

" searches for files that can be included in path
" a:user determines search area, when it's not zero look only in '.', otherwise
" everywhere in path except '.'
function! s:ICGetList(user, base)
    if a:user
        let l:dirs = s:ICGetUserSources()
        let l:dirs = s:ICAddNoDupPaths(l:dirs, s:ICGetSubDirs(l:dirs, a:base))
        return s:ICFindIncludes(1, l:dirs)
    endif

    " prepare list of directories
    let l:pathlst = s:ICAddNoDupPaths(split(&path, ','),
                                    \ s:ICGetClangIncludes(2))
    let l:pathlst = s:ICAddNoDupPaths(l:pathlst,
                                    \ s:ICGetSubDirs(l:pathlst, a:base))
    call reverse(sort(l:pathlst))

    " divide it into sublists
    let l:noncached = filter(copy(l:pathlst),
                           \ '!has_key(g:inccomplete_cache, v:val)')
    let l:cached = filter(l:pathlst, 'has_key(g:inccomplete_cache, v:val)')

    " add noncached entries
    let l:result = s:ICFindIncludes(0, l:noncached)

    " add cached entries
    for l:incpath in l:cached
        call map(copy(g:inccomplete_cache[l:incpath]),
               \ 'add(l:result, [l:incpath, v:val])')
    endfor

    return l:result
endfunction

" returns list of paths to directories which should be searched for
" ""-completion
function! s:ICGetUserSources()
    let l:dirs = []

    for l:source in g:inccomplete_localsources
        if l:source ==# 'relative-paths'
            let l:dirs += [s:ICGetDir()]
        elseif l:source ==# 'clang-buffer'
            let l:dirs = s:ICAddNoDupPaths(l:dirs, s:ICGetClangIncludes(1))
        elseif l:source ==# 'clang-global'
            let l:dirs = s:ICAddNoDupPaths(l:dirs, s:ICGetClangIncludes(0))
        elseif l:source ~= '/' && isdirectory(l:source)
            let l:dirs += [ l:source ]
        endif
    endfor

    if exists('b:inccomplete_root')
        let l:dirs = s:ICAddNoDupPaths(l:dirs, [b:inccomplete_root])
    endif

    if exists('b:inccomplete_roots')
        let l:dirs = s:ICAddNoDupPaths(l:dirs, b:inccomplete_roots)
    endif

    return l:dirs
endfunction

" gets directory of the current buffer
function! s:ICGetDir()
    let l:curbuf = s:ICGetBufferName()
    let l:dir = fnamemodify(l:curbuf, ':p:h')
    return l:dir
endfunction

" gets name of the current buffer
function! s:ICGetBufferName()
    let l:curbuf = expand('%:p')
    if empty(l:curbuf)
        let l:curbuf = getcwd() . '/vim_buffer_without_name_' . bufnr('%')
    endif
    return l:curbuf
endfunction

" gets list of header files using find
function! s:ICFindIncludes(user, pathlst)
    " test arguments
    if empty(a:pathlst)
        return []
    endif
    let l:exts = '\('.escape(join(s:ICGetExtensions(a:user), '\|'), '.').'\)'
    if !a:user
        if empty(g:inccomplete_findcmd)
            let l:regex = '.*[/\\][-_a-z0-9]\+'.l:exts.'$'
        else
            let l:regex = '.*[/\\][-_a-z0-9]+'.l:exts.'$'
        endif
    else
        let l:regex = '.*'.l:exts.'$'
    endif

    " execute find
    if empty(g:inccomplete_findcmd)
        let l:pathstr = substitute(join(a:pathlst, ','), '\\', '/', 'g')
        let l:found = globpath(l:pathstr, '*', 1)
        let l:foundlst = split(l:found, '\n')

        if g:inccomplete_showdirs
            call filter(l:foundlst,
                      \ "v:val =~ '".l:regex."' || isdirectory(v:val)")
        else
            call filter(l:foundlst, "v:val =~ '".l:regex."'")
        endif
    else
        " substitute in the next command is for Windows (it removes backslash in
        " \" sequence, that can appear after escaping the path)
        let l:substcmd = 'substitute(shellescape(v:val), ''\(.*\)\\\"$'','.
                       \ ' "\\1\"", "")'

        let l:pathstr = join(map(copy(a:pathlst), l:substcmd), ' ')
        let l:iregex = ' -iregex '.shellescape(l:regex)
        let l:dirs = g:inccomplete_showdirs ? ' -or -type d' : ''
        let l:found = system(g:inccomplete_findcmd.' -L '.
                           \ l:pathstr.' -maxdepth 1 -type f'.l:iregex.l:dirs)
        let l:foundlst = split(l:found, '\n')
    endif
    unlet l:found " to free some memory

    " prepare a:pathlst by forming regexps
    for l:i in range(len(a:pathlst))
        let l:path = a:pathlst[i]
        if l:path != '/' && l:path[-1:] == '/'
            let l:path = l:path[:-2]
        endif
        let g:inccomplete_cache[l:path] = []
        let l:tmp = substitute(l:path, '\', '/', 'g')
        let a:pathlst[i] = [l:path, '^'.escape(l:tmp, '.')]
    endfor

    " process the results of find
    let l:result = []
    for l:file in l:foundlst
        let l:file = substitute(l:file, '\', '/', 'g')
        if l:file[-1:] == '/'
            let l:file = l:file[:-2]
        endif
        " find appropriate parent path ("." at the end forbids exact match)
        let l:pathlst = filter(copy(a:pathlst),
                             \ 'fnamemodify(l:file, ":h") == v:val[0]')
        if empty(l:pathlst)
            continue
        endif
        let l:incpath = l:pathlst[0][0]
        " add entry to list
        let l:left = l:file[len(l:incpath):]
        if l:left[0] == '/' || l:left[0] == '\'
            let l:left = l:left[1:]
        endif
        call add(l:result, [l:incpath, l:left])
        " and to cache
        call add(g:inccomplete_cache[l:incpath], l:left)
    endfor
    return l:result
endfunction

" retrieves set of extensions acceptable for completion
function s:ICGetExtensions(user)
    if s:ICIsCxxBuffer()
        return a:user ? ['.hpp', '.h'] : ['.hpp', '.h', '']
    endif
    return ['.h']
endfunction

" checks whether current buffer is of C++ kind
function s:ICIsCxxBuffer()
    return index(split(&l:filetype, '\.'), 'cpp') != -1
endfunction

" retrieves include directories from b:clang_user_options and
" g:clang_user_options
" possible values of which:
"  - 0 -- only g:clang_user_options
"  - 1 -- only b:clang_user_options
"  - 2 -- both options
function! s:ICGetClangIncludes(which)
    let l:opts = ''
    if a:which != 0 && exists('b:clang_user_options')
        let l:opts .= b:clang_user_options.' '
    endif
    if a:which != 1 && exists('g:clang_user_options')
        let l:opts .= g:clang_user_options.' '
    endif
    if empty(l:opts)
        return []
    endif

    let l:lst = split(l:opts, ' ')
    let l:lst = filter(l:lst, 'v:val =~ "\\C^-I"')
    let l:lst = map(l:lst, 'v:val[2:]')
    let l:lst = map(l:lst, 'fnamemodify(v:val, ":p")')
    let l:lst = map(l:lst, 'substitute(v:val, "\\\\", "/", "g")')

    " While transforming relative paths into absolute ones clang_complete adds
    " escaping in the form of single or double quotes, try to get rid of them.
    " Otherwise we end up with list of paths some of which don't exist.
    let l:result = []
    for l:item in l:lst
        if l:item[0] == "'"
            let l:last = strridx(l:item, "'")
            let l:item = l:item[1 : l:last - 1] . l:item[l:last + 1:]
        elseif l:item[0] == '"'
            let l:last = strridx(l:item, '"')
            let l:item = l:item[1 : l:last - 1] . l:item[l:last + 1:]
        endif
        let l:result += [l:item]
    endfor

    return l:result
endfunction

" searches for existing subdirectories
function! s:ICGetSubDirs(pathlst, base)
    let [l:pos, l:sl, l:sl2] = s:ICParsePath(a:base)
    if l:pos < 0
        return []
    endif

    " search
    let l:dirend = a:base[:l:pos]
    let l:pathlst = join(a:pathlst, ',')
    " escape spaces in paths (seems to be needed on Windows, does not harm on
    " other systems)
    let l:pathlst = substitute(l:pathlst, ' ', '\\ ', 'g')
    let l:subdirs = finddir(l:dirend, l:pathlst, -1)

    " path expanding
    call map(l:subdirs, 'fnamemodify(v:val, ":p:h")')

    " ensure that path ends with slash
    let l:mapcmd = 'substitute(v:val, "\\([^'.l:sl.']\\)$", "\\1'.l:sl.'", "g")'
    call map(l:subdirs, l:mapcmd)

    return l:subdirs
endfunction

" returns list of three elements: [name_pos, slash_for_regexps, ordinary_slash]
function! s:ICParsePath(path)
    let l:iswindows = has('win16') || has('win32') || has('win64') ||
                    \ has('win95')

    " determine type of slash
    let l:path = a:path
    let l:pos = strridx(a:path, '/')
    let l:sl1 = '/'
    let l:sl2 = '/'
    if l:iswindows && (empty(a:path) || l:pos < 0)
        let l:pos = strridx(a:path, '\')
        let l:sl1 = '\\\\'
        let l:sl2 = '\'
    endif
    return [l:pos, l:sl1, l:sl2]
endfunction

" adds one list of paths to another without duplicating items
function! s:ICAddNoDupPaths(lista, listb)
    let l:result = []
    call s:ICPrepPaths(a:lista)
    call s:ICPrepPaths(a:listb)
    for l:item in a:lista + a:listb
        if index(l:result, l:item) == -1
            call add(l:result, l:item)
        endif
    endfor
    return l:result
endfunction

" converts list of paths to a list of absolute paths and excudes '.' directory
function! s:ICPrepPaths(lst)
    call filter(a:lst, '!empty(v:val) && v:val != "."')
    return map(a:lst, 'fnamemodify(v:val, ":p")')
endfunction
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