aboutsummaryrefslogtreecommitdiff
path: root/.vim/autoload/airline/extensions/fugitiveline.vim
diff options
context:
space:
mode:
authorYaroslav <contact@yaroslavps.com>2020-02-25 14:47:03 +0300
committerYaroslav <contact@yaroslavps.com>2020-02-25 14:47:03 +0300
commitd16e82d468eb0d5bb1e662ac4812c0ca6fc0fc64 (patch)
tree6575864b75dc0c9de61b5d523e77dbcff785c998 /.vim/autoload/airline/extensions/fugitiveline.vim
parent69d47128244a06ee28e4b43191ef9216b04bce13 (diff)
downloadvimrice-d16e82d468eb0d5bb1e662ac4812c0ca6fc0fc64.tar.gz
vimrice-d16e82d468eb0d5bb1e662ac4812c0ca6fc0fc64.zip
reorganized repo to be easier to use with GNU stow; added script to stow
Diffstat (limited to '.vim/autoload/airline/extensions/fugitiveline.vim')
-rw-r--r--.vim/autoload/airline/extensions/fugitiveline.vim49
1 files changed, 0 insertions, 49 deletions
diff --git a/.vim/autoload/airline/extensions/fugitiveline.vim b/.vim/autoload/airline/extensions/fugitiveline.vim
deleted file mode 100644
index 5dab995..0000000
--- a/.vim/autoload/airline/extensions/fugitiveline.vim
+++ /dev/null
@@ -1,49 +0,0 @@
-" MIT License. Copyright (c) 2017-2018 Cimbali et al
-" vim: et ts=2 sts=2 sw=2
-
-scriptencoding utf-8
-
-if !airline#util#has_fugitive()
- finish
-endif
-
-
-if exists("+autochdir") && &autochdir == 1
- let s:fmod = ':p'
-else
- let s:fmod = ':.'
-endif
-
-function! airline#extensions#fugitiveline#bufname()
- if !exists('b:fugitive_name')
- let b:fugitive_name = ''
- try
- if bufname('%') =~? '^fugitive:' && exists('*FugitiveReal')
- let b:fugitive_name = FugitiveReal(bufname('%'))
- elseif exists('b:git_dir')
- let buffer = fugitive#buffer()
- if buffer.type('blob')
- let b:fugitive_name = buffer.repo().translate(buffer.path('/'))
- endif
- endif
- catch
- endtry
- endif
-
- if empty(b:fugitive_name)
- return fnamemodify(bufname('%'), s:fmod)
- else
- return fnamemodify(b:fugitive_name, s:fmod)
- endif
-endfunction
-
-function! airline#extensions#fugitiveline#init(ext)
- if exists("+autochdir") && &autochdir == 1
- " if 'acd' is set, vim-airline uses the path section, so we need to redefine this here as well
- call airline#parts#define_raw('path', '%<%{airline#extensions#fugitiveline#bufname()}%m')
- else
- call airline#parts#define_raw('file', '%<%{airline#extensions#fugitiveline#bufname()}%m')
- endif
- autocmd ShellCmdPost,CmdwinLeave * unlet! b:fugitive_name
- autocmd User AirlineBeforeRefresh unlet! b:fugitive_name
-endfunction