Unable to display <S-CR> in Vim
Got my first Mac for the weekend, and I'm trying to set it up. This line in my vimrc that worked on my windows will not work with vim via iTerm
inoremap <S-CR> <Esc>
I want Shift-Enter to execute the Escape function in insert mode. I tried using Enter and Return, but this requires me to use the Fn key on my Macbook, which is just as annoying as the escape key.
I appreciate the help!
+5
3 answers
The problem here is in terminal emulation. Most terminals cannot distinguish between non-printable keys [1] and these keys in combination with modifier keys.
, (, iTerm2). Unicode, , Vim , .
, iTerm2, " ", , , Set Text, ✠ ( , ) . .vimrc :
" Map ✠ (U+2720) to <Esc> as <S-CR> is mapped to ✠ in iTerm2.
inoremap ✠ <Esc>
:
inoremap <S-CR> <Esc>
" Map ✠ (U+2720) to <S-CR>, so we have <S-CR> mapped to ✠ in iTerm2 and
" ✠ mapped back to <S-CR> in Vim.
imap ✠ <S-CR>
<S-CR> Vim iTerm2 <Esc> Vim .
[1]: . , , , , , alt, .
+14