444 | " Moving tabs
445 | if has('tabsidebar')
446 | nnoremap <silent> <Up> :<C-u>call <SID>tabmove(-v:count1)<CR>
447 | nnoremap <silent> <Down> :<C-u>call <SID>tabmove(+v:count1)<CR>
448 | else
449 | nnoremap <silent> <Left> :<C-u>call <SID>tabmove(-v:count1)<CR>
450 | nnoremap <silent> <Right> :<C-u>call <SID>tabmove(+v:count1)<CR>
451 | endif
500 | function! s:toggle_winfix()
501 | if &winfixheight || &winfixwidth
502 | setlocal nowinfixheight nowinfixwidth
503 | echo 'released.'
504 | else
505 | setlocal winfixheight winfixwidth
506 | echo 'fixed!'
507 | endif
508 | endfunction
584 | " Remove trailing after blockwise yank {{{2
585 |
586 | xnoremap <silent> y y:<C-u>call <SID>remove_trailing_spaces_blockwise()<CR>
587 |
588 | function! s:remove_trailing_spaces_blockwise()
589 | let regname = v:register
590 | if getregtype(regname)[0] !=# "\<C-v>"
591 | return ''
592 | endif
593 | let value = getreg(regname, 1)
594 | let value = s:map_lines(value, {-> substitute(v:val, '\v\s+$', '', '')})
595 | call setreg(regname, value, "\<C-v>")
596 | endfunction
597 |
598 | function! s:map_lines(str, expr)
599 | return join(map(split(a:str, '\n', 1), a:expr), "\n")
600 | endfunction
835 | " Exit diff mode automatically {{{1
836 | " https://hail2u.net/blog/software/vim-turn-off-diff-mode-automatically.html
837 |
838 | " Turn off diff mode automatically
839 | autocmd vimrc WinEnter *
840 | \ if (winnr('$') == 1) &&
841 | \ (getbufvar(winbufnr(0), '&diff')) == 1 |
842 | \ diffoff |
843 | \ endif
695 | " Use gF (search line number after filename) {{{2
696 |
697 | nnoremap gf gF
698 | nnoremap <C-w>f <C-w>F