The vimrc file is executed by vim.

Source: Internet
Author: User
Vim settings.

Questioner:
Shuige pavilion | views: 58

I am a newbie to vim. I just want to enable vim settings. Run bash-3.2 # source./vimrc_example.vi and the result fails. Bash-3.2 # cd/usr/share/vim/vim71/bash-3.2 # source. /vimrc_example.vim bash: An example for a vimrc file.: command not foundbash: Maintainer: Bram Moolenaar <Bram@vim.org>: command not foundbash: for Unix and OS/2 :~ /. Vimrc: No such file or directorybash: for MS-DOS and Win32: \ _ vimrc: command not foundbash :. /vimrc_example.vim: line 17: syntax error near unexpected token '('bash :. /vimrc_example.vim: line 17: '"Use Vim settings, rather then Vi settings (much better !). '
Let me help.

   

Report |

Satisfactory answer

Of course it is wrong. The vimrc file is executed by vim. You can execute the source command in bash, and shell runs vimrc as a shell script. Vim/usr/share/vim/vim71/vimrc_example.vim and enter so % in vim.
Question
Thank you for your help. I also want to ask, how can I make vimrc effective for every time vim is opened? I found that after setting it like that, it only works for the current vim window? Sorry, it is inevitable that new users will be naive.
Answer
Vim is loaded every time it starts ~ /. Vimrc file, as long as the initial settings are written in this file, it will be automatically loaded. Run the following command cat/usr/share/vim/vim71/vimrc_example.vim> ~ /. Vimrc.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.