~gpanders/dotfiles

ref: c8e63bac959db19c138dcc3198a56514f0b444ff dotfiles/.vim/autoload/vim.vim -rw-r--r-- 843 bytes
c8e63bacGreg Anders Manage dotfiles directly in home directory 1 year, 4 months ago
                                                                                
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
let s:cachedir = ''
let s:datadir = ''

function! vim#cachedir()
    if empty(s:cachedir)
        let n = has('nvim') ? 'n' : ''
        if exists('$XDG_CACHE_HOME')
            let s:cachedir = $XDG_CACHE_HOME . '/' . n . 'vim'
        elseif has('unix')
            let s:cachedir = $HOME . '/.cache/' . n . 'vim'
        else
            let s:cachedir = $HOME . '/vimfiles/cache'
        endif
    endif
    return s:cachedir
endfunction

function! vim#datadir()
    if empty(s:datadir)
        let n = has('nvim') ? 'n' : ''
        if exists('$XDG_DATA_HOME')
            let s:datadir = $XDG_DATA_HOME . '/' . n . 'vim'
        elseif has('unix')
            let s:datadir = $HOME . '/.local/share/' . n . 'vim'
        else
            let s:datadir = $HOME . '/vimfiles/cache'
        endif
    endif
    return s:datadir
endfunction