Sublime Text: Difference between revisions

From Wiki
Jump to navigation Jump to search
No edit summary
 
(17 intermediate revisions by the same user not shown)
Line 1: Line 1:
Settings on Mac, Nov 2024:
<pre>
{
"font_size": 16,
"ignored_packages": ["Vintage",
],
"hot_exit": "only_on_quit",
"trim_trailing_white_space_on_save": "all",
"ensure_newline_at_eof_on_save": true,
"word_wrap": true,
"index_files": true,
}
</pre>
== Old ==
http://www.sublimetext.com/docs/3/index.html
http://www.sublimetext.com/docs/3/index.html


== Moving around ==
== Moving around ==
Line 12: Line 28:
* Ctrl-I
* Ctrl-I


=== Go To Method (Code Outline) ===
=== Go to Anything ===
* Ctrl-R to show code outline, type to fuzzy-search
* Go to File (in project): Ctrl-P, type to fuzzy-search
 
* Go to Method (Code Outline): Ctrl-R to show code outline, type to fuzzy-search
=== Go to File (in project) ===
* Go to Method in File: Ctrl-P, search for file, type "@", then search for method
* Ctrl-P, type to fuzzy-search
* Go to Line: Ctrl-G  (or Ctrl-P, type ":"), then line number


== Selecting ==
== Selecting ==
Line 27: Line 43:
* Ctrl-U to undo last
* Ctrl-U to undo last
* Alt+F3 to select all occurrences
* Alt+F3 to select all occurrences


== Tools ==
== Tools ==
* Command Pallette: Ctrl+Shift+P, type to fuzzy-search
* Command Pallette: Ctrl+Shift+P, type to fuzzy-search
* Code Outline: Ctrl+R
== Projects ==
http://www.sublimetext.com/docs/3/projects.html
Assume you've got a folder full of code called <code>myproject</code>.  Go to '''Project -> Save Project As...''' and save the project just inside that folder.  This will create <code>myproject.sublime-project</code> and <code>myproject.sublime-workspace</code> files.
As a general rule, the <code>sublime-project</code> file would be checked into version control, while the <code>sublime-workspace</code> file would not.
Add subfolders to the project with '''Project -> Add Folder to Project...'''
== Package Control ==
Must install Package Control manually:
https://sublime.wbond.net/installation
Then install the packages you want:
''Ctrl+Shift+P install ...''
== Customizing ==
* Open Default Settings (Preferences -> Settings -- Default) to find and copy the relevant setting.
* Open User Settings (Preferences -> Settings -- User) and paste in the line you want with the appropriate change.
<pre>
{
"color_scheme": "Packages/Color Scheme - Default/Solarized (Light).tmTheme",
"font_size": 11,
"ignored_packages":
[
"Vintage"
],
"word_wrap": true,
"hot_exit" : false
}
</pre>
== Copying your settings to another machine ==
All of the settings for Sublime Text live in <code>~/.config/sublime-text-3</code> on Ubuntu.

Latest revision as of 18:24, 12 November 2024

Settings on Mac, Nov 2024:

{
	"font_size": 16,
	"ignored_packages": ["Vintage",
	],
	"hot_exit": "only_on_quit",
	"trim_trailing_white_space_on_save": "all",
	"ensure_newline_at_eof_on_save": true,
	"word_wrap": true,
	"index_files": true,
}

Old

http://www.sublimetext.com/docs/3/index.html


Moving around

Moving the cursor

  • to beginning/end of current word: Ctrl-left/Ctrl-right

Moving the view

  • up/down: Ctrl-up/Ctrl-down

Incremental Search

  • Ctrl-I

Go to Anything

  • Go to File (in project): Ctrl-P, type to fuzzy-search
  • Go to Method (Code Outline): Ctrl-R to show code outline, type to fuzzy-search
  • Go to Method in File: Ctrl-P, search for file, type "@", then search for method
  • Go to Line: Ctrl-G (or Ctrl-P, type ":"), then line number

Selecting

Column Select

  • Shift + right-click + drag

Select instances of a word (multiple cursors)

  • Ctrl-D to select current and next instances of word
  • Ctrl-U to undo last
  • Alt+F3 to select all occurrences

Tools

  • Command Pallette: Ctrl+Shift+P, type to fuzzy-search
  • Code Outline: Ctrl+R

Projects

http://www.sublimetext.com/docs/3/projects.html

Assume you've got a folder full of code called myproject. Go to Project -> Save Project As... and save the project just inside that folder. This will create myproject.sublime-project and myproject.sublime-workspace files. As a general rule, the sublime-project file would be checked into version control, while the sublime-workspace file would not.

Add subfolders to the project with Project -> Add Folder to Project...

Package Control

Must install Package Control manually: https://sublime.wbond.net/installation

Then install the packages you want: Ctrl+Shift+P install ...

Customizing

  • Open Default Settings (Preferences -> Settings -- Default) to find and copy the relevant setting.
  • Open User Settings (Preferences -> Settings -- User) and paste in the line you want with the appropriate change.
{
	"color_scheme": "Packages/Color Scheme - Default/Solarized (Light).tmTheme",
	"font_size": 11,
	"ignored_packages":
	[
		"Vintage"
	],
	"word_wrap": true,
	"hot_exit" : false
}

Copying your settings to another machine

All of the settings for Sublime Text live in ~/.config/sublime-text-3 on Ubuntu.