mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-01-24 06:40:05 +08:00
Merge branch 'cursor_pos' into dev
This commit is contained in:
commit
274ecb35d3
@ -53,7 +53,7 @@ let s:modes = {
|
|||||||
\ },
|
\ },
|
||||||
\ }
|
\ }
|
||||||
|
|
||||||
let s:loaded_sections = ['syntax checking', 'major mode', 'minor mode lighters', 'version control info']
|
let s:loaded_sections = ['syntax checking', 'major mode', 'minor mode lighters', 'version control info', 'cursorpos']
|
||||||
|
|
||||||
function! s:battery_status() abort
|
function! s:battery_status() abort
|
||||||
if executable('acpi')
|
if executable('acpi')
|
||||||
@ -156,6 +156,10 @@ function! s:whitespace() abort
|
|||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! s:cursorpos() abort
|
||||||
|
return ' %l:%c '
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
function! s:modes() abort
|
function! s:modes() abort
|
||||||
let m = ' ❖ '
|
let m = ' ❖ '
|
||||||
@ -240,7 +244,10 @@ function! s:active() abort
|
|||||||
if index(s:loaded_sections, 'battery status') != -1
|
if index(s:loaded_sections, 'battery status') != -1
|
||||||
call add(rsec, s:battery_status())
|
call add(rsec, s:battery_status())
|
||||||
endif
|
endif
|
||||||
call add(rsec, '%{" " . &ff . "|" . (&fenc!=""?&fenc:&enc) . " "}')
|
call add(rsec, '%{" " . &ff . " | " . (&fenc!=""?&fenc:&enc) . " "}')
|
||||||
|
if index(s:loaded_sections, 'cursorpos') != -1
|
||||||
|
call add(rsec, s:cursorpos())
|
||||||
|
endif
|
||||||
call add(rsec, ' %P ')
|
call add(rsec, ' %P ')
|
||||||
if index(s:loaded_sections, 'time') != -1
|
if index(s:loaded_sections, 'time') != -1
|
||||||
call add(rsec, s:time())
|
call add(rsec, s:time())
|
||||||
@ -343,6 +350,8 @@ function! SpaceVim#layers#core#statusline#config() abort
|
|||||||
\ 'toggle the battery status', 1)
|
\ 'toggle the battery status', 1)
|
||||||
call SpaceVim#mapping#space#def('nnoremap', ['t', 'm', 't'], 'call SpaceVim#layers#core#statusline#toggle_section("time")',
|
call SpaceVim#mapping#space#def('nnoremap', ['t', 'm', 't'], 'call SpaceVim#layers#core#statusline#toggle_section("time")',
|
||||||
\ 'toggle the time', 1)
|
\ 'toggle the time', 1)
|
||||||
|
call SpaceVim#mapping#space#def('nnoremap', ['t', 'm', 'p'], 'call SpaceVim#layers#core#statusline#toggle_section("cursorpos")',
|
||||||
|
\ 'toggle the cursor position', 1)
|
||||||
call SpaceVim#mapping#space#def('nnoremap', ['t', 'm', 'T'], 'if &laststatus == 2 | let &laststatus = 0 | else | let &laststatus = 2 | endif',
|
call SpaceVim#mapping#space#def('nnoremap', ['t', 'm', 'T'], 'if &laststatus == 2 | let &laststatus = 0 | else | let &laststatus = 2 | endif',
|
||||||
\ 'toggle the statuline itself', 1)
|
\ 'toggle the statuline itself', 1)
|
||||||
function! TagbarStatusline(...) abort
|
function! TagbarStatusline(...) abort
|
||||||
|
@ -397,7 +397,7 @@ Key Binding | Description
|
|||||||
`SPC t m m` | toggle the minor mode lighters
|
`SPC t m m` | toggle the minor mode lighters
|
||||||
`SPC t m M` | toggle the major mode
|
`SPC t m M` | toggle the major mode
|
||||||
`SPC t m n` | toggle the cat! (if colors layer is declared in your dotfile)
|
`SPC t m n` | toggle the cat! (if colors layer is declared in your dotfile)
|
||||||
`SPC t m p` | toggle the point character position
|
`SPC t m p` | toggle the cursor position
|
||||||
`SPC t m t` | toggle the time
|
`SPC t m t` | toggle the time
|
||||||
`SPC t m T` | toggle the mode line itself
|
`SPC t m T` | toggle the mode line itself
|
||||||
`SPC t m v` | toggle the version control info
|
`SPC t m v` | toggle the version control info
|
||||||
|
Loading…
Reference in New Issue
Block a user