Find the answer to your Linux question:
Results 1 to 5 of 5
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Bind capital "W" to write in vim


    Hey up everyone,

    I'm just trying to find out how I can bind capital "W" to write in vim? Too many times have I caught shift and been told it's not a valid command!


    Thanks

    Adam

  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    12,539
    Not as far as I know, outside of modifying the source code, which you can do easily enough if you do any C programming at all.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  3. #3
    Really? You can map keys to commands so I'd have thought this'd be a common request.

    I'm certainly no C guru, but could probably work it out. I'm working on a shared server at the moment so I'll have a go at home.

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    12,539
    Most of us work on the principle of "if it ain't broke, don't fix it!"... Let us know how it goes.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  6. #5
    Actually vim is highly customizable, and frequently customized (in this case I strongly disagree with the "if it ain't broke, don't fix it" sentiment).

    Anyway, seeing as this makes it to Google's first page when searching for "vim capital w save", here's how:
    Code:
    :command WQ wq
    :command Wq wq
    :command W w
    :command Q q
    Stick in ~/.vimrc to have it autoloaded.

    To get more info:
    Code:
    :help command
    This question has been asked on Stack Exchange, which is where I got this solution. There are also some other solutions outlined on that page. (I can't make it a url as linuxforums seems to require me to make 15 posts first.)
    http colon slash slash stackoverflow.com/questions/117150/can-i-re-map-commands-in-vim

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •