mirror of
https://github.com/SqrtMinusOne/dotfiles.git
synced 2025-12-11 11:43:03 +03:00
Nice folding toggling
This commit is contained in:
parent
bf887b0b4d
commit
6f181eb0e4
1 changed files with 26 additions and 1 deletions
|
|
@ -132,6 +132,7 @@ set cursorline
|
|||
set mouse=a
|
||||
set splitbelow
|
||||
set splitright
|
||||
set inccommand=split
|
||||
|
||||
set relativenumber
|
||||
|
||||
|
|
@ -215,7 +216,7 @@ nnoremap <Leader>ar :ALEFindReferences<CR>
|
|||
nnoremap <Leader>ah :ALEHover<CR>
|
||||
nnoremap <Leader>ac :ALERename<CR>
|
||||
|
||||
"EasyAlign
|
||||
" EasyAlign
|
||||
xmap ga <Plug>(EasyAlign)
|
||||
nmap ga <Plug>(EasyAlign)
|
||||
|
||||
|
|
@ -644,6 +645,30 @@ nnoremap gd<Right> :call GitMergeGetRight()<CR>
|
|||
|
||||
" }}}
|
||||
|
||||
" {{{ Folding
|
||||
|
||||
function! SetFoldLevel() range
|
||||
execute ":set foldlevel=" . v:count
|
||||
echo("set foldlevel=" . v:count)
|
||||
endfunction
|
||||
|
||||
function! OnSpace()
|
||||
if foldlevel('.')
|
||||
if foldclosed('.') != -1
|
||||
return 'zO'
|
||||
else
|
||||
return 'za'
|
||||
endif
|
||||
else
|
||||
return "\<Space>"
|
||||
endif
|
||||
endfunction
|
||||
|
||||
nnoremap <Leader>ff :call SetFoldLevel()<CR>
|
||||
nnoremap <silent> <Space> @=(OnSpace())<CR>
|
||||
|
||||
" }}}
|
||||
|
||||
" Put current time
|
||||
command! Timestamp :put =strftime('%d-%m-%y %H:%M:%S')
|
||||
" }}}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue