Sublime Text includes a command line tool, subl, to work with files on the command line. This can be used to open files and projects in Sublime Text, as well working as an EDITOR for unix tools, such as git and subversion.
The first task is to make a symlink to subl. Assuming you’ve placed Sublime Text in the Applications folder, and that you have a ~/bin directory in your path, you can run:
ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" ~/bin/subl
Run subl --help,
Usage: subl [arguments] [files] edit the given files or: subl [arguments] [directories] open the given directories or: subl [arguments] - edit stdin Arguments: --project <project>: Load the given project --command <command>: Run the given command -n or --new-window: Open a new window -a or --add: Add folders to the current window -w or --wait: Wait for the files to be closed before returning -b or --background: Don't activate the application -s or --stay: Keep the application activated after closing the file -h or --help: Show help (this message) and exit -v or --version: Show version and exit --wait is implied if reading from stdin. Use --stay to not switch back to the terminal when a file is closed (only relevant if waiting for a file). Filenames may be given a :line or :line:column suffix to open at a specific location.
To use Sublime Text as the editor for many commands that prompt for input, set your EDITOR environment variable:
export EDITOR='subl -w'
Specifying -w will cause the subl command to not exit until the file is closed.
sudo ln -s /opt/sublime_text/sublime_text /usr/local/bin/subl
I added this to my PowerShell profile:
Set-Alias subl 'C:\Program Files\Sublime Text 3\sublime_text.exe'
To include the Sublime installation folder in windows path,
Path” and click
C:\Program Files\Sublime Text 3;” to the end of the existing string.
Meet a new Git Client, from the makers of Sublime Text
The Integrated Merge Tool allows you to resolve any merge conflicts directly in Sublime Merge, rather than having to open up your editor of choice.
Conflicts are presented with a 3-pane view. On the left are your changes and on the right are theirs. In the center pane is the resolved text, with buttons to choose between your changes or theirs. The same text editing functionality as Sublime Text is also available for more complicated merges.
Clicking on the header in the middle pane will switch between the editable merge results and the base file.
Use ⌘+S or the button to save your merged file.
Use find-as-you-type search to dig up the exact commit you’re looking for.
Search for commit messages, commit authors, file names, and wildcard patterns. Complex search queries can be constructed using and, or and () symbols.
For example min-parents:2 author:jskinner path:tests/* (bug fix or test) will search for a merge commit from jskinner inside the tests directory that contain the words “bug” and “fix” or the word “test”.
You can open search with ⌘+F or through the menu: .
Sublime Merge is built on the same custom platform as Sublime Text, providing unmatched responsiveness. With a powerful, cross-platform UI toolkit, an unmatched syntax highlighting engine, and a custom high-performance Git reading library, Sublime Merge sets the bar for performance.
Open the Blame of a file through the Command Palette or when viewing a commit to see exactly which lines of the file were added by which commits.
Easily view the age, author, and commit hash of every line of code and see which lines come from the same commit with our commit color coding. Click a line in the gutter to highlight all other lines from the same commit.
The blame tool will also detect when a piece of code was moved from another place in your repository, so you can truly follow the history of your code.
Where it makes sense we will show you exactly which individual characters have been changed for a commit.
This includes when you rename or move a file, when you’re resolving conflicts or just viewing commit history.
Select any two commits in Sublime Merge with ⌘+Left Mouse to show the diff between them.
From any file or hunk in the history useor the button to view the full history of that source code. This will also follow any file moves or renames throughout the repository.
Keyboard usage is important to us. Use Tab to navigate through parts of the application, Space to toggle expansion, and Return to stage/unstage hunks. When writing a commit message, use ⌘+Return to commit.
The Command Palette is triggered by ⌘+P and allows quick access to a large set of Git commands as well as other Sublime Merge functionality.
Choose between a light and a dark theme to suit your tastes. You can preview these themes above.
Open themenu to change theme.
The dark theme is only available with a valid license key.
Just like Sublime Text, just about everything in Sublime Merge is extensible. Key bindings, menus, theming, and the command palette are all customizable with simple JSON files.
Sublime Merge performs full syntax highlighting identically to Sublime Text for every line of code you see.
We’ll even use any extra syntax definitions that we find in your Sublime Text installation for syntax highlighting!
Sublime Merge is designed to work hand in hand with the command line. All changes to the repository are updated live and everything works the same way whether it’s triggered from the command line or the UI. Use the terminal where it makes sense and use the GUI where it works best.
Use the smerge tool that comes with Sublime Merge to interact with it from the command line: open repositories, blame files or search for commits
Sublime Merge uses the same terminology as Git, and doesn’t make use of any state beyond Git itself. When you’re working with Sublime Merge, you’re working with Real Git, not a simplified version
You can also hover over most buttons to see which git command it will run.