nvim/init.commands.vim

28 lines
674 B
VimL

" SpacesToTabs {{{
" TODO - ake a proper regex substitution
function! s:spacestotabs()
%s/^ / /e
%s/^ / /e
%s/^ / /e
%s/^ / /e
%s/^ / /e
%s/^ / /e
endfunction
command SpacesToTabs call s:spacestotabs()
"}}}
" TrimWhitespace {{{
command! -range=% TrimWhitespace let b:wv = winsaveview() |
\ keeppattern <line1>,<line2>s/\s\+$// |
\ call winrestview(b:wv)
"}}}
" Scratch, ScratchVertical {{{
command! Scratch new | setlocal buftype=nofile | setlocal bufhidden=hide | setlocal noswapfile
command! ScratchVertical vnew | setlocal buftype=nofile | setlocal bufhidden=hide | setlocal noswapfile
"}}}
"
"