Sublime form command line terminal - sublimetext2

I have set up sublime open from my command line, but it is not opening the file that I am in.
For example, if I am in test.html and enter subl . in the command line sublime will open, but it is blank.
How do I make it open the file that I am currently in?

subl . will open the folder you're in in St. You can either open only one file subl file.html or open the folder, and then display the side bar (from memory: cmd+k, b (ctrl for windows/linux), or somewhere in view menu I guess (not in front of a computer right now).
Hope that helps.
After verification, it's ⌘+K, ⌘+B (for Mac, I guess you just replace ⌘ bt ctrl). Or View->Side Bar->Show Side Bar.
Also, if ST was completely closed before, it happens (not sure if it is systematic) that you have to run the command twice for the file to really open.

Related

Creating .htaccess file without it disappearing upon save (Mac OS)?

Title. I need to upload an htaccess file to my 1and1 webserver but as it's a dot file I can't save it.
What happens here is that you actually CAN save the file, but you just cannot see it.
By default, OSX hides some kind of file.
To make these files visible you have 2 options:
1: Show just once
Go to the folder where you want to see the hidden files.
Press Cmd + Shift + . (dot) in this folder.
Run the same operation to turn it off, or simply close the tab.
2: Show until you turn it off
Open the terminal
Run this command: $ defaults write com.apple.Finder AppleShowAllFiles true followed by $ killall Finder
To turn it off simply replace the true by false in the previous command.
Here you go, from now you should see all the hidden files you want.

Nano text editor not warning when opening file already open

Context: I recently started using the nano text editor on a new machine (Red Hat based).
There's no GUI. I'm doing everything through the terminal. I'm using tmux to run multiple commands at once.
Steps to reproduce:
Open up an existing file in nano
Open up that same file in nano in a separate instance (without terminating the first instance) e.g. in another tmux pane
Expected output:
Nano gives a warning in step 2 along the lines of
this file is currently being edited by nano with PID x. Do you wish to continue?
This is what I have experienced on every other machine I've used nano on
Observed output:
Nano executes step 2 without warning. Only when I try to save the file does it alert me that someone else has the file open.
Issue:
This is an issue because sometimes I:
open file x in instance A
modify but don't save
do something else
forget that I haven't saved my modifications to file x, and forget that it's still open
open file x in instance B
make more modifications in instance B
try to save
be warned that 2 instances are opened
realise that I've made changes to 2 different unsaved instances of the one file

Sublime text version of Notepad++ 's "open current dir cmd"

I installed Sublime text 2 on my windows system . I'm trying to create a shortcut that would open the command line on the current file directory like i can using notepad++ . Also , on a similar note , how do i use/create shortcuts for "Open containing folder" in a way notepad++ allows me.
I think what you're looking for is the Terminal plugin by wbond, the author of Package Control. You can right-click and select Open Terminal Here... or use the CtrlShiftT keybinding to open a terminal at any file's directory, or use CtrlAltShiftT to open it at the directory containing the current project file.

sublhandler.app - opens, but doesn't open sublime text

I've installed subl handler, and I'm trying to test it with the recommended:
open 'subl://open/?url=file:///etc/hosts'
Running this in terminal opens the SublHandler.app itself, but then does nothing - it doesn't open sublime text, let alone the file specified.
In SublHandler prefs, I have the "path to subl" set to /usr/local/bin/subl. If I run /usr/local/bin/subl in my terminal, it opens sublime text.
Any ideas as to why SublHandler isn't working?
Looks like the latest binary from asuth is not working correctly on Maverics. Try my fork here https://github.com/grych/subl-handler - it is working on 10.9.1.

Windows: How to open a .exe in a shell window that won't close?

I've had this problem for ages, and it's SO ANNOYING.
Suppose I want to run mysqldump.exe... here's my process: Start->run, type "cmd" ... dir into directory after directory until I finally get to c:/program files/mysql/bin/then I can FINALLY call "mysqldump.exe"
I don't mind using Windows Explorer to get to c:/program files/mysql/bin, but then I can't freaking open up any of the .exe files in a shell, and I can't open up shell with the directory being that one.
How can I do this?
This is what I do for those type of commands:
Drag a copy of the "Command Prompt" shortcut onto your desktop.
Open the properties of the shortcut.
Change the Target: field to: %SystemRoot%\system32\cmd.exe /k mysqldump.exe
Change the Start in: field to: c:/program files/mysql/bin/
Hit Ok, then rename the short cut from "Command Prompt" to "Mysqldump".
Then just double click the icon whenever you need that command. The "/k" option for cmd.exe leaves the window open.
Microsoft released a powertoy for Windows XP called Open Command Prompt Here. If you're using Vista, all you need to do is hold shift and right-click.
here's my process: Start->run, type
"cmd" ... dir into directory after
directory until I finally get to
c:/program files/mysql/bin/ then I can
FINALLY call "mysqldump.exe"
Why not just the following?
c:
cd "c:/program files/mysql/bin"
mysqldump.exe
Better yet, put this in a batch file and execute it.
You can also create a shortcut for cmd.exe and set the "Start in" directory to "c:/program files/mysql/bin".
You can download an add-in so that you can right click on the folder and open a command prompt. Saves a lot of time and you say you dont mind navigating to the location.
http://download.microsoft.com/download/whistler/Install/2/WXP/EN-US/CmdHerePowertoySetup.exe
A nice little trick is that the icon in the adress bar of explorer could be dragged to a command line window and it insert the full path at your current cursor position.
It doesn't work in vista but if you SHIFT-RightClick on a folder you have an "Open Command Windows Here" option that appears.
Under xp you could have it by saving this as a .reg and executing it :
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\cmd]
#="Open Command Prompt Here"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\cmd\command]
#="cmd.exe /k pushd %L"
Just use the explorer to navigate to the bin or any directory. then enter cmd at the address bar und hit return. the command line with start at this location.
You can do it with python:
If you don't have activepython already, download from ActiveState's Website. Next, run PythonWin and create a new script. Write the following:
from subprocess import *
Call("c://program files//mysql//bin//mysqldump.exe")
Save the script somewhere. When you want to run it, just doubleclick. There are easier ways if you like writing batch files, but Python is more succinct than even windows for this case.
Just put c:/program files/mysql/bin/ into your path...
Then you can run mysqldump.exe directly without even opening a cmd prompt by typing it into " Start > Run "
I was using the MS PowerToy for a while but moved on to the open source Open Command Prompt Shell Extension because of the key feature:
(copied verbatim from the website)
The ability to open a command prompt in the directory that you are currently in by right-clicking on any empty screen space in the directory. This eliminates the need to navigate up a level in order to open a command prompt in the current directory.
Having to actually click on a folder to open the command prompt using the MS tool was a annoyance for me... especially since I always need to run command line tools on my current directory at the time.