1

To do a mapping for return I can do:

"When in normal mode, treat an enter like insert+enter
:nnoremap <CR> i<CR>

However, I would also like to map a shift-enter as:

:nnoremap <Shift-CF> O

What would be the proper way to enter this in?

I tried this but it doesn't do anything -- regardless of whether I hold shift or not, the mapping always does the first one:

"When in normal mode, treat an enter like insert+enter
:nnoremap <CR> i<CR>      <-- always doing this one (maybe overwriting the other?)
:nnoremap <s-CR> O

Update: it seems this is not possible, see: https://stackoverflow.com/questions/16359878/vim-how-to-map-shift-enter.

  • @filbranden what is 'deoplete' ? – David542 Apr 24 at 2:43
  • 1
    it's a completion plug-in. That question is essentially about using Shift-Enter as well. I wanted to mark this one as a duplicate, but I don't know if that one is best... Perhaps if you'd want to self answer with your update (that should be an answer rather than an edit), that would be better actually. – filbranden Apr 24 at 3:24
  • 1
    This might be possible with xterms modifyOtherKeys. – Christian Brabandt Apr 24 at 5:35