xaizek / dotvim (License: Unspecified) (since 2018-12-07)
Vim configuration and plugins.
<root> / autoload / libprj / prj.vim (85aba54fc07071fe1cbfcee791e1ffad3a496600) (1,021B) (mode 100644) [raw]
" sources configuration file for a project
function! libprj#prj#Do(scrfile)
    let l:scr = findfile(a:scrfile, '.;')
    if !empty(l:scr) && filereadable(l:scr)
        execute 'source '.escape(l:scr, ' ')
    endif
endfunction

command! LibPrjDoNext call libprj#prj#DoNext(expand('<sfile>'))
function! libprj#prj#DoNext(scrfile)
    let l:scrfile = fnamemodify(a:scrfile, ':t')
    let l:findspec = fnamemodify(a:scrfile, ':p:h:h').';'
    let l:scr = findfile(l:scrfile, l:findspec)
    if !empty(l:scr) && filereadable(l:scr)
        execute 'source '.escape(l:scr, ' ')
    endif
endfunction

function! libprj#prj#GetRoot()
    if exists('b:project_root')
        return b:project_root
    endif

    let l:parts = split(getcwd(), '/')
    let l:pos = index(l:parts, 'src', 0, has('win32'))
    if l:pos >= 0
        let l:result = join(l:parts[:l:pos], '/')
        if !has('win32')
            let l:result = '/'.l:result
        endif
    else
        let l:result = '.'
    endif
    return l:result
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/dotvim

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

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