sublimetext2

Sublime Text 2 Run C++11 Code

冷暖自知 提交于 2021-02-19 08:40:08
问题 I have the following code in Sublime Text 2: #include <iostream> #include <string> using std::cout; using std::string; int main() { string s("some string"); if (s.begin() != s.end()) // make sure s is not empty { auto it = s.begin(); // it denotes the first character in s *it = toupper(*it); // make that character uppercase } cout << s; return 0; } I can build C++11 code in Sublime by pressing ctrl-B as I changed my C++.sublime-build file to "cmd": ["g++", "-std=c++11", "${file}", "-o", "$

Search Results Panel for SublimeText 2

南笙酒味 提交于 2021-02-18 11:11:44
问题 I use Notepad++ on my PC and Sublime Text 2 on my Mac. You can "find all instances" of text in Notepad++, which will then display the find results in a window. In this window I see the line number where the text was found and a snippet of the surrounding text. I find this tremendously useful. Is there a similar feature in Sublime Text 2? 回答1: You could use Find All and then Cmd+F2 to set bookmarks. 回答2: Yes. Use Find in Files ( Ctrl+Shift+F ), and then select the " add current file " option

Search Results Panel for SublimeText 2

流过昼夜 提交于 2021-02-18 11:10:03
问题 I use Notepad++ on my PC and Sublime Text 2 on my Mac. You can "find all instances" of text in Notepad++, which will then display the find results in a window. In this window I see the line number where the text was found and a snippet of the surrounding text. I find this tremendously useful. Is there a similar feature in Sublime Text 2? 回答1: You could use Find All and then Cmd+F2 to set bookmarks. 回答2: Yes. Use Find in Files ( Ctrl+Shift+F ), and then select the " add current file " option

ERROR: The process “node.exe” not found

99封情书 提交于 2021-02-08 13:55:15
问题 The Complete error is ERROR: The process "node.exe" not found. The filename, directory name, or volume label syntax is incorrect. [Finished in 0.3s with exit code 1] I am using Sublime text 2, and installed the NodeJS plugin, I tried to run a simple script, it runs fine with alt+r, but when I saved it (ctrl+s) it gave me that. Any idea on how to fix this? 回答1: Sounds like you don't have Node installed yet on your Windows machine? If you've already installed it, you can check your PATH

Syntax specific settings in sublime-project settings file

﹥>﹥吖頭↗ 提交于 2021-02-07 06:51:18
问题 A sublime-settings file enforces settings on a per-project basis: { "folders": [ ... ] "settings": { "tab_size": 4 } } How is it possible to use syntax specific settings in this file, for example to set a tab_size of 2 only for *.js files? 回答1: You can't set language-exclusive settings directly in your user Preferences.sublime-settings file. However, when editing a file of a given type, you can create a settings file limited only to that type with the menu item Preferences -> Settings–More ->

Converting spaces to tabs in multiple files Sublime Text 2

隐身守侯 提交于 2021-02-06 09:56:30
问题 Is there any way to convert all spaces to tabs, not file by file? If I open a file and go through View => Indentation => Convert Indentation to Tabs , it only changes this file. I want to convert indentations to tabs in a whole project. 回答1: Use search and replace in multiple files to convert n spaces to tabs in select files. First open find in files panel, cmd + shift + f , by default to find and replace in multiple files. Next define a regular expression to match spaces as tabs eg {4} (make

Sublime Text regex to find and replace whitespace between two xml or html tags?

≯℡__Kan透↙ 提交于 2021-02-04 15:15:46
问题 I'm using Sublime Text and I need to come up with a regex that will find the whitespaces between a certain opening and closing tag and replace them with commas. Example: Replace white space in <tags>This is an example</tags> so it becomes <tags>This,is,an,example</tags> Thanks! 回答1: This will find instances of <tags>...</tags> with whitespace between the tags (<tags>\S+)\W(.+</tags>) This will replace the first whitespace with a comma \1,\2 Open Find and Replace [OS X Cmd+Opt+F :: Windows

Is it possible to auto format PHP in Sublime Text 2?

匆匆过客 提交于 2021-02-04 12:49:11
问题 In Sublime Text 2 , I am trying to type the code and have auto format command to rearrange and auto indent source code. If it is not possible to have a automatic formatter, would be nice to have a shortcut command to do it. I am searching for something else besides the built-in "Reindent" option and the hard-to-make-work "PHP Beautifier" plugin. I would like to know if someone found any nice auto formatter for PHP: any formatter that won't mess our PHP code. JSFormat seems to be not useful.

Combining Multi-Line text columns together in Sublime Text

拟墨画扇 提交于 2021-02-04 06:28:45
问题 Lets say I have 2 columns with a billion lines in each here's how they begin: Column 1 I said She said it said Column 2 you're amazing he's awesome enough already I've tried highlighting column 1 and splitting it into lines CTRL+L but then how would I combine column 2's lines to each of colum 1's lines properly to make 1 legible column? 回答1: I'm not 100% sure that I understand what you want to do but if I do then... Use multiple selections like this: Hope this helps and is in fact what you

Is it possible to change the default lorem ipsum in Emmet?

和自甴很熟 提交于 2021-01-29 11:20:15
问题 There are all these great lorem ipsum variations floating around, but no way in hell am I about to go copy and paste them into Sublime Text 2 by hand. I just love Emmet's (lorem100) shortcut too much. Anyone know how to change the default ipsum to one of these custom ones so Emmet will insert it for me? 回答1: You can add your own Lorem Ipsum text into Emmet: you should register your own dummy words as a new language. To add a new language to Lorem Ipsum, create a JS-file in extensions folder