nvim: Switch to showing the full file path in statusline

Signed-off-by: Sanchayan Maity <maitysanchayan@gmail.com>
This commit is contained in:
Sanchayan Maity 2020-05-01 17:57:21 +05:30
parent b57e4bdceb
commit f57a5fffc0

View file

@ -25,23 +25,6 @@ function! GetCursorPosition()
\ : '' \ : ''
endfunction 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 " Taken from gitgutter README
function! GitHunkStatus() function! GitHunkStatus()
let [a,m,r] = GitGutterGetHunkSummary() let [a,m,r] = GitGutterGetHunkSummary()
@ -53,7 +36,7 @@ function! ActiveStatus() abort
let statusline.="%1*\ %{winnr()}\ " let statusline.="%1*\ %{winnr()}\ "
let statusline.="%4*\ %{GitHunkStatus()}" let statusline.="%4*\ %{GitHunkStatus()}"
let statusline.="%2*\ %Y\ " let statusline.="%2*\ %Y\ "
let statusline.="%3*%<%{GetFileDir()}" let statusline.="%3*%<%f"
let statusline.="%=" let statusline.="%="
let statusline.="%4*\ %{GetCursorPosition()}\ (%3p%%)" let statusline.="%4*\ %{GetCursorPosition()}\ (%3p%%)"
return statusline return statusline
@ -64,7 +47,7 @@ function! PassiveStatus() abort
let statusline.="%5*\ %{winnr()}\ " let statusline.="%5*\ %{winnr()}\ "
let statusline.="%8*\ %{GitHunkStatus()}" let statusline.="%8*\ %{GitHunkStatus()}"
let statusline.="%6*\ %Y\ " let statusline.="%6*\ %Y\ "
let statusline.="%7*%<%{GetFileDir()}" let statusline.="%7*%<%f"
let statusline.="%=" let statusline.="%="
let statusline.="%8*\ %{GetCursorPosition()}\ (%3p%%)" let statusline.="%8*\ %{GetCursorPosition()}\ (%3p%%)"
return statusline return statusline