macvim not respecting os/x shortcuts I have macvim working as expected on my older mac. On a newly minted Mac however, the normal key sequences to select, copy, and paste text:


  Shift arrow keys (select)
  Command C, Command X, Command V (copy, cut, paste)



are not being recognized.

Then there must be some settings/configuration required to get the Cut/Copy/Select using OS/X keystrokes to work in macvim?  What is/are those settings?

thanks!
I actually had to enable cua mode manually.  That had not been necessary on my other Mac - so it is strange.
~/.vim/plugin/cua-mode.vim

Taken from:
https://raw.githubusercontent.com/fabi1cazenave/cua-mode.vim/master/plugin/cua-mode.vim
&quot;|
&quot;| File    : ~/.vim/plugin/cua-mode.vim
&quot;| Source  : https://github.com/fabi1cazenave/cua-mode
&quot;| Licence : WTFPL
&quot;|
&quot;| This file brings Notepad-like CTRL-ZXCV shortcuts to Vim, while preserving
&quot;| all other Vim shortcuts -- like the CUA-mode does on Emacs:
&quot;|           http://www.emacswiki.org/CuaMode
&quot;|
&quot;| It is based on Bram Molenaar's mswin.vim, g:cua_mode sets the behavior:
&quot;|   0. raw
&quot;|   1. CUA mode     =   (default)  CTRL-ZXCV -- subset of mswin.vim
&quot;|   2. mswin mode   =   CUA mode + CTRL-ASY  -- strict equivalent of mswin.vim
&quot;|   3. Notepad mode = mswin mode + CTRL-QOF  -- superset of mswin.vim
&quot;|

&quot; don't load $VIMRUNTIME/mswin.vim
let g:skip_loading_mswin=1

&quot; bail out if this isn't wanted (i.e. when g:cua_mode is defined to 0).
if !exists('g:cua_mode')
  let g:cua_mode = 1
elseif g:cua_mode == 0
  finish
endif

&quot; recommended settings:
&quot; set nocompatible   &quot; required for a multi-level undo/redo stack
&quot; set mouse=a        &quot; enables mouse selection

&quot; set the 'cpoptions' to its Vim default
let s:save_cpo = &amp;cpoptions
set cpo&amp;vim

&quot; behave like xterm when not in GUI mode
behave xterm
if has('gui_running')
  set mousemodel=popup_setpos   &quot; right-click displays a popup menu
  set keymodel=startsel,stopsel &quot; shift+arrows triggers the select mode
endif

&quot; backspace and cursor keys wrap to previous/next line
set backspace=indent,eol,start whichwrap+=&lt;,&gt;,[,]

&quot; backspace in Visual mode deletes selection
vnoremap &lt;BS&gt; d

&quot; don't mess with CTRL-* shortcuts on MacOSX
if has('unix') &amp;&amp; (system('uname') =~ '^Darwin')
  finish
endif

&quot;|    Common PC shortcuts: CTRL-ZXCV &lt;=&gt; Undo|Cut|Copy|Paste                &lt;&lt;&lt;
&quot;|-----------------------------------------------------------------------------

&quot; CTRL-Z is Undo
noremap  &lt;C-Z&gt; u
inoremap &lt;C-Z&gt; &lt;C-O&gt;u

&quot; CTRL-X and SHIFT-Del are Cut
vnoremap &lt;C-X&gt;   &quot;+x
vnoremap &lt;S-Del&gt; &quot;+x

&quot; CTRL-C and CTRL-Insert are Copy
vnoremap &lt;C-C&gt;      &quot;+y
vnoremap &lt;C-Insert&gt; &quot;+y

&quot; CTRL-V and SHIFT-Insert are Paste
map &lt;C-V&gt;      &quot;+gP
map &lt;S-Insert&gt; &quot;+gP

cmap &lt;C-V&gt;      &lt;C-R&gt;+
cmap &lt;S-Insert&gt; &lt;C-R&gt;+

&quot; Pasting blockwise and linewise selections is not possible in Insert and
&quot; Visual mode without the +virtualedit feature.  They are pasted as if they
&quot; were characterwise instead.
&quot; Uses the paste.vim autoload script.

exe 'inoremap &lt;script&gt; &lt;C-V&gt;' paste#paste_cmd['i']
exe 'vnoremap &lt;script&gt; &lt;C-V&gt;' paste#paste_cmd['v']

imap &lt;S-Insert&gt; &lt;C-V&gt;
vmap &lt;S-Insert&gt; &lt;C-V&gt;

&quot; XXX For CTRL-V to work autoselect must be off.
&quot; On Unix we have two selections, autoselect can be used.
if !has(&quot;unix&quot;)
  set guioptions-=a
