Commit 2c71de50c96f260f2562c00796ba4622f23ca8dc

Don't map <esc>foo in gui
Otherwise there is a delay after pressing Escape key in command
line.
Author: xaizek
Author date (UTC): 2012-06-11 18:33
Committer name: xaizek
Committer date (UTC): 2012-06-11 18:33
Parent(s): 763ead2b85f8a2cd5d9a0a81f62667ca6fc56d6e
Signing key:
Tree: fb4085d95f1b81e7885c5f67fb186515482a89f6
File Lines added Lines deleted
plugin/emacscommandline.vim 30 10
File plugin/emacscommandline.vim changed (mode: 100644) (index 2726070..b3be0c4)
... ... cnoremap <C-B> <Left>
4 4 cnoremap <C-F> <Right> cnoremap <C-F> <Right>
5 5 cnoremap <C-P> <Up> cnoremap <C-P> <Up>
6 6 cnoremap <C-N> <Down> cnoremap <C-N> <Down>
7 cnoremap <Esc>r <C-F>?
8 cmap <M-r> <Esc>r
7 if has('gui_running')
8 cnoremap <M-r> <C-F>?
9 else
10 cnoremap <Esc>r <C-F>?
11 cmap <M-r> <Esc>r
12 endif
9 13
10 14 " Maps to old shortcuts using Ctrl-O as a prefix " Maps to old shortcuts using Ctrl-O as a prefix
11 15 cnoremap <C-O><C-A> <C-A> cnoremap <C-O><C-A> <C-A>
 
... ... cnoremap <C-O><C-X><C-U> <C-X><C-U>
24 28 cnoremap <C-O><Del> <Del> cnoremap <C-O><Del> <Del>
25 29 cnoremap <C-O><BS> <BS> cnoremap <C-O><BS> <BS>
26 30
27 cnoremap <Esc>f <C-\>e<SID>ForwardWord()<CR>
28 cmap <M-f> <Esc>f
31 if has('gui_running')
32 cnoremap <M-f> <C-\>e<SID>ForwardWord()<CR>
33 else
34 cnoremap <Esc>f <C-\>e<SID>ForwardWord()<CR>
35 cmap <M-f> <Esc>f
36 endif
29 37 function! <SID>ForwardWord() function! <SID>ForwardWord()
30 38 let l:loc = strpart(getcmdline(), 0, getcmdpos() - 1) let l:loc = strpart(getcmdline(), 0, getcmdpos() - 1)
31 39 let l:roc = strpart(getcmdline(), getcmdpos() - 1) let l:roc = strpart(getcmdline(), getcmdpos() - 1)
 
... ... function! <SID>ForwardWord()
41 49 return getcmdline() return getcmdline()
42 50 endfunction endfunction
43 51
44 cnoremap <Esc>b <C-\>e<SID>BackwardWord()<CR>
45 cmap <M-b> <Esc>b
52 if has('gui_running')
53 cnoremap <M-b> <C-\>e<SID>BackwardWord()<CR>
54 else
55 cnoremap <Esc>b <C-\>e<SID>BackwardWord()<CR>
56 cmap <M-b> <Esc>b
57 endif
46 58 function! <SID>BackwardWord() function! <SID>BackwardWord()
47 59 let l:loc = strpart(getcmdline(), 0, getcmdpos() - 1) let l:loc = strpart(getcmdline(), 0, getcmdpos() - 1)
48 60 let l:roc = strpart(getcmdline(), getcmdpos() - 1) let l:roc = strpart(getcmdline(), getcmdpos() - 1)
 
... ... function! <SID>BackwardKillLine()
120 132 return l:ret return l:ret
121 133 endfunction endfunction
122 134
123 cnoremap <Esc>d <C-\>e<SID>KillWord()<CR>
124 cmap <M-d> <Esc>d
135 if has('gui_running')
136 cnoremap <M-d> <C-\>e<SID>KillWord()<CR>
137 else
138 cnoremap <Esc>d <C-\>e<SID>KillWord()<CR>
139 cmap <M-d> <Esc>d
140 endif
125 141 function! <SID>KillWord() function! <SID>KillWord()
126 142 call <SID>saveUndoHistory(getcmdline(), getcmdpos()) call <SID>saveUndoHistory(getcmdline(), getcmdpos())
127 143 let l:loc = strpart(getcmdline(), 0, getcmdpos() - 1) let l:loc = strpart(getcmdline(), 0, getcmdpos() - 1)
 
... ... function! <SID>KillWord()
142 158 return l:ret return l:ret
143 159 endfunction endfunction
144 160
145 cnoremap <Esc><BS> <C-\>e<SID>BackwardKillWord()<CR>
146 cmap <M-BS> <Esc><BS>
161 if has('gui_running')
162 cnoremap <M-BS> <C-\>e<SID>BackwardKillWord()<CR>
163 else
164 cnoremap <Esc><BS> <C-\>e<SID>BackwardKillWord()<CR>
165 cmap <M-BS> <Esc><BS>
166 endif
147 167 function! <SID>BackwardKillWord() function! <SID>BackwardKillWord()
148 168 " Do same as in-built Ctrl-W, except assign deleted text to @c " Do same as in-built Ctrl-W, except assign deleted text to @c
149 169 call <SID>saveUndoHistory(getcmdline(), getcmdpos()) call <SID>saveUndoHistory(getcmdline(), getcmdpos())
Hints

Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://code.reversed.top/user/xaizek/vim-emacscommandline

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@code.reversed.top/user/xaizek/vim-emacscommandline

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a pull request:
... clone the repository ...
... make some changes and some commits ...
git push origin master