aboutsummaryrefslogtreecommitdiffstats
path: root/bundle/cmd-escape/autoload/cmd_escape.vim
blob: dd87b6465983f2f8d3e2d2a5d2e39294478b3227 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
let s:active = 0

" Toggles the <Space> key between normal self-insert and inserting an escaped
" space ('\ ') in command mode.
function cmd_escape#Toggle()
	if s:active
		cunmap <Space>
		let s:active = 0
	else
		cnoremap <Space> \<Space>
		let s:active = 1
	endif

	return ''
endfunction