Open Sublime from cmd windows 10 - windows-10

I can't open the sublime application or any file via within sublime from the command line. I am currently using Git Bash(SDK-64). I followed this tutorial. I am stumped I am still getting the bash error. bash: subl.exe: command not found

Are you sure, you have Program File folder in C directory? As far as I know C directory has Program Files folder. Add s in Program File.
Write C:\Program Files\Sublime Text 3 instead of C:\\Program File\Sublime Text 3. It should work.

Is necessary to only add your Sublime directory path to the Path list, as you have done in your first pic and use only one "/".
Second step from last picture is not necessary.
Sublime will open with "subl.exe" and can take as argument the name of a file. "subl.exe dummy.txt".
I checked in Git Bash, Powershell and Developer Command Prompt for VS 2017 on win 10.

Related

Deleting a Non-existing file

First things first:
I have a windows OS.
I use python in Linux (from a USB stick)
I was writing a code in Python that required it to work with Excel...
so once I created it (in Linux) I got a xlwt file created in the D: drive of my computer.
when I booted into windows I wanted to delete the file but it says
The file you specified is not valid or is too long
so I tried deleting it in command prompt(admin) but it says file does not exist!
when I type dir the file gets displayed
so I went in Linux(Kali Linux) and tried
rm -f xlwt
but same problem:
when I say dir in Linux it says xlwt\r
so I said
rm -f xlwt\r
but still the same problem.
In Linux use tab completion to get the correct escaped version of the file name.
Type the following:
rm xlw
Then press the Tab key and the shell will complete the filename with the right escape chars for the '/r'
You should then be able to press enter to delete the file

How to integrate elm-format with Sublime Text

I'm trying to make elm-format work in Sublime Text and am following these instructions: https://packagecontrol.io/packages/Elm%20Language%20Support
Step one says:
"Make sure elm-format is in your PATH"
What does that mean? How do I find my path?
PATH is the environment variable holding the list of directories that will be searched when you try to execute a command (like entering elm-format on the command line).
In the terminal, you can enter echo $PATH to get a colon separated list of all the directories in your PATH.
What it means is that you'll need to get the elm-format binary (there are instructions here) and place it in one of those directories (/usr/local/bin is a common choice).

Cygwin bash files

About a year ago, I created a couple text files called "compile" and "pull." When I go into a cygwin prompt and type those names and hit enter (basically use them as a command), the cygwin terminal runs what is in those text files. For instance here is the contents of one:
git checkout master
git checkout -- .
I don't even remember how I did this. I'm pretty sure this is not a bash script.
I do remember that I had to not just create the file in notepad but also perform some linux command line operation on it, in order to use it. Once I did that I could basically use the file as a command.
In *nix, you have to make a file executable in order to be able to run it:
chmod u+x file
You also need to add the path to the file to the PATH variable
PATH=$PATH:/path/to/the/file
or, add . to always scan the current directory for commands (it's considered unsecure, though):
PATH=$PATH:.

how to make cygwin build program in windows use windows path

I built and installed a program with cygwin in windows, but the program can not find windows style paths and must use /cygdrive
I just want to know how to spare this burden
The problem is this:
C:\Documents and Settings\Administrator>protoc -If:
f: warning: directory does not exist.
Missing input file.
C:\Documents and Settings\Administrator>protoc -I/cygdrive/f
Missing input file.
This is the common problem with windows stuff, it always uses spaces in paths. Two solutions:
1st. Open your cygwin (black one) terminal and type (I suppose you will be in your home directory):
cp /etc/dev/etc/skel/.bash* .
this will copy all the bash files you need to your current directory to "handle" your cygwin system. To know where you are in your cygwin (ie. the path to your current directory) type "pwd" (without the quotes) and press Enter (or Return for some people).
2nd. Open the .bashrc file already copied and type (I use "vi" editor for this but you can use "pico" which is a bit easier):
alias C="C:\Documents\ and\ Settings\Administrator"
save the .bashrc ("Ctrl+X" in pico I think, and :wq in "vi") and close the terminal. After restarting this console, typing "C" and pressing enter will send you automatically to "C:\Documents and Settings\Administrator"
To know which alias you have, just type "alias" in your terminal and all your alias will show up.
HTH,

Tried to create symlink to Sublime Text 2

I am relatively new to linux so please be patient.
I just attempted to create a symlink to Sublime Text 2.
I can open Sublime Text 2 by typing
~/bin/sublime <filename>
however, simply typing
sublime <filename>
gives me a "sublime: command not found" error.
Can anyone explain what I am doing wrong?
This is because you installed sublime in a 'bin' directory inside your home folder. This 'bin' directory is not in your path and your shell will not find sublime there.
There are several solutions for this problem but a simple one is to add the '~/bin' directory to your path. To do this, just edit your file ~/.bashrc (suposing you are using bash) or ~/.profile (if you are using any other shell) and add the following line:
export PATH="$PATH:$HOME/bin"
Restart your shell or simply call source .bashrc
Let me know if this solves your problem and assign points (or mark as solved) if this answer helped you.
Best wishes.

Resources