commit 483aa710340a7d48597dc2a14c9fe92191a2ecbf
parent 668ee3ff6875147efc87524239c7e1fe67f118d6
Author: Alex Balgavy <a.balgavy@gmail.com>
Date: Thu, 10 Sep 2020 14:52:14 +0200
vim: show netrw remote file in statusline if exists
Former-commit-id: 1101390bdb7b66471f9c56ebdd5b3cc0ac1ec6f5
Diffstat:
2 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/vim/autoload/statusline.vim b/vim/autoload/statusline.vim
@@ -90,3 +90,10 @@ function! statusline#StatuslineVimtexCompiler()
return ''
endfunction
+function! statusline#StatuslineRemoteFile()
+ if exists('b:netrw_lastfile')
+ return ' ('.b:netrw_lastfile.')'
+ endif
+ return ''
+endfunction
+
diff --git a/vim/plugin/statusline.vim b/vim/plugin/statusline.vim
@@ -17,6 +17,7 @@ set statusline+=%(\ %m%r%w\ %) " Flags (m
set statusline+=%#error# " Start error highlighting
set statusline+=%(%{statusline#StatuslineTabWarning()}%) " Inconsistent indentation warning
set statusline+=%* " Clear highlighting
+set statusline+=%{statusline#StatuslineRemoteFile()}
set statusline+=%= " Move everything after this to the right
set statusline+=%< " Start truncating here
set statusline+=\ %{statusline#StatuslineBuildCwd()}\ " Current working directory, replacing home with ~