Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
" [count]<Space> key in normal model.
nmap <space> :<C-U>call NormalSpace()<cr>
function! NormalSpace()
let col=col(".")-1
let text=getline(".")
call setline(line("."), strpart(text,0,col).repeat(" ", v:count1).strpart(text,col))
exec "normal ".v:count1."l"

hotoo commented Aug 25, 2010

普通模式: [count]<Space> 在光标所在位置插入 count 个空格。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment