LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-09-2014, 03:29 PM   #1
Millar
LQ Newbie
 
Registered: Mar 2014
Posts: 6

Rep: Reputation: Disabled
how to run shell cmd in vim and emacs using current .bash_profile?


how to run shell cmd in vim and emacs using current .bash_profile?

Last edited by Millar; 03-09-2014 at 05:30 PM. Reason: .emacs
 
Old 03-09-2014, 04:33 PM   #2
redd9
Member
 
Registered: Nov 2013
Location: Canada
Distribution: Ubuntu
Posts: 80
Blog Entries: 4

Rep: Reputation: 42
I'm not entirely sure about what you want, but the first and second answers here might help.
 
Old 03-09-2014, 04:47 PM   #3
Millar
LQ Newbie
 
Registered: Mar 2014
Posts: 6

Original Poster
Rep: Reputation: Disabled
@redd9 thx for your reply..,that link is not clear...,can u text here???please
 
Old 03-09-2014, 04:59 PM   #4
redd9
Member
 
Registered: Nov 2013
Location: Canada
Distribution: Ubuntu
Posts: 80
Blog Entries: 4

Rep: Reputation: 42
Add this line to the file .vimrc (located in your home directory)
:set shellcmdflag=-ic
I'm not an emacs person (or a bash person either, I use zsh) so I can't really help you with emacs. I assume there is some emacs configuration file you can add a similar line to.
 
Old 03-09-2014, 05:07 PM   #5
Millar
LQ Newbie
 
Registered: Mar 2014
Posts: 6

Original Poster
Rep: Reputation: Disabled
@redd9, please help me where to ask??
 
Old 03-09-2014, 05:27 PM   #6
redd9
Member
 
Registered: Nov 2013
Location: Canada
Distribution: Ubuntu
Posts: 80
Blog Entries: 4

Rep: Reputation: 42
You could try on the reddit page, or here on LQ. Don't start another thread though, if someone knows, they will post in this thread. Also, I believe the file you need to edit is called .emacs. It is located in your home directory.
 
Old 03-09-2014, 08:55 PM   #7
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Arch
Posts: 3,013

Rep: Reputation: 1225Reputation: 1225Reputation: 1225Reputation: 1225Reputation: 1225Reputation: 1225Reputation: 1225Reputation: 1225Reputation: 1225
The equivalent for emacs would be
Code:
(setq shell-command-switch "-ic")
in ~/.emacs.d/init.el (~/.emacs for older versions).
 
Old 03-11-2014, 01:35 PM   #8
Millar
LQ Newbie
 
Registered: Mar 2014
Posts: 6

Original Poster
Rep: Reputation: Disabled
I want to have one .bash_profile works on multiple platform, ubuntu, debian, redhat, cygwin, osx. So how should I organize .bash_profile?

it can be multiple files in some subdir ***pls help me***
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Issue sg_modes cmd at cmd line, want to see the cmd in binary form NuUser Linux - Newbie 1 03-28-2012 09:08 AM
Emacs vs Vim splintercdo General 19 11-20-2011 10:10 AM
[SOLVED] How can I run a command on another shell without changing the current shell? quanba Other *NIX 3 04-05-2010 01:19 PM
Vim: run shell command without acknowledgement jrdioko Linux - Software 2 02-25-2006 09:52 PM
Referring to current file/path in vim's :!<cmd> jrdioko Linux - Software 1 01-27-2006 05:03 PM


All times are GMT -5. The time now is 06:57 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration