User login

Give vi / vim / gvim rational (Windows or Macintosh like) copy, cut, and paste shortcuts

http://superuser.com/questions/10588/how-to-make-cut-copy-paste-in-gvim-on-ubuntu-work-with-ctrlx-ctrlc-ctrlv

Another alternative:

        " ---- Windows Like keys ----
        " CTRL-Z is Undo; not in cmdline though
        noremap <C-Z> u
        inoremap <C-Z> <C-O>u
        " CTRL-Y is Redo (although not repeat); not in cmdline though
        noremap <C-Y> <C-R>
        inoremap <C-Y> <C-O><C-R>
        " CTRL-A is Select all
        noremap <C-A> gggH<C-O>G
        inoremap <C-A> <C-O>gg<C-O>gH<C-O>G
        cnoremap <C-A> <C-C>gggH<C-O>G
        " CTRL-F4 is Close window
        noremap <C-F4> <C-W>c
        inoremap <C-F4> <C-O><C-W>c
        cnoremap <C-F4> <C-C><C-W>c
        " CTRL-Tab is Next window
        noremap <C-Tab> <C-W>w
        inoremap <C-Tab> <C-O><C-W>w
        cnoremap <C-Tab> <C-C><C-W>w
        " ---- Windows Like Copy-Paste keys ----
        " CTRL-v is paste
        inoremap <C-v> <esc>"*p<return>i
        noremap <C-v> "*p<return>
        " CTRL-x is cut (in visual mode only)
        vnoremap <C-x> "*d
        " CTRL-c is copy (in visual mode only)
        vnoremap <C-c> "*y
        " ---- Restore some remapped things
        " make real <C-V> (visual block) as <C-Q> available
        noremap <c-q> <c-v>
        inoremap <C-Y> <C-Y>

Searched words: 
mac os x like .vimrc ubuntu copy paste copy paste .vimrc

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • You can use Markdown syntax to format and style the text. Also see Markdown Extra for tables, footnotes, and more.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <img> <blockquote> <small> <h2> <h3> <h4> <h5> <h6> <sub> <sup> <p> <br> <strike> <table> <tr> <td> <thead> <th> <tbody> <tt> <output>
  • Lines and paragraphs break automatically.

More information about formatting options

By submitting this form, you accept the Mollom privacy policy.