endif
&quot; &gt;&gt;&gt;

&quot; Note: some shells may eat CTRL-S and CTRL-Q (= XOFF/XON) to suspend/resume
&quot; the display.  This can be avoided by adding this to ~/.bashrc or ~/.zshrc:
&quot;     stty -ixon

&quot;|    #1 Use CTRL-S and CTRL-Q to do what CTRL-Z and CTRL-V used to do      &lt;&lt;&lt;
&quot;|-----------------------------------------------------------------------------
&quot; XXX: not working in gVim

&quot; CTRL-Q &lt;=&gt; rectangular selection or special character insertion
noremap &lt;C-Q&gt; &lt;C-V&gt;

&quot; CTRL-S &lt;=&gt; suspend Vim (resume with fg)
noremap &lt;C-S&gt; &lt;C-Z&gt;
&quot; &gt;&gt;&gt;

&quot;|    #2 Alternative: mswin-like behavior for CTRL-SAY                      &lt;&lt;&lt;
&quot;|-----------------------------------------------------------------------------
&quot; This should be strictly equivalent to the $VIMRUNTIME/mswin.vim behavior.

if g:cua_mode &lt; 2
  finish
endif

&quot; CTRL-S is Save
noremap  &lt;C-S&gt;      :update&lt;CR&gt;
vnoremap &lt;C-S&gt; &lt;C-C&gt;:update&lt;CR&gt;
inoremap &lt;C-S&gt; &lt;C-O&gt;:update&lt;CR&gt;

&quot; CTRL-A is Select All
noremap  &lt;C-A&gt; gggH&lt;C-O&gt;G
inoremap &lt;C-A&gt; &lt;C-O&gt;gg&lt;C-O&gt;gH&lt;C-O&gt;G
cnoremap &lt;C-A&gt; &lt;C-C&gt;gggH&lt;C-O&gt;G
onoremap &lt;C-A&gt; &lt;C-C&gt;gggH&lt;C-O&gt;G
snoremap &lt;C-A&gt; &lt;C-C&gt;gggH&lt;C-O&gt;G
xnoremap &lt;C-A&gt; &lt;C-C&gt;ggVG

&quot; CTRL-Y is Redo (although not repeat); not in cmdline though
noremap  &lt;C-Y&gt;      &lt;C-R&gt;
inoremap &lt;C-Y&gt; &lt;C-O&gt;&lt;C-R&gt;

&quot; ALT-Space is System menu
if has('gui_running')
  noremap  &lt;M-Space&gt;      :simalt ~&lt;CR&gt;
  inoremap &lt;M-Space&gt; &lt;C-O&gt;:simalt ~&lt;CR&gt;
  cnoremap &lt;M-Space&gt; &lt;C-C&gt;:simalt ~&lt;CR&gt;
endif

&quot; CTRL-Tab is Next window
noremap  &lt;C-Tab&gt;      &lt;C-W&gt;w
inoremap &lt;C-Tab&gt; &lt;C-O&gt;&lt;C-W&gt;w
cnoremap &lt;C-Tab&gt; &lt;C-C&gt;&lt;C-W&gt;w
onoremap &lt;C-Tab&gt; &lt;C-C&gt;&lt;C-W&gt;w

&quot; CTRL-F4 is Close window
noremap  &lt;C-F4&gt;      &lt;C-W&gt;c
inoremap &lt;C-F4&gt; &lt;C-O&gt;&lt;C-W&gt;c
cnoremap &lt;C-F4&gt; &lt;C-C&gt;&lt;C-W&gt;c
onoremap &lt;C-F4&gt; &lt;C-C&gt;&lt;C-W&gt;c
&quot; &gt;&gt;&gt;

&quot;|    #3 Alternative: Notepad-like behavior for CTRL-QSOAYF                 &lt;&lt;&lt;
&quot;|-----------------------------------------------------------------------------
&quot; This should be close to the Notepad behavior, though not equivalent.
&quot; If you're looking for a more Notepad-like experience, try `vim -e` (Cream).

if g:cua_mode &lt; 3
  finish
endif

&quot; CTRL-B is Block selection
noremap &lt;C-B&gt; &lt;C-V&gt;

&quot; CTRL-Q is Quit (unlike mswin)
noremap  &lt;C-Q&gt;      :quit&lt;CR&gt;
vnoremap &lt;C-Q&gt; &lt;C-O&gt;:quit&lt;CR&gt;
inoremap &lt;C-Q&gt; &lt;C-O&gt;:quit&lt;CR&gt;

