sublime Brief Notes

Select the word

[1] Select 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 holds shift, then holds the right mouse button and drags down

 

Line operation

[1] Select the current row ctrl+l

[2] Copy the current row ctrl+shift+d

[3] Delete the current line ctrl+shift+k

Merge [4] with the next row [ctrl+j]

[5] Current row move up and down: ctrl+shift+up, ctrl+shift+down

[6] Add blank lines to the line ctrl+shift+enter

[7] Add blank lines downstream

 

delete

[1] Delete the last word ctrl+delete _____________

[2] Delete the previous word ctrl+backspace

[3] Delete all the words after the line and press ctrl+k twice.

[4] Delete all words in front of the line and press ctrl+k ctrl+backspace

[5] Delete the current line. [ctrl+shift+k]

 

goto(ctrl+p)

File Name [1] File to Open 

[2]: Lines (ctrl+g)

[3]@Name CSS selector, HTMLID name and ID value, js event and function name (ctrl+r)

[4] Keyword # Specific keyword (ctrl+;)

20) 20 lines
 @ Find the body selector
 # Find out the words with a on the page

 

indent 

[1] indent tab, ctrl forward+[

[2] Backward indentation tab+shift, ctrl+]

 

Notes

[1] Note and Uncomment Single Line ctrl+/

[2] Annotate and uncomment large code ctrl+shift+/

 

Finding and Regulating

[1] Find ctrl+f

[2] Replace ctrl+h

[3] Ordinarily click on * or alt+r in the Find or Replace panel

 

Fold

[1] Collapse code ctrl+shift+[

[2] Expansion code ctrl+shif+]

 

Code case

[1] Code capitalized by ctrl+k ctrl+u

[2] Code in lowercase, press ctrl+k ctrl+l

 

Other

Command panel Ctrl + Shift + P (can be fuzzily matched)

Side Bar * ctrl+k ctrl+b

Paste code in indented format ctrl+shift+v

Closed label alt+.

Select the first and last label where the cursor is located. ctrl+shif +'

ctrl +, select the current label once, add the same label twice, add the parent label three times, and so on

ctrl+shif +; remove the parent element, so that they can improve their own level, can be clicked, and so on.

 

Plug-in unit

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) opens the console, copies the above code to the console and returns

 

emmet

[1]! - > Automatic Skeleton Generation

[2]#foo-> ID is'foo'

[3]. foo - > class named'foo'

[4]+-> homologous elements

[5]*3-> Generates three elements

  [6]w100 -> width:100px

  [7]m5e   -> margin: 5em

  [8]@f    ->@font-face

[9]$- > Incremental value from 1

[10]{} - > Element Content

 

Code snippet

The code in Sublime is called snippets, located in the snippnets folder under the User folder in Preferences - > Browse Packages

It contains custom code snippets

Generally, people use markdown language to write web documents, but I think the html files generated by markdown language are not very clean. Using sublime with code snippets, cleaner html files can be generated

Take generating an indented first line paragraph as an example

Use Tools-Developer-New Snippet to create a new code snippet, as shown below

Then set up the following settings: and represent the location of the code generation and the location after pressing the Tab button respectively; the content P2 of the tabTrigger element represents the shortcut key of the snippet, input p2, and hold down the tab button, then a custom code appears.

<snippet>
    <content><![CDATA[<p style="text-indent:2em">${1}</p>${2}
]]></content>
    <!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
    <tabTrigger>p2</tabTrigger>
    <!-- Optional: Set a scope to limit where the snippet will trigger -->
    <!-- <scope>source.python</scope> -->
</snippet>


Tags: sublime Python

Posted on Thu, 11 Jul 2019 12:30:50 -0700 by djcubez