Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 7 years ago.
Improve this question
Current I have the following going on, vim seems to inexplicably enter into the first folder it finds and continue tab completion from there.
When hinting a more complete name, it just gives me a bell.
~ $ cat .bash <TAB>
.bash/
.bash_history
.bash_profile
.bashrc
~ $ vim .bash <TAB>
~ $ vim .bash/ <TAB>
~ $ vim .bash/git-aware-prompt/
~ $ vim .bash_ <TAB>
<BELL>
Using vim 7.4.488 on OSX
How can I make my vim behave like my cat?
Sometimes it can happen that this is not in your .bashrc
# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
. /etc/bash_completion
fi
Another possible issue can be resolved by running
complete -r vim
which can restore vim rules of completion to its default. I hope these suggestions can help you to point you in the right direction.
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
I added something to my bash_profile while trying to add Playframework to my path and something got messed up badly.
I added the following line to my .bash_profile
export PATH=$PATH:the path to my play excitable
then I saved everything and restarted my terminal. I can no longer do anything from my terminal. I can't cd into any directory, I can no longer find java, I can't open vi or nano.
I found this thread on SuperUser that suggested opening a different terminal and changing the bash profile.
I tried opening bash by typing
/bin/bash
and I was successfully able to open another terminal but I still don't have access to any of the regular unix commands. I still wasn't able to open vi or nano to remove the line that is causing the problem.
I tried downloading a new terminal application without any luck.
I tried turning on hidden files so that I can just change the file with a text editor by running the following command:
defaults write com.apple.finder AppleShowAllFiles TRUE
but since my terminal isn't working that didn't work either.
How can I fix my computer.
While this is offtopic for stackoverflow, it's also pretty simple to fix:
Start Terminal.app.
Reset $PATH:
$ export PATH=/bin:/usr/bin:/usr/local/bin
Fix ~/.bash_profile:
$ vi ~/.bash_profile
Or you can avoid setting $PATH at all with:
$ /usr/bin/vi ~/.bash_profile
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 5 years ago.
Improve this question
I was experimenting with pipelines in Git Bash. I ran "ls || vim", thinking that it would open Vim with the contents of the Directory Listing written into the editor. That is not the case, and rather, it saved the file. I haven't been able to find where, though. Any ideas?
Git Bash starts at /d/Desktop, and Git Bash is located at C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Git. Any locations this file might be would be helpful.
EDIT: Sorry, I ran "ls | vim". Also, output was:
"Warning: Input is not from a terminal
Error reading input, exiting...
Preserving Files...
Finished"
EDIT: Sorry for the off-topic post, and thank you for your answers. I'll check out SuperUser if I ever have any more similar questions.
ls || vim
See || as OR. vim is never executed because ls is not False.
ls | vim
See | as pipe. But it will give:
Vim: Warning: Input is not from a terminal
Vim: Error reading input, exiting...
Vim: preserving files...
Vim: Finished.
So use
ls | vim -
because vim will then read from standard-in.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
I added something to my bash_profile while trying to add Playframework to my path and something got messed up badly.
I added the following line to my .bash_profile
export PATH=$PATH:the path to my play excitable
then I saved everything and restarted my terminal. I can no longer do anything from my terminal. I can't cd into any directory, I can no longer find java, I can't open vi or nano.
I found this thread on SuperUser that suggested opening a different terminal and changing the bash profile.
I tried opening bash by typing
/bin/bash
and I was successfully able to open another terminal but I still don't have access to any of the regular unix commands. I still wasn't able to open vi or nano to remove the line that is causing the problem.
I tried downloading a new terminal application without any luck.
I tried turning on hidden files so that I can just change the file with a text editor by running the following command:
defaults write com.apple.finder AppleShowAllFiles TRUE
but since my terminal isn't working that didn't work either.
How can I fix my computer.
While this is offtopic for stackoverflow, it's also pretty simple to fix:
Start Terminal.app.
Reset $PATH:
$ export PATH=/bin:/usr/bin:/usr/local/bin
Fix ~/.bash_profile:
$ vi ~/.bash_profile
Or you can avoid setting $PATH at all with:
$ /usr/bin/vi ~/.bash_profile
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
I am using a Macbook Pro, and I wanted to change it to the current directory and a dollar sign prompt in Terminal. I've already looked at these resources to try and solve this issue.
I tried modifying the ~/.bashrc file and saving it but it did not seem to work.
PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting
### Added by the Heroku Toolbelt
export PATH="/usr/local/heroku/bin:$PATH"
export PS1="\W$ ”
The last line is what I added to change the prompt.
This should be done in .bash_profile, not .bashrc.
nano ~/.bash_profile
Add a line containing this:
export PS1="\W\$ "
.bashrc is ONLY excuted when starting a sub-shell. bash login shell uses the following initialization scripts:
.bash_profile
.bash_login
.profile
You need to escape the dollar sign. Like this:
$ PS1="\W\$ "
~$ cd tmp
/Users/philip/tmp
tmp$
And once you change your .bashrc you either need to logout/back-in or . ~/.bashrc to re source it.
I would humbly recommend not doing this. Having a full path is very useful as 'tmp' directories could be anywhere. Consider using "\w" which does relative path (ie. uses ~ to represent HOME)
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
How can I configure the Zsh tab-completion such that when I type cd ..<TAB> it expands to cd ../ and after pressing <TAB> again proposes the folders in the parent directory for completion?
E.g. it should show the same behavior as when typing for example cd Documents<TAB> which expands to cd Documents/ and after pressing <TAB> again proposes the folders in Documents for completion.
As a starting point for configuration I use an empty .zshrc and Zsh 4.3.9 from MacPorts.
Same problem with debian unstable, Ubuntu jaunty, both ship zsh 4.3.9. I know of multiple people with different configurations.
After reading http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=514152 I added
zstyle ':completion:*' special-dirs true
to my config and now everything works fine again.
Put this into your ~/.zshrc:
autoload -Uz compinit
compinit
There is also a project with zsh functions/configurations for Mac OS X on http://code.google.com/p/zsh-templates-osx/ . Personally I think it's an overkill to use the whole package. But found it useful to cherry pick some tricks, functions, completions etc. and create my own .zshrc
This may or may not be a useful answer - switch to bash, which does what you want out of the box.