In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces some tips on using sublime text2, which is very detailed and has a certain reference value. Friends who are interested must finish it!
In addition to its numerous practical features and features, SublimeText2 can also be installed to enhance itself with a variety of extension / skin / color schemes, etc.
1. Fast file navigation: this is one of the easy functions on sublime. Ctrl+p can call up the window, and the interpretation on the menu is gotoanythings. Indeed, as it said, after calling up the window, enter keywords directly, you can quickly navigate the file name in the open project folder, and support fuzzy search, which is very convenient for students who do not want to click on the folder all the time. And add: the prefix is ctrl+G, and the @ (ctrl+R) prefix is id keyword navigation in html, every regular navigation in css, and each function navigation in js.
two。 Command line mode ctrl+ `can call up command line mode (view- > show console), mainly supports python syntax, etc. Only quit () can exit without trying. However, sublime's plug-in platform package controller can be installed from the command line.
3. Ctrl+Z revocation Ctrl+Y resume revocation
4. Ctrl+D word selection (press and hold-continue to select the next same string) ctrl+F search is to select all the same on this page and then press the keyboard to replace them all
5. Ctrl+shift+F defaults to this project (most frequently used). It is also possible to look in folders. Unlike ordinary editors, sublime allows multiple folders to be added for search (add directory).
6. Ctrl+L Select the whole row (press and hold-continue to select the down line, that is, press ctrl without pressing L once to select one more row)
7. Ctrl+Shift+K deletes the whole line, and Ctrl+KK deletes it from the cursor to the end of the line.
8. Ctrl+/ single-line comments, ctrl+shift+/ block comments (comments have been selected), sublime will automatically select the annotation method according to the language
9. Insert row after ctrl+Enter cursor insert row in front of Ctrl+Shift+Enter cursor
10. Ctrl+F2 can add tags, and then F 2 can switch between tags, a bookmark on Shift+F2. The bad thing here is that the mouse cannot be tagged.
11. Under the menu View-syntax, the current face can be syntactically highlighted in the specified language. Usually, sublime will automatically judge and choose.
12. Snippets code snippet plug-in, you can view the snippets supported by the current page under the tools-snippets menu, you can add tab after the acronym to automatically complete snippets, and snippets can also be extended from the installation plug-in
13. Build compilation, you can compile ruby and other code. After I install a yui compressor, I can compress it in the css js page. The shortcut key is ctrl+B, which will automatically generate xx.min.js, xx.min.css and other compressed files in the current directory.
14. Under the menu Preferences are various configuration files. Unlike other editors, sublime does not provide visual configuration. Software configuration and shortcut key configuration are all manually configured in .xml files. Settings-default is the default configuration of the system, and it is best not to change it. The things to be changed are stored in Settings-User, such as font- size, Key-bindings is shortcut key configuration, color scheme is code color scheme choice. Sublime itself provides a lot of good color schemes.
15. In the lower right corner of the page, there is a menu that quickly sets tab to spaces. You can specify the tab width of the page, or you can convert all the tab of the page to a specified number of spaces cells.
16. Other shortcut keys
Ctrl+ [and ctrl+] (has been changed to my usual shortcut key).
Ctrl+up, ctrl+down can scroll the screen one by one
PageUp pageDown turns page by page.
Ctrl+shift+a can HTML tag content, step up each time you press it.
Ctrl+shift+space can choose blocks {content} in languages such as js.
Ctrl+Shift+D copies the entire line of the cursor and inserts it before the row
Ctrl+J merging parallelism (when multiple lines to be merged have been selected)
Ctrl+KU changed to uppercase
Ctrl+KL changed to lowercase
The Ctrl+M cursor jumps to the corresponding parenthesis (the BracketHighlighter plug-in does better)
Ctrl+Shift+M Select the contents in parentheses (press and hold-continue selecting parent parentheses)
Alt+. Close the current label
Ctrl+Shift+A Select cursor position parent tag pair
Ctrl+Shift+ [collapse code
Ctrl+Shift+] deployment code
Ctrl+KT collapse Properties
Ctrl+K0 expands all
Ctrl+U soft undo
Ctrl+T word exchange
Automatic completion of Tab indentation
Shift+Tab remove indent
Ctrl+Shift+ ↑ swaps with uplink
Ctrl+Shift+ ↓ swaps with downlink
Ctrl+K Backspace is removed from the cursor to the beginning of the line
17 add smart code block prompt Tools- > new snippet (the suffix for saving on Mac should be. Sublime-snippet)
Content: the code must be placed in CDATA. $1 represents the location of the cursor. It is convenient to edit the class name tabTrigger: shortcut key scope: response range can be html css js file and other description: code description the description text in the prompt box when entering the shortcut key
Next, let's introduce the highlight of sublime, plug-in mechanism: (restart the software after all plug-ins are installed)
The sublime plug-in can be installed in two ways
One is to download all the source codes directly and place them under C:\ Users\ yourName\ AppData\ Roaming\ Sublime Text 2\ Packages. The path can be viewed in the software menu bar Preferences- > Browse Packages.
One can be installed online by installing package control online. For package control installation, you can run the following code in the console, and then restart it:
Import urllib2,os; 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 ()); open (os.path.join (ipp,pf), 'wb') .write (urllib2.urlopen (' http://sublime.wbond.net/'+pf.replace('','% 20'). Read ()); print 'Please restart Sublime Text to finish installation'
After installation, you can open it under the menu preferences-package control (here there is a shortcut key ctrl+shift+p is a collection of commands operated by the editor, which can be indexed directly according to the keyword). Under package control, Install Package installs the plug-in. After selection, you will connect to the network to get the plug-in list, disabled package is disabled plug-in, enabled package enables plug-in, remove package removes plug-in, list package lists plug-in list.
Here are some plug-ins that I find useful, and their functions (installation method: package control install online search for installation):
1. SVN: right-click on the file or folder after generation (this costs money, if it is windows, use TorstoiseSVN, this must be pre-installed with TorstoiseSVN)
2. BracketHighlighter: this plugin provides pairing tags, or pairing highlights of curly braces or character quotes, which can be regarded as an enhancement to the system highlight.
3. SublimeTmpl:
Customize the new file. Html, css, js and other common types of panels have been added by default. Press ctrl+alt+h/ctrl+alt+c / ctrl+alt+j to create these three types of files. The shortcut key is here\ Packages\ SublimeTmpl\ Default (Windows) .sublime-keymap, and the template file is here\ Packages\ SublimeTmpl\ templates, which can be modified.
4. Ctags:
This plug-in can jump across files to the place where the specified function is declared (left-click ctrl+alt+). Use package control search ctags to install (just install the ctags plug-in, and a CTags for PHP plug-in is useless). Note that you need to install the ctags command after installing the plug-in. Window downloads ctags.exe http://vdisk.weibo.com/s/7QZd7. Put the ctags.exe file in a place where the environment variable can access it. Open cmd, type ctags, and if you have this command, it proves to be successful. Install and run the command under ubuntu: sudo apt-get install exuberant-ctags. Then right-click the sublime project folder and the Ctag:Rebuild Tags menu will appear. Click it, and then generate a .tags file, then in your code, the cursor over a function, click to jump to the place of the function declaration.
5. Sublimecodeintel:
Code hint. Sublime default code hints can only prompt system functions, user-created functions, classes can not be prompted. If you want to prompt yourself for the function you built. You can install the sublimecodeintel plug-in. (need to type a few more characters and case-sensitive to display, sometimes it doesn't work.) sublimecodeintel needs to be configured after installation. File: add to plug-in directory / .codeintel/config
{"Python": {"python": "D:\ servers\ python27", "pythonExtraPaths": ["libs", "~ / Applications/Sublime Text 2.app/Contents/MacOS", "/ Applications/Sublime Text 2.app/Contents/MacOS"]}}
Configured the address of the python execution file, the address of the configuration file of python, pythonExtraPaths is the class library that needs additional code hints, in addition to the PHP code under the current project can prompt in addition to the directory defined in pythonExtraPaths python code can also prompt. After installing sublimecodeintel, pressing the left mouse button of alt+ can also jump to the place where the function is declared like ctags. But if two files declare a function with the same name, sublimecodeintel will only jump to the first found function, while ctags will let you choose which file to jump to. So we usually use ctags.
6. Sublimelint (there is also a SublimeLinter that should be similar)
A plug-in that supports lint syntax, can highlight lines of code that linter thinks is wrong, and also supports highlighting some special comments, such as "TODO" which requires some library support such as php to PHP-syntax checking via "php-l". Just add php to the environment variable. Execute the following statement on the command line if it works properly because the library support is already installed when you install php, so just add php to the environment variable
The syntax for checking is like this, where the-l flag is a lower case L:php-l filenameIf the syntax in the file is correct you will see this:No syntax errors detected in test.phpIf there are errors then theses will be listed as in the following example output:Parse error: syntax error, unexpected T_STRING in test.php on line 52Errors parsing test.php
7. SFTP this plug-in provides ftp server management, used to manage their own space is very good, through the configuration to operate. Right-click in the left folder to select Map to Remote... after restarting the software after installation The sftp-config.json configuration can be generated under the folder. When you use it, right-click just like SVN.
8. Automatic sorting of PHPTity:php code. Ctrl+alt+t after restart after installation
9. DocBlockr: this plug-in provides file comments to facilitate later generation of API documents based on comments. Enter "/ * *" + enter to call it out (only on the top line of function)
10. GBK Encoding Support: sublime itself does not support GBK. According to the national conditions, installing this plug-in can support GBK, and it also provides conversion between GBK and UTF.
11. Jquery provides some snippets fragments of jquery, which is convenient to call directly
12. There is no need to explain the famous zencoding of zenCoding. There are two ways to call it, one is ctrl+alt+enter, and the other is tab directly after typing the tag.
13. Html5 this plug-in provides a lot of html5-related tags and other snippets, is also very useful.
14. Prefixr provides browser prefixes with CSS3 attributes such as-webkit--moz--o-MMI, shortcut key: ctrl+alt+x
15. SCSS supports the syntax highlighting of scss, which comes with a lot of CSS Snippet, which can save a lot of time, whether it is used or modified.
16. JS Minifer provides js compression function, GG-based closure complier, shortcut key: ctrl+alt+M
17. Js Format provides JS formatting function, shortcut key ctrl+alt+F, according to
18. Yui compressor, a compression tool known as yui, can compress CSS JS and CTRL+B directly (you need to install and configure jdk before you can use it)
19. Sublime V8 this plug-in provides js parser for jshint and V8 engine console,jshint is a JS syntax verifier, which is more strict, and V8 is the same as the console in chrome.
20. ClipboardHistory: this plug-in provides multi-clipboard support, so you can save the contents of multiple clipboards at the same time. The ctrl+alt+v shortcut key is called up.
These are all the contents of this article entitled "some Tips for using sublime text2". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.