Sublime brief notes
Select a word
[1] check the current word ctrl+d
[2] skip the current word ctrl+k ctrl+d
[3] Select all the same words alt+f3
[4] Multi-line cursor hold down shift, then hold down the right mouse button and drag down
Line operation
[1] check the current line ctrl+l
[2] copy the current line ctrl+shift+d
[3] Delete the current line ctrl+shift+k
[4] merge ctrl+j with the next line
[5] the current line moves ctrl+shift+up and ctrl+shift+down up and down
[6] add a blank line ctrl+shift+enter in the upstream
[7] add a blank line ctrl+enter in the following line
Delete
[1] delete the latter word ctrl+delete
[2] delete the previous word ctrl+backspace
[3] delete all words after the line and press ctrl+k twice
[4] delete all words before the line and double-click ctrl+k ctrl+backspace
[5] Delete the current line ctrl+shift+k
Goto (ctrl+p)
[1] File name the file to open
[2]: line specific line (ctrl+g)
[3] @ name CSS selector, HTML ID name and ID value, js event and function name (ctrl+r)
[4] # keyword specific keyword (ctrl+;)
: 20 20 line @ body find the body selector # a find the word with an on the page
Indent
[1] indent tab, ctrl+ forward [
[2] indent tab+shift, ctrl+]
Annotation
[1] comment and uncomment single line ctrl+/
[2] comment and uncomment large chunks of code ctrl+shift+/
Finding and regularization
[1] find ctrl+f
[2] replace ctrl+h
[3] Click * in the find or replace panel, or alt+r new channel IELTS training
Folding
[1] collapse code ctrl+shift+ [
[2] expand code ctrl+shif+]
Code case
[1] Code uppercase and press ctrl+k ctrl+u
[2] Code lowercase double press ctrl+k ctrl+l
Other
Command panel ctrl+shift+p (fuzzy matching can be performed)
Sidebar ctrl+k ctrl+b
Paste the code to keep the indented format ctrl+shift+v
Closed label alt+.
Select the start and tail label ctrl+shif+' where the cursor is located
Ctrl+, selects the current tag once, the sibling tag twice, the parent tag three times, and so on
Ctrl+shif+; removes the parent element and promotes itself to one level, which can be pressed one by one, and so on
Plug-in
Package control installation
Code address: https://packagecontrol.io/installation
/ / TEXT3import urllib.request,os,hashlib; h = '2915d1851351e5ee549c20394736b442' + 8bc59f460fa1548d1514676163dafc88; pf =' Package Control.sublime-package'; ipp = sublime.installed_packages_path (); urllib.request.install_opener (urllib.request.build_opener (urllib.request.ProxyHandler (); by = urllib.request.urlopen ('http://packagecontrol.io/' + pf.replace ('','% 20')). Read (); dh = hashlib.sha256 (by). Hexdigest () Print ('Error validating download (got% s instead of% s), please try manual install'% (dh, h)) if dh! = h else open (os.path.join (ipp, pf),' wb') .write (by)
/ / TEXT2import urllib2,os,hashlib; h = '2915d1851351e5ee549c20394736b442' + 8bc59f460fa1548d1514676163dafc88; pf =' Package Control.sublime-package'; ipp = sublime.installed_packages_path (); os.makedirs (ipp) if not os.path.exists (ipp) else None; urllib2.install_opener (urllib2.build_opener (urllib2.ProxyHandler (); by = urllib2.urlopen ('http://packagecontrol.io/' + pf.replace ('','% 20')). Read () Dh = hashlib.sha256 (by). Hexdigest (); open (os.path.join (ipp, pf), 'wb') .write (by) if dh = = h else None; print (' Error validating download (got% s instead of% s), please try manual install'% (dh, h) if dh! = h else 'Please restart Sublime Text to finish installation')
Installation steps: ctrl+ `(or view-> show console) open the console, copy the above code to the console and enter
Emmet
[1]!-> automatically generate skeleton structure
[2] # foo-> ID is' foo'
[3] .Foo-> class name is' foo'
[4] +-> sibling elements
[5] * 3-> generate 3 elements
[6] W100-> width:100px
[7] m5e-> margin: 5em
[8] @ f-> @ font-face
[9] $- > incremental value from 1
[10] {}-> element content
Code segment
The code in Sublime is called snippets, which is located in the snippnets folder under the User folder in Preferences- > Browse Packages.
Various custom code snippets are stored in it.
Generally speaking, people often use the markdown language to write web documents, but I think the html files generated by the markdown language are not very clean. Clean html files can be generated by using sublime with code snippets
Take the generation of a paragraph indented by the first line as an example
Use Tools-Developer-New Snippet to create a new code snippet, as follows
Then make the following settings.\ ${1} and\ ${2} represent the location of the code generation and the location after pressing the Tab key, respectively; the content of the tabTrigger element p2 represents the shortcut key of the snippet, enter p2, and then press and hold the tab key, and the custom code appears
${1}
${2}] > p2