Skip to content

Instantly share code, notes, and snippets.

@hotoo
Created August 25, 2010 09:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hotoo/549200 to your computer and use it in GitHub Desktop.
Save hotoo/549200 to your computer and use it in GitHub Desktop.
" [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"
endfunction
@hotoo
Copy link
Author

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