Skip to content

Commit

Permalink
Remove TidyAll from vim config
Browse files Browse the repository at this point in the history
  • Loading branch information
oalders committed Nov 25, 2023
1 parent 3585329 commit cde5175
Showing 1 changed file with 0 additions and 24 deletions.
24 changes: 0 additions & 24 deletions vim/vimrc
Original file line number Diff line number Diff line change
Expand Up @@ -173,30 +173,6 @@ function! UseTabs()
:set list
endfunction

" ########### TidyAll ###########

" https://github.com/jonswar/perl-code-tidyall/blob/master/etc/editors/tidyall.vim

" Run tidyall on the current buffer. If an error occurs, show it and leave it
" in tidyall.ERR, and undo any changes.

command! TidyAll :call TidyAll()
function! TidyAll()
let l:cur_pos = getpos( '.' )
let l:cmdline = ':1,$!tidyall --mode editor --pipe %:p 2> tidyall.ERR'
execute( l:cmdline )
if v:shell_error
echo "\nContents of tidyall.ERR:\n\n" . system( 'cat tidyall.ERR' )
silent undo
else
call system( 'rm tidyall.ERR' )
endif
call setpos( '.', cur_pos )
endfunction

" Bind to ,t (or leader+t)
map <leader>t :call TidyAll()<cr>
" Thanks to D. Ben Knoble for getting histadd() to work:
" https://vi.stackexchange.com/questions/34818/how-to-use-histadd-with-a-custom-function/34819#34819
nnoremap <leader>ot :call OT(input("ot: ", "", "file"))<cr>
Expand Down

0 comments on commit cde5175

Please sign in to comment.