I have been using MacVim & have gotten used to it but my main development computers are all Linux(Ubuntu)
I’d like MacVim like shortcuts and behavior
I know you can get windows like behavior like so
source $VIMRUNTIME/mswin.vim
behave mswin
how can I get Mac like behavior in GVIM on ubuntu?
I use MacVim on Mac OS X at work, GVim on Linux at home and CLI Vim everywhere. What do you call “MacVim like shortcuts and behavior”?
Do you mean “standard OS-wide shortcuts” like Cmd+O or Cmd+V or Shift+light/left arrow? I don’t know of any features MacVim has that GVim hasn’t beside a very elegant and impressive level of OS integration.
Shortcuts that use the Cmd key are obviously not supported because there is no Cmd key on a typical PC keyboard. If you really want to have them you will need to explicitly add them to your
~/.gvimrcwith another modifier key. Shift+right/left arrow and other basic Mac OS X text-editing shortcuts must also be explicitly added to your~/.gvimrc. You’ll quickly find limitations in this strategy.Hell, GVim doesn’t even really support Gnome’s own default shortcuts anyway.
That’s the wrong approach.
Vim’s own commands, motions, text-objects and the grammar that ties them are a lot more efficient and portable. You should focus on that instead.
:e <Tab>$for positioning the cursor orAto insert text^or0(0is “first column’,^is “first printable character”) for positioning the cursor orIto insert texteorEorworWborBv$v^vetheneeeas many times as necessary orv2eand so on…
Like I’ve said before, read
:help motion.txt, it will blow your mind.