Trouble installing Sublime command line tools - command-line

I followed the advice of this blog post and it didn't work. Below is my output. What can I do to fix this?
~/code/rails/adam $ echo "export PATH=~/bin:$PATH" >> ~/.profile
~/code/rails/adam $ ln -s "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" ~/bin/subl
ln: /Users/adamzerner/bin/subl: No such file or directory
New output:
~/code/rails/adam $ mkdir ~/bin
~/code/rails/adam $ ln -s "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" ~/bin/subl
~/code/rails/adam $ subl
-bash: subl: command not found
~/code/rails/adam $ subl --help
-bash: subl: command not found
~/code/rails/adam $

You need to have a ~/bin directory before you can create a symlink in it. Run
mkdir ~/bin
then
ln -s "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" ~/bin/subl
and you should be all set.

Related

A plug-in doesn't work after installing on VIm

I was trying to install a plug-in "vim-surround" but it doesn't work after executing the following commands on my terminal.
$ mkdir -p ~/.vim/pack/tpope/start
$ cd ~/.vim/pack/tpope/start
$ git clone https://tpope.io/vim/surround.git
$ vim -u NONE -c "helptags surround/doc" -c q
I'm new to Vim and I was wondering if there's more to just typing those commands on the terminal? Do I have to add some lines on the config file to make it work?
Thank you in advance.

Why is fish redirection not working as expected

When I try to redirect fish shell output to a file, the command gets put in the file, not the command output. why? This works as expected in bash, zsh etc.
example:
$ fish --version
fish, version 3.2.0
$ rm -f /tmp/foo
$ echo bar > /tmp/foo
$ cat /tmp/foo
echo bar
# expected output:
bar
# It's not related to the echo command. e.g:
$ ls -l > /tmp/foo
$ cat /tmp/foo
ls -l
This seems to have been caused by a bug in fishgretel/fasd
See
https://github.com/fishgretel/fasd/commit/98fb3873aae9adcca2ffc4b4b3958e45d74cb894

Which profile does sh loads

I am trying to load a specific tool ( nvm ) from within sh.
Installing it as explained in the page for bash it works perfectly and testing it returns the following.
$ bash
$ nvm --version
+ X.XX.X
but if I type
$ sh
$ nvm --version
+ sh: 1: nvm: not found
but still its expected as the default installation modifies the .bashrc.
now i have included the same .bashrc code in my /etc/profile
export NVM_DIR="/opt/nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
and tried again.
$ sh
$ nvm --version
+ sh: 1: nvm: not found
$ echo $NVM_DIR
+ /dir/to/nvm
$ [ -s "$NVM_DIR/nvm.sh" ] && echo "it works?"
+ it works?
$ [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"
$ nvm --version
X.XX.X
which got me extremely confused. What exactly is happening ? Isn't sh loading the /etc/profile or am I doing something really wrong?
--edit after comments--
also tried to include it in the local profile
$ cat ~/.profile
+ export NVM_DIR="/opt/nvm"
+ [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
$ sh
$ nvm --version
+ sh: 1: nvm: not found
The problem was described in this article with the sh blue line.
The solution to the problem was to set the /etc/profile/ in the ENV variable.
for example ENV=/etc/profile sh would load the profile when the sh opens. That solved the problem

Shell not picking correct path to run drush

I've got drush in /usr/local/bin. Running which drush returns /usr/local/bin/drush. However running drush displays "-bash: /usr/bin/drush: No such file or directory". Running /usr/local/bin/drush works correctly.
My $PATH is /usr/local/bin:/usr/local/mysql/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin
[added in an edit] Before I had this issue I removed a copy of the script that was at /usr/bin/drush. It wasn't built correctly.
What on earth could be causing this problem? I do not want to have to type out /usr/local/bin/drush every time; that's why /usr/local/bin is in my $PATH.
Have you run drush before in this shell, then moved it from /usr/bin to /usr/local/bin ? If so, the hash command will show that the shell has remembered the command in the /usr/bin location and will presume it's there without re-checking. Run hash -r will clear this list.
Worked example:
$ echo >/usr/bin/hello 'echo hello'
$ chmod +x /usr/bin/hello
$ hash
hits command
1 /bin/chmod
$ hello
hello
$ hash
hits command
1 /bin/chmod
1 /usr/bin/hello
$ which hello
/usr/bin/hello
$ mv /usr/bin/hello /usr/local/bin/
$ hello
bash: /usr/bin/hello: No such file or directory
$ hash
hits command
1 /usr/bin/which
1 /bin/chmod
1 /bin/mv
2 /usr/bin/hello
$ which hello
/usr/local/bin/hello
$ hash -r
$ hash
hash: hash table empty
$ hello
hello
$ hash
hits command
1 /usr/local/bin/hello

iOS DOxygen adding docSet to Xcode Documents

Hey Everyone just having a problem with DOxygen, Ive generated my documentation and its allthere, but i find i am unable to add it to Xcode.
I currently have a script which takes the HTML directory containing all the files, and generates the .docset file.
# Run the makefile. The --silent parameter stops it from spamming us with too much output.
#/Applications/Xcode.app/Contents/Developer/usr/bin/docsetutil
make --silent -C "$DOCSET_OUTPUT/html" install
# Load docset
osascript "$[location of personal library]/Scripts/XcodeLoadDocSet.scpt"
"~/Library/Developer/Shared/Documentation/DocSets/$DOXYGEN_ID.docset"
This should also add the item to xcode, but running it manually reveals a problem..
/Developer/usr/bin/docsetutil index com.[my app].docset
make: /Developer/usr/bin/docsetutil: No such file or directory
make: *** [docset] Error 1
This is what i have atm for the makefile,
DOCSET_NAME=com.[my app].docset
DOCSET_CONTENTS=$(DOCSET_NAME)/Contents
DOCSET_RESOURCES=$(DOCSET_CONTENTS)/Resources
DOCSET_DOCUMENTS=$(DOCSET_RESOURCES)/Documents
DESTDIR=~/Library/Developer/Shared/Documentation/DocSets
XCODE_INSTALL=$(shell xcode-select -print-path)
all: docset
docset:
mkdir -p $(DOCSET_DOCUMENTS)
cp Nodes.xml $(DOCSET_RESOURCES)
cp Tokens.xml $(DOCSET_RESOURCES)
cp Info.plist $(DOCSET_CONTENTS)
tar --exclude $(DOCSET_NAME) \
--exclude Nodes.xml \
--exclude Tokens.xml \
--exclude Info.plist \
--exclude Makefile -c -f - . \
| (cd $(DOCSET_DOCUMENTS); tar xvf -)
$(XCODE_INSTALL)/usr/bin/docsetutil index $(DOCSET_NAME)
rm -f $(DOCSET_DOCUMENTS)/Nodes.xml
rm -f $(DOCSET_DOCUMENTS)/Info.plist
rm -f $(DOCSET_DOCUMENTS)/Makefile
rm -f $(DOCSET_RESOURCES)/Nodes.xml
rm -f $(DOCSET_RESOURCES)/Tokens.xml
install: docset
mkdir -p $(DESTDIR)
cp -R $(DOCSET_NAME) $(DESTDIR)
uninstall:
rm -rf $(DESTDIR)/$(DOCSET_NAME)
always:
If anyone has had a similer problem please let me know.
Cheers
Michael.
With Xcode 4, docsetutil is located under /Applications/Xcode.app/Contents/Developer/usr/bin/