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

  • Home
  • SEARCH
  • 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 7407377
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T05:42:31+00:00 2026-05-29T05:42:31+00:00

I use !ls to execute bash command. But after i have configured something like

  • 0

I use !ls to execute bash command. But after i have configured something like source ~/.usr_profile in ~/.profile file, vim won’t source this file as well. So when i want to execute a function declared in usr_profile , i have to run :!source ~/.usr_profile && my_command. When i using this once or twice, it’s ok. But when use it frequently, the my vimrc becomes messy.
Is there any better method to solve this problem.Thanks

  • 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-29T05:42:32+00:00Added an answer on May 29, 2026 at 5:42 am

    Adding this line to your ~/.vimrc should solve your immediate problem:

    set shell=bash\ -l
    

    When invoked with -l (--login), bash reads your ~/.profile at startup (among other files) and thus everything sourced from there.

    When invoked with -i (--interactive), bash reads your ~/.bashrc at startup (among other files) and thus everything sourced from there.

    Try $ man bash or :h shell and :h shellcmdflag for more info.

    As for the differences between login and non-login shell I must admit my ignorance. This answer on serverfault may help, it’s interesting, anyway.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

is it possible to use something like an vim-close/exit-Event to execute some last commands
FILE: hello world I would like to use a scripting language ( BASH )
How can I use bash syntax in Perl's system() command? I have a command
i use the command line in windows to compile and then execute my java
I'd like to use placeholders as seen in this example: cursor.execute ( UPDATE animal
I want to execute a script every 30mins, but i want to use it
When I execute my python script from the command line I have no problems
On the Windows command line and cygwin bash I can execute the following without
I want to run something like cat file.tar | base64 | myprogram -c |
I have a bash script which calls another bash script, like so: #!/bin/bash echo

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.