nvim: Switch to showing the full file path in statusline
Signed-off-by: Sanchayan Maity <maitysanchayan@gmail.com>
This commit is contained in:
parent
b57e4bdceb
commit
f57a5fffc0
1 changed files with 2 additions and 19 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue