Vim에서 visual mode increment질문. 고수님들 조언좀 ㅠㅠ

윈도우 ultraedit의 칼럼모드에서 alt-l,n하면 자동으로 숫자가 증가하게하는 기능이 절실합니다.
vim에디터에서도 script로 가능한 것을 구글링을 통해서 script파일을 구하고,
~/.vim/plugin 디렉토리에 increments.vim으로 저장한다음에 잘쓰고 있었습니다.

그런데, 문제는 +값 증가는 되는데, -값으로 증가가 안되더라구요.
예를들면, 아래 3줄의 값을 첫번째 column만 ctrl-v로 선택하고,
1 2
1 2
1 2
:I 2 명령을 실행하면,
1 2
3 2
5 2
이와 같이, 첫 칼럼이 자동으로 변화하는데…
증가분(increment)값이 음수인 경우, 즉,
:I -2 와 같은 명령을 내리면 제대로 작동하지 않습니다.
어떻게해야 이문제해결할 수 있을까요? ㅠㅠ

참고사이트:

http://quickteckiteasy.blogspot.com/200 ... ement.html

스크립트 소스:

function! <SID>MyINC(…)

if a:0 > 0
let inc = a:1
else
let inc = 1
endif

" initial the inc step size
let inc_size_i = inc

let start_line = line( "‘<")
let end_line = line( "’>")

" initial line index, start increment from next line
let line_i = start_line + 1
" initial column index
let c = virtcol("'>")

" walk the whole visual block
while line_i <= end_line

&quot;go to next line 
call cursor( line_i, c )

&quot; execute increment 
exe &quot;normal &quot; . inc_size_i . &quot;\&lt;c-a&gt;&quot;

let inc_size_i = inc_size_i + inc

let line_i = line_i + 1 

endwhile

endfunction

command! -range -nargs=? I call <SID>MyINC(<f-args>)

다른 거 쓰세요.
[url=http&#58;//www&#46;vim&#46;org/scripts/script&#46;php?script_id=156:3cgg4201]increment.vim : yet another script for incrementing numbers.[/url:3cgg4201] 써보니 음수도 잘 되네요.
각종 스크립트는 vim 공식 사이트에서…

연가시님이 가르쳐 주신 사이트에서 버젼 3개(1.0, 1.1, 1.3) 3개 다 다운받아서 vi실행시켜보면
Error detected while processing /home/userr/.vim/plugin/increment.vim:
line 55:
E492: Not an editor command: ^M
line 56:
E492: Not an editor command: ^M
line 61:
E492: Not an editor command: ^M
line 63:
E488: Trailing characters
line 72:
E492: Not an editor command: ^M
line 76:
E488: Trailing characters
line 150:
E492: Not an editor command: ^M
이런 오류들이 나네요. ^M이 안보이는거 같은데… 오류가… ㅠㅠ

아… 그거 increment.vim 파일을 불러와서
:se ff=unix 하고 저장하시면 해결됩니다.

연가시님 감사합니다. 덕분에 해결했습니다.
%s/ctrl-v-m//로도 안없어져서 이상하다고 생각했었는데…
가르쳐 주신방법대로 하니 오류 사라졌네요.

ctrl-v로 블럭 지정하고,
:Inc -2 이런식으로 명령내리면되는군요
(:I 2만 계속 시도했다는…orz)

못써본 신기한 기능이군요…