How to find why esc doesn't work right away in visual mode?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
1
down vote

favorite
1












When I press <Esc> in visual mode, I don't immediately return to normal mode (the selection persists). I think that is because I have a mapping defined in visual mode shat starts from <Esc>. I tried doing the following to find that mapping:



:redir! > vim_keys.txt
:silent verbose map
:redir END


But there are no mappings that start with <Esc>:



v [" *@:<C-U>exe "normal! gv"|call search('%(^s*".*n)%(^s*")@!', "bW")<CR>
Last set from /usr/share/vim/vim80/ftplugin/vim.vim
n [" *@:call search('%(^s*".*n)%(^s*")@!', "bW")<CR>
Last set from /usr/share/vim/vim80/ftplugin/vim.vim
v *@m':<C-U>exe "normal! gv"|call search('^s*endf*%[unction]>', "bW")<CR>
Last set from /usr/share/vim/vim80/ftplugin/vim.vim
n *@m':call search('^s*endf*%[unction]>', "bW")<CR>
Last set from /usr/share/vim/vim80/ftplugin/vim.vim
v [[ *@m':<C-U>exe "normal! gv"|call search('^s*fu%[nction]>', "bW")<CR>
Last set from /usr/share/vim/vim80/ftplugin/vim.vim n [[ *@m':call search('^s*fu%[nction]>', "bW")<CR> Last set from /usr/share/vim/vim80/ftplugin/vim.vim
v ]" *@:<C-U>exe "normal! gv"|call search('^(s*".*n)@<!(s*")', "W")<CR>
Last set from /usr/share/vim/vim80/ftplugin/vim.vim
n ]" *@:call search('^(s*".*n)@<!(s*")', "W")<CR>
Last set from /usr/share/vim/vim80/ftplugin/vim.vim
v ][ *@m':<C-U>exe "normal! gv"|call search('^s*endf*%[unction]>', "W")<CR>
Last set from /usr/share/vim/vim80/ftplugin/vim.vim
n ][ *@m':call search('^s*endf*%[unction]>', "W")<CR>
Last set from /usr/share/vim/vim80/ftplugin/vim.vim
v ]] *@m':<C-U>exe "normal! gv"|call search('^s*fu%[nction]>', "W")<CR>
Last set from /usr/share/vim/vim80/ftplugin/vim.vim
n ]] *@m':call search('^s*fu%[nction]>', "W")<CR>
Last set from /usr/share/vim/vim80/ftplugin/vim.vim
v <C-Z> * <Nop>
Last set from ~/.vimrc
n <Space> * zR
Last set from ~/.vimrc
n ,bd * :Bclose<CR>
Last set from ~/.dotfiles/.vim/plugin/bclose.vim
, <Plug>(easymotion-prefix)
Last set from ~/.vimrc
n ,gl * :!git log<CR>
Last set from ~/.vimrc
n ,gp * :!git push<CR>
Last set from ~/.vimrc
n ,gc * :!git commit -m '
Last set from ~/.vimrc
n ,ga * :!git add
Last set from ~/.vimrc
n ,gs * :!git status<CR>
Last set from ~/.vimrc
n ,rs * :so $MYVIMRC<CR>
Last set from ~/.vimrc
n ,rr * :vsplit $MYVIMRC<CR>
Last set from ~/.vimrc
n ,sc * :SessionClose<CR>
Last set from ~/.vimrc
n ,ss * :SessionSave<CR>
Last set from ~/.vimrc
n ,sl * :SessionList<CR>
Last set from ~/.vimrc
n =A * gg=G<C-O><C-O>
Last set from ~/.vimrc
n H * ^
Last set from ~/.vimrc
n L * $
Last set from ~/.vimrc
n Q * :q<CR>
Last set from ~/.vimrc
v gx <Plug>NetrwBrowseXVis
Last set from /usr/share/vim/vim80/plugin/netrwPlugin.vim
n gx <Plug>NetrwBrowseX
Last set from /usr/share/vim/vim80/plugin/netrwPlugin.vim
o p * i(
Last set from ~/.vimrc
v <Plug>NetrwBrowseXVis * :<C-U>call netrw#BrowseXVis()<CR>
Last set from /usr/share/vim/vim80/plugin/netrwPlugin.vim
n <Plug>NetrwBrowseX * :call netrw#BrowseX(expand((exists("g:netrw_gx")? g:netrw_gx : '<cfile>')),netrw#CheckIfRemote())<CR>
Last set from /usr/share/vim/vim80/plugin/netrwPlugin.vim
n <F2> * :wq<CR>
Last set from ~/.vimrc
n <F1> * <Nop>
Last set from ~/.vimrc
n ´ * :set list!<CR>:echo "List is ".&expandtab<CR>
Last set from ~/.vimrc
n ³ * :set expandtab!<CR>:echo "Expand tab is ".&expandtab<CR>
Last set from ~/.vimrc
n ö * :vs<CR>
Last set from ~/.vimrc
n ó * :%s/
Last set from ~/.vimrc
n ÷ * :set wrap!<CR>
Last set from ~/.vimrc
n î * :tabnext<CR>
Last set from ~/.vimrc
n ð * :tabprevious<CR>
Last set from ~/.vimrc
n ì * :!ls<CR>
Last set from ~/.vimrc
n æ * :Grep
Last set from ~/.vimrc
n å * :e
Last set from ~/.vimrc
n ï * :b
Last set from ~/.vimrc
n ô * :call ReportFileSaveMark()<CR>
Last set from ~/.vimrc


How do I find out why my Vim doesn't immediately exit visual mode when I press <Esc>?










share|improve this question









New contributor




jojman is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.















  • 2




    You have mappings whose lhs are <Left>, <Right>, <S-Tab>. On my machine, they all produce a sequence of keys beginning with Escape. To check whether this is the case on your machine too, try to insert them literally on the command-line, by pressing C-v Left, C-v Right, C-v S-Tab. You may need to tweak the options 'timeoutlen' and 'ttimeoutlen'. What are their values? Does the issue persist if you execute: set timeout timeoutlen=3000 ttimeoutlen=100 (taken from :h 'ttm)?
    – user938271
    4 hours ago







  • 1




    @user938271 timeoutlen=1000, ttimeoutlen=-1. I removed all mappings that start with Left, Right or S-Tab and it didn't help. But setting ttimeoutlen=100 did help, thanks.
    – jojman
    3 hours ago










  • @user938271 When you get around to it, you should add your comment as an answer so that it can help others that stumble upon this question, and so that jojman can accept it.
    – ZeroKnight
    3 hours ago














up vote
1
down vote

favorite
1












When I press <Esc> in visual mode, I don't immediately return to normal mode (the selection persists). I think that is because I have a mapping defined in visual mode shat starts from <Esc>. I tried doing the following to find that mapping:



:redir! > vim_keys.txt
:silent verbose map
:redir END


But there are no mappings that start with <Esc>:



v [" *@:<C-U>exe "normal! gv"|call search('%(^s*".*n)%(^s*")@!', "bW")<CR>
Last set from /usr/share/vim/vim80/ftplugin/vim.vim
n [" *@:call search('%(^s*".*n)%(^s*")@!', "bW")<CR>
Last set from /usr/share/vim/vim80/ftplugin/vim.vim
v *@m':<C-U>exe "normal! gv"|call search('^s*endf*%[unction]>', "bW")<CR>
Last set from /usr/share/vim/vim80/ftplugin/vim.vim
n *@m':call search('^s*endf*%[unction]>', "bW")<CR>
Last set from /usr/share/vim/vim80/ftplugin/vim.vim
v [[ *@m':<C-U>exe "normal! gv"|call search('^s*fu%[nction]>', "bW")<CR>
Last set from /usr/share/vim/vim80/ftplugin/vim.vim n [[ *@m':call search('^s*fu%[nction]>', "bW")<CR> Last set from /usr/share/vim/vim80/ftplugin/vim.vim
v ]" *@:<C-U>exe "normal! gv"|call search('^(s*".*n)@<!(s*")', "W")<CR>
Last set from /usr/share/vim/vim80/ftplugin/vim.vim
n ]" *@:call search('^(s*".*n)@<!(s*")', "W")<CR>
Last set from /usr/share/vim/vim80/ftplugin/vim.vim
v ][ *@m':<C-U>exe "normal! gv"|call search('^s*endf*%[unction]>', "W")<CR>
Last set from /usr/share/vim/vim80/ftplugin/vim.vim
n ][ *@m':call search('^s*endf*%[unction]>', "W")<CR>
Last set from /usr/share/vim/vim80/ftplugin/vim.vim
v ]] *@m':<C-U>exe "normal! gv"|call search('^s*fu%[nction]>', "W")<CR>
Last set from /usr/share/vim/vim80/ftplugin/vim.vim
n ]] *@m':call search('^s*fu%[nction]>', "W")<CR>
Last set from /usr/share/vim/vim80/ftplugin/vim.vim
v <C-Z> * <Nop>
Last set from ~/.vimrc
n <Space> * zR
Last set from ~/.vimrc
n ,bd * :Bclose<CR>
Last set from ~/.dotfiles/.vim/plugin/bclose.vim
, <Plug>(easymotion-prefix)
Last set from ~/.vimrc
n ,gl * :!git log<CR>
Last set from ~/.vimrc
n ,gp * :!git push<CR>
Last set from ~/.vimrc
n ,gc * :!git commit -m '
Last set from ~/.vimrc
n ,ga * :!git add
Last set from ~/.vimrc
n ,gs * :!git status<CR>
Last set from ~/.vimrc
n ,rs * :so $MYVIMRC<CR>
Last set from ~/.vimrc
n ,rr * :vsplit $MYVIMRC<CR>
Last set from ~/.vimrc
n ,sc * :SessionClose<CR>
Last set from ~/.vimrc
n ,ss * :SessionSave<CR>
Last set from ~/.vimrc
n ,sl * :SessionList<CR>
Last set from ~/.vimrc
n =A * gg=G<C-O><C-O>
Last set from ~/.vimrc
n H * ^
Last set from ~/.vimrc
n L * $
Last set from ~/.vimrc
n Q * :q<CR>
Last set from ~/.vimrc
v gx <Plug>NetrwBrowseXVis
Last set from /usr/share/vim/vim80/plugin/netrwPlugin.vim
n gx <Plug>NetrwBrowseX
Last set from /usr/share/vim/vim80/plugin/netrwPlugin.vim
o p * i(
Last set from ~/.vimrc
v <Plug>NetrwBrowseXVis * :<C-U>call netrw#BrowseXVis()<CR>
Last set from /usr/share/vim/vim80/plugin/netrwPlugin.vim
n <Plug>NetrwBrowseX * :call netrw#BrowseX(expand((exists("g:netrw_gx")? g:netrw_gx : '<cfile>')),netrw#CheckIfRemote())<CR>
Last set from /usr/share/vim/vim80/plugin/netrwPlugin.vim
n <F2> * :wq<CR>
Last set from ~/.vimrc
n <F1> * <Nop>
Last set from ~/.vimrc
n ´ * :set list!<CR>:echo "List is ".&expandtab<CR>
Last set from ~/.vimrc
n ³ * :set expandtab!<CR>:echo "Expand tab is ".&expandtab<CR>
Last set from ~/.vimrc
n ö * :vs<CR>
Last set from ~/.vimrc
n ó * :%s/
Last set from ~/.vimrc
n ÷ * :set wrap!<CR>
Last set from ~/.vimrc
n î * :tabnext<CR>
Last set from ~/.vimrc
n ð * :tabprevious<CR>
Last set from ~/.vimrc
n ì * :!ls<CR>
Last set from ~/.vimrc
n æ * :Grep
Last set from ~/.vimrc
n å * :e
Last set from ~/.vimrc
n ï * :b
Last set from ~/.vimrc
n ô * :call ReportFileSaveMark()<CR>
Last set from ~/.vimrc


How do I find out why my Vim doesn't immediately exit visual mode when I press <Esc>?










share|improve this question









New contributor




jojman is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.















  • 2




    You have mappings whose lhs are <Left>, <Right>, <S-Tab>. On my machine, they all produce a sequence of keys beginning with Escape. To check whether this is the case on your machine too, try to insert them literally on the command-line, by pressing C-v Left, C-v Right, C-v S-Tab. You may need to tweak the options 'timeoutlen' and 'ttimeoutlen'. What are their values? Does the issue persist if you execute: set timeout timeoutlen=3000 ttimeoutlen=100 (taken from :h 'ttm)?
    – user938271
    4 hours ago







  • 1




    @user938271 timeoutlen=1000, ttimeoutlen=-1. I removed all mappings that start with Left, Right or S-Tab and it didn't help. But setting ttimeoutlen=100 did help, thanks.
    – jojman
    3 hours ago










  • @user938271 When you get around to it, you should add your comment as an answer so that it can help others that stumble upon this question, and so that jojman can accept it.
    – ZeroKnight
    3 hours ago












up vote
1
down vote

favorite
1









up vote
1
down vote

favorite
1






1





When I press <Esc> in visual mode, I don't immediately return to normal mode (the selection persists). I think that is because I have a mapping defined in visual mode shat starts from <Esc>. I tried doing the following to find that mapping:



:redir! > vim_keys.txt
:silent verbose map
:redir END


But there are no mappings that start with <Esc>:



v [" *@:<C-U>exe "normal! gv"|call search('%(^s*".*n)%(^s*")@!', "bW")<CR>
Last set from /usr/share/vim/vim80/ftplugin/vim.vim
n [" *@:call search('%(^s*".*n)%(^s*")@!', "bW")<CR>
Last set from /usr/share/vim/vim80/ftplugin/vim.vim
v *@m':<C-U>exe "normal! gv"|call search('^s*endf*%[unction]>', "bW")<CR>
Last set from /usr/share/vim/vim80/ftplugin/vim.vim
n *@m':call search('^s*endf*%[unction]>', "bW")<CR>
Last set from /usr/share/vim/vim80/ftplugin/vim.vim
v [[ *@m':<C-U>exe "normal! gv"|call search('^s*fu%[nction]>', "bW")<CR>
Last set from /usr/share/vim/vim80/ftplugin/vim.vim n [[ *@m':call search('^s*fu%[nction]>', "bW")<CR> Last set from /usr/share/vim/vim80/ftplugin/vim.vim
v ]" *@:<C-U>exe "normal! gv"|call search('^(s*".*n)@<!(s*")', "W")<CR>
Last set from /usr/share/vim/vim80/ftplugin/vim.vim
n ]" *@:call search('^(s*".*n)@<!(s*")', "W")<CR>
Last set from /usr/share/vim/vim80/ftplugin/vim.vim
v ][ *@m':<C-U>exe "normal! gv"|call search('^s*endf*%[unction]>', "W")<CR>
Last set from /usr/share/vim/vim80/ftplugin/vim.vim
n ][ *@m':call search('^s*endf*%[unction]>', "W")<CR>
Last set from /usr/share/vim/vim80/ftplugin/vim.vim
v ]] *@m':<C-U>exe "normal! gv"|call search('^s*fu%[nction]>', "W")<CR>
Last set from /usr/share/vim/vim80/ftplugin/vim.vim
n ]] *@m':call search('^s*fu%[nction]>', "W")<CR>
Last set from /usr/share/vim/vim80/ftplugin/vim.vim
v <C-Z> * <Nop>
Last set from ~/.vimrc
n <Space> * zR
Last set from ~/.vimrc
n ,bd * :Bclose<CR>
Last set from ~/.dotfiles/.vim/plugin/bclose.vim
, <Plug>(easymotion-prefix)
Last set from ~/.vimrc
n ,gl * :!git log<CR>
Last set from ~/.vimrc
n ,gp * :!git push<CR>
Last set from ~/.vimrc
n ,gc * :!git commit -m '
Last set from ~/.vimrc
n ,ga * :!git add
Last set from ~/.vimrc
n ,gs * :!git status<CR>
Last set from ~/.vimrc
n ,rs * :so $MYVIMRC<CR>
Last set from ~/.vimrc
n ,rr * :vsplit $MYVIMRC<CR>
Last set from ~/.vimrc
n ,sc * :SessionClose<CR>
Last set from ~/.vimrc
n ,ss * :SessionSave<CR>
Last set from ~/.vimrc
n ,sl * :SessionList<CR>
Last set from ~/.vimrc
n =A * gg=G<C-O><C-O>
Last set from ~/.vimrc
n H * ^
Last set from ~/.vimrc
n L * $
Last set from ~/.vimrc
n Q * :q<CR>
Last set from ~/.vimrc
v gx <Plug>NetrwBrowseXVis
Last set from /usr/share/vim/vim80/plugin/netrwPlugin.vim
n gx <Plug>NetrwBrowseX
Last set from /usr/share/vim/vim80/plugin/netrwPlugin.vim
o p * i(
Last set from ~/.vimrc
v <Plug>NetrwBrowseXVis * :<C-U>call netrw#BrowseXVis()<CR>
Last set from /usr/share/vim/vim80/plugin/netrwPlugin.vim
n <Plug>NetrwBrowseX * :call netrw#BrowseX(expand((exists("g:netrw_gx")? g:netrw_gx : '<cfile>')),netrw#CheckIfRemote())<CR>
Last set from /usr/share/vim/vim80/plugin/netrwPlugin.vim
n <F2> * :wq<CR>
Last set from ~/.vimrc
n <F1> * <Nop>
Last set from ~/.vimrc
n ´ * :set list!<CR>:echo "List is ".&expandtab<CR>
Last set from ~/.vimrc
n ³ * :set expandtab!<CR>:echo "Expand tab is ".&expandtab<CR>
Last set from ~/.vimrc
n ö * :vs<CR>
Last set from ~/.vimrc
n ó * :%s/
Last set from ~/.vimrc
n ÷ * :set wrap!<CR>
Last set from ~/.vimrc
n î * :tabnext<CR>
Last set from ~/.vimrc
n ð * :tabprevious<CR>
Last set from ~/.vimrc
n ì * :!ls<CR>
Last set from ~/.vimrc
n æ * :Grep
Last set from ~/.vimrc
n å * :e
Last set from ~/.vimrc
n ï * :b
Last set from ~/.vimrc
n ô * :call ReportFileSaveMark()<CR>
Last set from ~/.vimrc


How do I find out why my Vim doesn't immediately exit visual mode when I press <Esc>?










share|improve this question









New contributor




jojman is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











When I press <Esc> in visual mode, I don't immediately return to normal mode (the selection persists). I think that is because I have a mapping defined in visual mode shat starts from <Esc>. I tried doing the following to find that mapping:



:redir! > vim_keys.txt
:silent verbose map
:redir END


But there are no mappings that start with <Esc>:



v [" *@:<C-U>exe "normal! gv"|call search('%(^s*".*n)%(^s*")@!', "bW")<CR>
Last set from /usr/share/vim/vim80/ftplugin/vim.vim
n [" *@:call search('%(^s*".*n)%(^s*")@!', "bW")<CR>
Last set from /usr/share/vim/vim80/ftplugin/vim.vim
v *@m':<C-U>exe "normal! gv"|call search('^s*endf*%[unction]>', "bW")<CR>
Last set from /usr/share/vim/vim80/ftplugin/vim.vim
n *@m':call search('^s*endf*%[unction]>', "bW")<CR>
Last set from /usr/share/vim/vim80/ftplugin/vim.vim
v [[ *@m':<C-U>exe "normal! gv"|call search('^s*fu%[nction]>', "bW")<CR>
Last set from /usr/share/vim/vim80/ftplugin/vim.vim n [[ *@m':call search('^s*fu%[nction]>', "bW")<CR> Last set from /usr/share/vim/vim80/ftplugin/vim.vim
v ]" *@:<C-U>exe "normal! gv"|call search('^(s*".*n)@<!(s*")', "W")<CR>
Last set from /usr/share/vim/vim80/ftplugin/vim.vim
n ]" *@:call search('^(s*".*n)@<!(s*")', "W")<CR>
Last set from /usr/share/vim/vim80/ftplugin/vim.vim
v ][ *@m':<C-U>exe "normal! gv"|call search('^s*endf*%[unction]>', "W")<CR>
Last set from /usr/share/vim/vim80/ftplugin/vim.vim
n ][ *@m':call search('^s*endf*%[unction]>', "W")<CR>
Last set from /usr/share/vim/vim80/ftplugin/vim.vim
v ]] *@m':<C-U>exe "normal! gv"|call search('^s*fu%[nction]>', "W")<CR>
Last set from /usr/share/vim/vim80/ftplugin/vim.vim
n ]] *@m':call search('^s*fu%[nction]>', "W")<CR>
Last set from /usr/share/vim/vim80/ftplugin/vim.vim
v <C-Z> * <Nop>
Last set from ~/.vimrc
n <Space> * zR
Last set from ~/.vimrc
n ,bd * :Bclose<CR>
Last set from ~/.dotfiles/.vim/plugin/bclose.vim
, <Plug>(easymotion-prefix)
Last set from ~/.vimrc
n ,gl * :!git log<CR>
Last set from ~/.vimrc
n ,gp * :!git push<CR>
Last set from ~/.vimrc
n ,gc * :!git commit -m '
Last set from ~/.vimrc
n ,ga * :!git add
Last set from ~/.vimrc
n ,gs * :!git status<CR>
Last set from ~/.vimrc
n ,rs * :so $MYVIMRC<CR>
Last set from ~/.vimrc
n ,rr * :vsplit $MYVIMRC<CR>
Last set from ~/.vimrc
n ,sc * :SessionClose<CR>
Last set from ~/.vimrc
n ,ss * :SessionSave<CR>
Last set from ~/.vimrc
n ,sl * :SessionList<CR>
Last set from ~/.vimrc
n =A * gg=G<C-O><C-O>
Last set from ~/.vimrc
n H * ^
Last set from ~/.vimrc
n L * $
Last set from ~/.vimrc
n Q * :q<CR>
Last set from ~/.vimrc
v gx <Plug>NetrwBrowseXVis
Last set from /usr/share/vim/vim80/plugin/netrwPlugin.vim
n gx <Plug>NetrwBrowseX
Last set from /usr/share/vim/vim80/plugin/netrwPlugin.vim
o p * i(
Last set from ~/.vimrc
v <Plug>NetrwBrowseXVis * :<C-U>call netrw#BrowseXVis()<CR>
Last set from /usr/share/vim/vim80/plugin/netrwPlugin.vim
n <Plug>NetrwBrowseX * :call netrw#BrowseX(expand((exists("g:netrw_gx")? g:netrw_gx : '<cfile>')),netrw#CheckIfRemote())<CR>
Last set from /usr/share/vim/vim80/plugin/netrwPlugin.vim
n <F2> * :wq<CR>
Last set from ~/.vimrc
n <F1> * <Nop>
Last set from ~/.vimrc
n ´ * :set list!<CR>:echo "List is ".&expandtab<CR>
Last set from ~/.vimrc
n ³ * :set expandtab!<CR>:echo "Expand tab is ".&expandtab<CR>
Last set from ~/.vimrc
n ö * :vs<CR>
Last set from ~/.vimrc
n ó * :%s/
Last set from ~/.vimrc
n ÷ * :set wrap!<CR>
Last set from ~/.vimrc
n î * :tabnext<CR>
Last set from ~/.vimrc
n ð * :tabprevious<CR>
Last set from ~/.vimrc
n ì * :!ls<CR>
Last set from ~/.vimrc
n æ * :Grep
Last set from ~/.vimrc
n å * :e
Last set from ~/.vimrc
n ï * :b
Last set from ~/.vimrc
n ô * :call ReportFileSaveMark()<CR>
Last set from ~/.vimrc


How do I find out why my Vim doesn't immediately exit visual mode when I press <Esc>?







key-bindings visual-mode






share|improve this question









New contributor




jojman is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




jojman is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited 3 hours ago





















New contributor




jojman is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked 4 hours ago









jojman

1085




1085




New contributor




jojman is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





jojman is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






jojman is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.







  • 2




    You have mappings whose lhs are <Left>, <Right>, <S-Tab>. On my machine, they all produce a sequence of keys beginning with Escape. To check whether this is the case on your machine too, try to insert them literally on the command-line, by pressing C-v Left, C-v Right, C-v S-Tab. You may need to tweak the options 'timeoutlen' and 'ttimeoutlen'. What are their values? Does the issue persist if you execute: set timeout timeoutlen=3000 ttimeoutlen=100 (taken from :h 'ttm)?
    – user938271
    4 hours ago







  • 1




    @user938271 timeoutlen=1000, ttimeoutlen=-1. I removed all mappings that start with Left, Right or S-Tab and it didn't help. But setting ttimeoutlen=100 did help, thanks.
    – jojman
    3 hours ago










  • @user938271 When you get around to it, you should add your comment as an answer so that it can help others that stumble upon this question, and so that jojman can accept it.
    – ZeroKnight
    3 hours ago












  • 2




    You have mappings whose lhs are <Left>, <Right>, <S-Tab>. On my machine, they all produce a sequence of keys beginning with Escape. To check whether this is the case on your machine too, try to insert them literally on the command-line, by pressing C-v Left, C-v Right, C-v S-Tab. You may need to tweak the options 'timeoutlen' and 'ttimeoutlen'. What are their values? Does the issue persist if you execute: set timeout timeoutlen=3000 ttimeoutlen=100 (taken from :h 'ttm)?
    – user938271
    4 hours ago







  • 1




    @user938271 timeoutlen=1000, ttimeoutlen=-1. I removed all mappings that start with Left, Right or S-Tab and it didn't help. But setting ttimeoutlen=100 did help, thanks.
    – jojman
    3 hours ago










  • @user938271 When you get around to it, you should add your comment as an answer so that it can help others that stumble upon this question, and so that jojman can accept it.
    – ZeroKnight
    3 hours ago







2




2




You have mappings whose lhs are <Left>, <Right>, <S-Tab>. On my machine, they all produce a sequence of keys beginning with Escape. To check whether this is the case on your machine too, try to insert them literally on the command-line, by pressing C-v Left, C-v Right, C-v S-Tab. You may need to tweak the options 'timeoutlen' and 'ttimeoutlen'. What are their values? Does the issue persist if you execute: set timeout timeoutlen=3000 ttimeoutlen=100 (taken from :h 'ttm)?
– user938271
4 hours ago





You have mappings whose lhs are <Left>, <Right>, <S-Tab>. On my machine, they all produce a sequence of keys beginning with Escape. To check whether this is the case on your machine too, try to insert them literally on the command-line, by pressing C-v Left, C-v Right, C-v S-Tab. You may need to tweak the options 'timeoutlen' and 'ttimeoutlen'. What are their values? Does the issue persist if you execute: set timeout timeoutlen=3000 ttimeoutlen=100 (taken from :h 'ttm)?
– user938271
4 hours ago





1




1




@user938271 timeoutlen=1000, ttimeoutlen=-1. I removed all mappings that start with Left, Right or S-Tab and it didn't help. But setting ttimeoutlen=100 did help, thanks.
– jojman
3 hours ago




@user938271 timeoutlen=1000, ttimeoutlen=-1. I removed all mappings that start with Left, Right or S-Tab and it didn't help. But setting ttimeoutlen=100 did help, thanks.
– jojman
3 hours ago












@user938271 When you get around to it, you should add your comment as an answer so that it can help others that stumble upon this question, and so that jojman can accept it.
– ZeroKnight
3 hours ago




@user938271 When you get around to it, you should add your comment as an answer so that it can help others that stumble upon this question, and so that jojman can accept it.
– ZeroKnight
3 hours ago










1 Answer
1






active

oldest

votes

















up vote
3
down vote



accepted










It's possible that you had a mapping in visual mode whose lhs produces a sequence of key codes beginning with Escape.
You can check what is the sequence of key codes produced by a key by pressing on the command-line:



C-v <key>


For example, on my machine, F1 produces:



^[OP


^[ is the caret notation of the Escape key.



If you have a visual-mode mapping whose lhs is F1, when you press Escape in visual mode, Vim may wait for OP to come.



You can tweak the amount of time Vim waits for a sequence of key codes to complete with the option 'ttimeoutlen'.
By default, its value is -1, which means that Vim uses the value of 'timeoutlen'.

This other option controls the amount of time Vim waits for the lhs of a mapping to complete.
The default value of the latter is 1000ms.



The help at :h 'ttm suggests the following command:



:set timeout timeoutlen=3000 ttimeoutlen=100
├─────┘ ├─────────────┘ ├─────────────┘
│ │ └ wait 0.1s for a sequence of key codes to complete
│ │
│ └ waits 3s for a mapping to complete
│
└ don't wait indefinitely for the `lhs` a mapping or a sequence of key code to complete





share|improve this answer




















    Your Answer







    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "599"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    convertImagesToLinks: false,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );






    jojman is a new contributor. Be nice, and check out our Code of Conduct.









     

    draft saved


    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fvi.stackexchange.com%2fquestions%2f17469%2fhow-to-find-why-esc-doesnt-work-right-away-in-visual-mode%23new-answer', 'question_page');

    );

    Post as a guest






























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    3
    down vote



    accepted










    It's possible that you had a mapping in visual mode whose lhs produces a sequence of key codes beginning with Escape.
    You can check what is the sequence of key codes produced by a key by pressing on the command-line:



    C-v <key>


    For example, on my machine, F1 produces:



    ^[OP


    ^[ is the caret notation of the Escape key.



    If you have a visual-mode mapping whose lhs is F1, when you press Escape in visual mode, Vim may wait for OP to come.



    You can tweak the amount of time Vim waits for a sequence of key codes to complete with the option 'ttimeoutlen'.
    By default, its value is -1, which means that Vim uses the value of 'timeoutlen'.

    This other option controls the amount of time Vim waits for the lhs of a mapping to complete.
    The default value of the latter is 1000ms.



    The help at :h 'ttm suggests the following command:



    :set timeout timeoutlen=3000 ttimeoutlen=100
    ├─────┘ ├─────────────┘ ├─────────────┘
    │ │ └ wait 0.1s for a sequence of key codes to complete
    │ │
    │ └ waits 3s for a mapping to complete
    │
    └ don't wait indefinitely for the `lhs` a mapping or a sequence of key code to complete





    share|improve this answer
























      up vote
      3
      down vote



      accepted










      It's possible that you had a mapping in visual mode whose lhs produces a sequence of key codes beginning with Escape.
      You can check what is the sequence of key codes produced by a key by pressing on the command-line:



      C-v <key>


      For example, on my machine, F1 produces:



      ^[OP


      ^[ is the caret notation of the Escape key.



      If you have a visual-mode mapping whose lhs is F1, when you press Escape in visual mode, Vim may wait for OP to come.



      You can tweak the amount of time Vim waits for a sequence of key codes to complete with the option 'ttimeoutlen'.
      By default, its value is -1, which means that Vim uses the value of 'timeoutlen'.

      This other option controls the amount of time Vim waits for the lhs of a mapping to complete.
      The default value of the latter is 1000ms.



      The help at :h 'ttm suggests the following command:



      :set timeout timeoutlen=3000 ttimeoutlen=100
      ├─────┘ ├─────────────┘ ├─────────────┘
      │ │ └ wait 0.1s for a sequence of key codes to complete
      │ │
      │ └ waits 3s for a mapping to complete
      │
      └ don't wait indefinitely for the `lhs` a mapping or a sequence of key code to complete





      share|improve this answer






















        up vote
        3
        down vote



        accepted







        up vote
        3
        down vote



        accepted






        It's possible that you had a mapping in visual mode whose lhs produces a sequence of key codes beginning with Escape.
        You can check what is the sequence of key codes produced by a key by pressing on the command-line:



        C-v <key>


        For example, on my machine, F1 produces:



        ^[OP


        ^[ is the caret notation of the Escape key.



        If you have a visual-mode mapping whose lhs is F1, when you press Escape in visual mode, Vim may wait for OP to come.



        You can tweak the amount of time Vim waits for a sequence of key codes to complete with the option 'ttimeoutlen'.
        By default, its value is -1, which means that Vim uses the value of 'timeoutlen'.

        This other option controls the amount of time Vim waits for the lhs of a mapping to complete.
        The default value of the latter is 1000ms.



        The help at :h 'ttm suggests the following command:



        :set timeout timeoutlen=3000 ttimeoutlen=100
        ├─────┘ ├─────────────┘ ├─────────────┘
        │ │ └ wait 0.1s for a sequence of key codes to complete
        │ │
        │ └ waits 3s for a mapping to complete
        │
        └ don't wait indefinitely for the `lhs` a mapping or a sequence of key code to complete





        share|improve this answer












        It's possible that you had a mapping in visual mode whose lhs produces a sequence of key codes beginning with Escape.
        You can check what is the sequence of key codes produced by a key by pressing on the command-line:



        C-v <key>


        For example, on my machine, F1 produces:



        ^[OP


        ^[ is the caret notation of the Escape key.



        If you have a visual-mode mapping whose lhs is F1, when you press Escape in visual mode, Vim may wait for OP to come.



        You can tweak the amount of time Vim waits for a sequence of key codes to complete with the option 'ttimeoutlen'.
        By default, its value is -1, which means that Vim uses the value of 'timeoutlen'.

        This other option controls the amount of time Vim waits for the lhs of a mapping to complete.
        The default value of the latter is 1000ms.



        The help at :h 'ttm suggests the following command:



        :set timeout timeoutlen=3000 ttimeoutlen=100
        ├─────┘ ├─────────────┘ ├─────────────┘
        │ │ └ wait 0.1s for a sequence of key codes to complete
        │ │
        │ └ waits 3s for a mapping to complete
        │
        └ don't wait indefinitely for the `lhs` a mapping or a sequence of key code to complete






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered 3 hours ago









        user938271

        36114




        36114




















            jojman is a new contributor. Be nice, and check out our Code of Conduct.









             

            draft saved


            draft discarded


















            jojman is a new contributor. Be nice, and check out our Code of Conduct.












            jojman is a new contributor. Be nice, and check out our Code of Conduct.











            jojman is a new contributor. Be nice, and check out our Code of Conduct.













             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fvi.stackexchange.com%2fquestions%2f17469%2fhow-to-find-why-esc-doesnt-work-right-away-in-visual-mode%23new-answer', 'question_page');

            );

            Post as a guest













































































            Comments

            Popular posts from this blog

            Long meetings (6-7 hours a day): Being “babysat” by supervisor

            Is the Concept of Multiple Fantasy Races Scientifically Flawed? [closed]

            Confectionery