0

如何删除列范围内的前导和尾随空格?

这不起作用:

9s/\%>11c\%<40c^\(\s\+\)//e
9s/\%>11c\%<40c\(\s\+\)$//e
4

1 回答 1

0
""""""""""""""""""""""""""""""""""""""""""""""""
" Delete Leading White Spaces
""""""""""""""""""""""""""""""""""""""""""""""""
function <SID>OxnzDeleteLeadingSpacesFunc()
    try
        :%s/^\s\+//
    catch /^Vim\%((\a\+)\)\=:E486/
        echo "No more leading space exists"
    endtry
endfunction

""""""""""""""""""""""""""""""""""""""""""""""""
" Delete Trailing White Spaces
""""""""""""""""""""""""""""""""""""""""""""""""
function <SID>OxnzDeleteTrailingSpacesFunc()
    try
        :%s/\s\+$//
    catch /^Vim\%((\a\+)\)\=:E486/
        echo "No more trailing space exists"
    endtry
endfunction
于 2015-12-18T08:13:05.793 回答