Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6194687
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T03:20:17+00:00 2026-05-24T03:20:17+00:00

I have a plugin (FindFile.vim) that needs to run :FindFileCache . whenever I start

  • 0

I have a plugin (FindFile.vim) that needs to run :FindFileCache . whenever I start vim to gather a file cache for quick opening.. I have to run this every time I start vim though.

How might I write a command that runs once, every time that vim starts up?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T03:20:18+00:00Added an answer on May 24, 2026 at 3:20 am

    The best place to keep your configuration stuff is in your .vimrc
    file. However, it’s sourced too early, check :h startup:

    At startup, Vim checks environment variables and files and sets values
    accordingly.  Vim proceeds in this order:
    
    1. Set the 'shell' and 'term' option                *SHELL* *COMSPEC* *TERM*
    2. Process the arguments
    3. Execute Ex commands, from environment variables and/or files *vimrc* *exrc*
    4. Load the plugin scripts.                                 *load-plugins*
    5. Set 'shellpipe' and 'shellredir'
    6. Set 'updatecount' to zero, if "-n" command argument used
    7. Set binary options
    8. Perform GUI initializations
    9. Read the viminfo file
    10. Read the quickfix file
    11. Open all windows
    12. Execute startup commands
    

    As you can see, your .vimrc will be loaded before plugins. If you put :FindFileCache . in it an error will occur, since that command does not exist yet. (It will exist once the plugin is loaded in step 4.)

    To solve this, instead of executing the command directly, create an
    auto-command. Auto-commands execute some command when an event occurs. In this case, the VimEnter event looks appropriate (from :h VimEnter):

                                                        *VimEnter*
    VimEnter                    After doing all the startup stuff, including
                                loading .vimrc files, executing the "-c cmd"
                                arguments, creating all windows and loading
                                the buffers in them.
    

    Then, just place this line in your .vimrc:

    autocmd VimEnter * FindFileCache .
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have a plugin that gets distributed with third party software (also with our
I have a plugin installed on my wordpress blog that takes the email address
I am new to Symfony 1.4 I have a plugin and inside the modules
I have created a data base (.sqlite) using SQLiteManager plugin for firefox,now I want
I'm working on a jQuery project right now that will essentially dump a bunch
Are there any libraries or plugins you would recommend (preferably for jQuery) that would
I got the code from here the Code is not working, I have the
I m embeding a pdf document into my html code. For this i have
Here is a overview of my code. User press a record button and it
I'm trying to figure out wether I should use SOAP or REST for a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.