aboutsummaryrefslogtreecommitdiff
path: root/fish/functions/nvim.fish
blob: 27b45d870e7ca2bed6a8011f841cf3850e028364 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
function nvim --wraps nvim --description 'open a new nvim instance or connect to an existing one using nvr(1)'
    # if `nvr` is not installed, nevermind. just run `nvim`
    if ! command -q nvr
        command nvim $argv
    end

    if test ! -S /tmp/nvimsocket
        command nvim --listen /tmp/nvimsocket $argv
    else
        command nvr -s $argv
    end
end