Last active
November 26, 2018 06:05
-
-
Save tyru/6a72ce65587bfa188c9dcb78acabf333 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set laststatus=2 | |
let &statusline = '%!StatusLine()' | |
function! StatusLine() abort | |
if &hlsearch | |
" XXX: 'l', 'h' do not move current cursor! | |
let searchcount = matchstr(execute('keepjumps keepmarks %s//&/gne', 'silent'), '\d\+') | |
let searchcount = printf(' (%s/%s)', searchcount !=# '' ? searchcount : '0', @/) | |
else | |
let searchcount = '' | |
endif | |
return '%f%( [%M%R%H%W]%)%( [%{&ft}]%) %{&fenc}/%{&ff}' | |
\ . '%(' | |
\ . '%( %{line(".")}/%{line("$")}%)' | |
\ . '%)' | |
\ . searchcount | |
endfunction |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment