From f57a5fffc0d228830c82687c583d831535409041 Mon Sep 17 00:00:00 2001 From: Sanchayan Maity Date: Fri, 1 May 2020 17:57:21 +0530 Subject: [PATCH] nvim: Switch to showing the full file path in statusline Signed-off-by: Sanchayan Maity --- nvim/.config/nvim/plugin/statusline.vim | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/nvim/.config/nvim/plugin/statusline.vim b/nvim/.config/nvim/plugin/statusline.vim index 4057933..326fa6a 100644 --- a/nvim/.config/nvim/plugin/statusline.vim +++ b/nvim/.config/nvim/plugin/statusline.vim @@ -25,23 +25,6 @@ function! GetCursorPosition() \ : '' endfunction -function! GetFileDir() - if &buftype != '' - return '' - endif - - if &filetype ==# 'gitcommit' - return 'New commit on ' - endif - - if &filetype ==# 'gitrebase' - return 'Interactive rebase on ' - endif - - let l:path = expand('%:h') - return len(l:path) > 0 ? l:path : '' -endfunction - " Taken from gitgutter README function! GitHunkStatus() let [a,m,r] = GitGutterGetHunkSummary() @@ -53,7 +36,7 @@ function! ActiveStatus() abort let statusline.="%1*\ %{winnr()}\ " let statusline.="%4*\ %{GitHunkStatus()}" let statusline.="%2*\ %Y\ " - let statusline.="%3*%<%{GetFileDir()}" + let statusline.="%3*%<%f" let statusline.="%=" let statusline.="%4*\ %{GetCursorPosition()}\ (%3p%%)" return statusline @@ -64,7 +47,7 @@ function! PassiveStatus() abort let statusline.="%5*\ %{winnr()}\ " let statusline.="%8*\ %{GitHunkStatus()}" let statusline.="%6*\ %Y\ " - let statusline.="%7*%<%{GetFileDir()}" + let statusline.="%7*%<%f" let statusline.="%=" let statusline.="%8*\ %{GetCursorPosition()}\ (%3p%%)" return statusline