&quot; Next/previous with F3/Shift-F3
noremap    &lt;F3&gt;      n
vnoremap   &lt;F3&gt; &lt;C-c&gt;n
inoremap   &lt;F3&gt; &lt;C-o&gt;n
noremap  &lt;S-F3&gt;      N
vnoremap &lt;S-F3&gt; &lt;C-c&gt;N
inoremap &lt;S-F3&gt; &lt;C-o&gt;N

&quot; Easy open/find/replace
if has('gui_running')
  &quot; CTRL-O is Open
  noremap  &lt;C-O&gt;      :browse open&lt;CR&gt;
  vnoremap &lt;C-O&gt; &lt;C-C&gt;:browse open&lt;CR&gt;
  &quot; CTRL-F is Find
  noremap  &lt;C-F&gt;      :promptfind&lt;CR&gt;
  vnoremap &lt;C-F&gt; &lt;C-C&gt;:promptfind&lt;CR&gt;
  inoremap &lt;C-F&gt; &lt;C-O&gt;:promptfind&lt;CR&gt;
  &quot; CTRL-H is Replace
  noremap  &lt;C-H&gt;      :promptrepl&lt;CR&gt;
  vnoremap &lt;C-H&gt; &lt;C-C&gt;:promptrepl&lt;CR&gt;
  inoremap &lt;C-H&gt; &lt;C-O&gt;:promptrepl&lt;CR&gt;
else
  &quot; CTRL-O is Open
  noremap  &lt;C-O&gt;      :edit .&lt;CR&gt;
  vnoremap &lt;C-O&gt; &lt;C-C&gt;:edit .&lt;CR&gt;
  &quot; CTRL-F is Find
  noremap  &lt;C-F&gt;      /
  vnoremap &lt;C-F&gt; &lt;C-C&gt;/
  inoremap &lt;C-F&gt; &lt;C-O&gt;/
endif

&quot; Bonus: word-by-word caret movements

&quot; CTRL+arrow/backspace/delete
inoremap &lt;C-BackSpace&gt; &lt;C-o&gt;db
vnoremap &lt;C-BackSpace&gt; &lt;C-c&gt;db
inoremap &lt;C-Delete&gt;    &lt;C-o&gt;dw
vnoremap &lt;C-Delete&gt;    &lt;C-c&gt;dw
inoremap &lt;C-Left&gt;      &lt;C-o&gt;b
vnoremap &lt;C-Left&gt;      &lt;C-c&gt;b
inoremap &lt;C-Right&gt;     &lt;C-o&gt;w
vnoremap &lt;C-Right&gt;     &lt;C-c&gt;w
inoremap &lt;C-Up&gt;        &lt;C-o&gt;{
vnoremap &lt;C-Up&gt;        &lt;C-c&gt;{
inoremap &lt;C-Down&gt;      &lt;C-o&gt;}
vnoremap &lt;C-Down&gt;      &lt;C-c&gt;}

&quot; ALT+arrow/backspace/delete -- meta sets the 8th bit
inoremap &lt;M-BackSpace&gt; &lt;C-o&gt;db
inoremap &lt;M-Delete&gt;    &lt;C-o&gt;dw
inoremap &lt;M-Left&gt;      &lt;C-o&gt;b
inoremap &lt;M-Right&gt;     &lt;C-o&gt;w
inoremap &lt;M-Up&gt;        &lt;C-o&gt;{
inoremap &lt;M-Down&gt;      &lt;C-o&gt;}

map &lt;M-Left&gt;  B
map &lt;M-Right&gt; W
map &lt;M-Up&gt;    {
map &lt;M-Down&gt;  }

&quot; ALT+arrow/backspace/delete -- meta sends escape
inoremap &lt;Esc&gt;&lt;BackSpace&gt; &lt;C-o&gt;db
inoremap &lt;Esc&gt;&lt;Delete&gt;    &lt;C-o&gt;dw
inoremap &lt;Esc&gt;&lt;Left&gt;      &lt;C-o&gt;b
inoremap &lt;Esc&gt;&lt;Right&gt;     &lt;C-o&gt;w
inoremap &lt;Esc&gt;&lt;Up&gt;        &lt;C-o&gt;{
inoremap &lt;Esc&gt;&lt;Down&gt;      &lt;C-o&gt;}

map &lt;Esc&gt;&lt;Left&gt;  B
map &lt;Esc&gt;&lt;Right&gt; W
map &lt;Esc&gt;&lt;Up&gt;    {
map &lt;Esc&gt;&lt;Down&gt;  }
&quot; &gt;&gt;&gt;

&quot; restore 'cpoptions'
set cpo&amp;
let &amp;cpoptions = s:save_cpo
unlet s:save_cpo

&quot; vim: set fdm=marker fmr=&lt;&lt;&lt;,&gt;&gt;&gt; fdl=0: