How to open Sublime text using Git Bash Command prompt - html

$ touch hello.html
$ subl .
bash: subl: command not found
I created HTML file using git bash command prompt and I want to open it on Sublime Text 3 using git bash command prompt. But above code is not working.

First I had to create new Environment Variable Path. now the code is working.
$ cd test1/
$ touch hello.html
$ subl hello.html
or $ subl
Following youtube video might be helpful.
How to Open Sublime Text 3 from Command Prompt in Windows

Related

How to open file from git repository in sublime text (Mac)?

How can I open an html file from a cloned git repository on Sublime Text on Mac? I've tried the subl command but it didn't work.
You can open the whole project from a terminal. Just follow the instructions here https://www.sublimetext.com/docs/3/osx_command_line.html
You have to run this command before
ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" ~/bin/subl
Clone you repo and after that do:
cd <project_dir> && subl ./

Sublime Text 2 : tried to make symlink to subl, but I did it in wrong directory

Sublime Text 2 : tried to make symlink to subl in Terminal, but I did it in wrong directory, simple_cms......and after I put like below in simple_cms file....the prompt changed like '>' ....
simple_cms
VeryBerryS2$ ln -s "/Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl /usr/local/bin/subl
Did I do something wrong and How do I undo it?
You opened a " without closing it. The > prompt means that the command shell is still waiting for you to finish typing the rest of the command. Hit Ctrl+C and start over.

Using openshift rhc tail command

How do you tail openshift log files? I issued the following command:
rhc tail myapp
It seems to show first error line and then stops, but doesn't exit. If I press ctrl+C it asks whether to stop batch or not. How can I display last few errors and may be browse page by page? Is there page down/ page up shortcuts?
The 'rhc tail' command reads the last few lines of each of your log files and continues to feed subsequent log messages to your console. To view the entire log file, please review:
https://www.openshift.com/faq/how-to-troubleshoot-application-issues-using-logs
you can see by running:
rhc tail -a yourappname -l youremail -p yourpassword
Adding -a option fix this issue for me.
rhc tail -a {app_name}
Openshift place logs in different files, so if you want get logs of a specific file then you can add -f file/address/and/name
Example :
rhc tail -f app-root/logs/nodejs.log -a myAppName
also you can ask for specific number of lines by adding -o "-n 40" in command. Above command will get last 40 lines.
Example :
rhc tail -f app-root/logs/nodejs.log -o "-n 40" -a myAppName
You can also download them:
$ scp SHA#APP-DOMAIN.rhcloud.com:/var/lib/openshift/SHA/app-root/\
logs/APP.log "~/upstream.jbossas.log"
Feasible also in windows directly in git bash.

Sublime Text subl shortcut not working: ln: /Users/edmundmai/bin/subl: No such file or directory

Hi I am trying to set up the terminal shortcut for sublime text 2(subl) but it's not working. I'm following the directions on https://github.com/mhartl/rails_tutorial_sublime_text/blob/master/README.md but can't get past the first step.
When I type:
ln -s "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" ~/bin/subl
I receive the error
ln: /Users/edmundmai/bin/subl: No such file or directory
What should I do?
This probably means that there is no ~/bin directory. Which also probably means that it isn't in the PATH. So just continue on to the next suggestion:
sudo ln -s "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" /usr/bin/subl
Alternatively you can put it to your local bin:
ln -s "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" /usr/local/bin/subl
it may need creating the bin beforehand:
mkdir /usr/local/bin
Another approach is define subl as your shell alias
http://opensourcehacker.com/2012/05/11/sublime-text-2-tips-for-python-and-web-developers/#Open_files_from_command-line
This is the recommended approach as it is against the best practices to add symlinks in /usr/bin

Sublime Text 2: can't create symlink to subl, says "bin/subl: No such file or directory"

I've downloaded and installed Sublime text 2. I am following the directions here: but I am stuck at this part:
The first task is to make a symlink to subl. Assuming you've placed Sublime Text 2 in the Applications folder, and that you have a ~/bin directory in your path, you can run:
ln -s "/Applications/Sublime Text " ~/bin/subl
However, when I do this it tells me /Users/User/bin/subl: No such file or directory.
What should I do?
Thanks!
I'd recommend adding it to your local bin:
ln -s "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" /usr/local/bin/subl
Edit: Make sure your local bin directory exists before running this command:
mkdir /usr/local/bin
I add my sym links to /usr/local/bin, for Sublime Text 3 I set mine up like so:
ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" /usr/local/bin/subl
Then you can open up the current directory list using:
subl .
If you find subl abbreviation annoying as some people I know seem to do, then change it to 'sublime'
ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" /usr/local/bin/sublime
And call it using:
sublime .
Alternatively, you can run this:
sudo ln -s "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" /bin/subl
Note: The above snippet puts the symlink in /bin/subl rather than ~/bin/subl.
and that you have a ~/bin directory in your path
First, you need that directory for the ln command to work, and eventually, it will need to be in your path to do whatever it is you are trying to do.
To make the directory:
mkdir ~/bin
Adding it to your execution path is trickier, but there are plenty of resources available.
Following Simon's example above, For Sublime Text 3, here is what worked for me:
ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" /usr/local/bin/subl
Please note, to install (on Mac OS Sierra 10.12.6) in /usr/local/bin sudo was required.
Info
OS: Mac OSX High Sierra 10.13.6 (17G65)
Sublime Version: Version 3.1.1 Build 3176
I took the command from SublimeText website
Got An Error
ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" ~/bin/subl
ln: /Users/jkirchoff/bin/subl: No such file or directory
Did Some Checking
Just to make sure the path exists.
NOTE: the "'s allow the space in the path.
ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl"
ln: ./subl: File exists
Compared Note from this page
What #NotSimon wrote on this page, Then Ran:
ln -s "/usr/local/bin/subl"
ln: ./subl: File exists
and then followed the rest.
The Complete Line that worked for me:
ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" /usr/local/bin/subl
Success
Now I can run subl as a command in Terminal!
This command opens the directory as a "Project" in SublimeText.
subl ~/Desktop
Optional
I followed the SublimeText recommendation & added this to my
~/.bash_profile.
The command works without it, just following guidelines.
echo "export EDITOR='subl -w'" >> ~/.bash_profile
Just remove tilde ~ from ~/bin/subl
If you're using mac terminal,
just replace "Sublime Text 2.app"
with "Sublime\ Text\ 2.app/" anywhere within the command.
That should do it.