mapping key in vim

Posted by – November 2, 2010

Refers to:

Adding your wanna mapping key into /etc/vim/vimrc to enable map function in vim.

1 Comment on mapping key in vim

  1. mosjin says:

    vim remote file using scp/ftp etc:

    1. Starting With Netrw *netrw-start* {{{1

    Netrw makes reading files, writing files, browsing over a network, and
    local browsing easy! First, make sure that you have plugins enabled, so
    you’ll need to have at least the following in your < .vimrc>:
    (or see |netrw-activate|)

    set nocp ” ‘compatible’ is not set
    filetype plugin on ” plugins are enabled

    (see |’cp’| and |:filetype-plugin-on|)

    Netrw supports “transparent” editing of files on other machines using urls
    (see |netrw-transparent|). As an example of this, let’s assume you have an
    account on some other machine; if you can use scp, try:

    vim scp://hostname/path/to/file

    Want to make ssh/scp easier to use? Check out YXXYnetrw-ssh-hack|!

    So, what if you have ftp, not ssh/scp? That’s easy, too; try

    vim ftp://hostname/path/to/file

    Want to make ftp simpler to use? See if your ftp supports a file called
    < .netrc> — typically it goes in your home directory, has read/write
    permissions for only the user to read (ie. not group, world, other, etc),
    and has lines resembling

    machine HOSTNAME login USERID password “PASSWORD”
    machine HOSTNAME login USERID password “PASSWORD”

    default login USERID password “PASSWORD”

    Now about browsing — when you just want to look around before editing a
    file. For browsing on your current host, just “edit” a directory:

    vim .
    vim /home/userid/path

    For browsing on a remote host, “edit” a directory (but make sure that
    the directory name is followed by a “/”):

    vim scp://hostname/
    vim ftp://hostname/path/to/dir/

    See |netrw-browse| for more!

    There are more protocols supported by netrw than just scp and ftp, too: see the
    next section, |netrw-externapp|, on how to use these external applications with
    netrw and vim.

    PREVENTING LOADING *netrw-noload*

    If you want to use plugins, but for some reason don’t wish to use netrw, then
    you need to avoid loading both the plugin and the autoload portions of netrw.
    You may do so by placing the following two lines in your < .vimrc>:

    :let g:loaded_netrw = 1
    :let g:loaded_netrwPlugin = 1


Leave a Reply