sublimetext2

No autocomplete popup in JSP files for snippets

拥有回忆 提交于 2019-12-25 05:26:15
问题 I made a bunch of snippets I want to use when I'm editing .jsp files in Sublime Text 2. When I edit a JSP file (syntax: JSP) the autocomplete function doens't work. When I change the syntax to "Java" the autocomplete works. Plan B: it does work with the JSP syntax when I hit 'c: tab'. But there is no autocomplete while typing like with the Java syntax. I tried changing and removing the scope changing the tabTrigger to core-, not using ":", giving every snippet another trigger, giving every

Sublime Text Open New Window API

六眼飞鱼酱① 提交于 2019-12-25 05:16:24
问题 I'm writing a sublime text plugin. I'm trying open few files in new window. In sublime text API reference I found a way to open files with window.open_file(filepath) but I didn't find anything for opening a new window. Can someone please point me to it. I know it's a dumb question but blame it on inadequate documentation :) 回答1: You can use new_window command. sublime.run_command("new_window") sublime.active_window().open_file(filepath) By the way, you can find lots of useful information via

Duplicate line and comment out old one

我与影子孤独终老i 提交于 2019-12-25 03:17:12
问题 I often need to edit a line but comment out the old one. Is it possible to create a key binding for these commands in Sublime Text 2? duplicate current line comment out the top line move the cursor to the bottom line 回答1: Assuming the comment syntax is defined for the file type, you can use a simple macro (though even if it's not you could do it, the macro would just be a little more involved). Anyways, save the following in Packages/User as whatever you like. Be sure the extension is

Sublime Text 2 double quote font-style depends on file extension?

你。 提交于 2019-12-25 02:42:51
问题 The auto-pairing of double quotes is a really strange issue that I thought I'd solved but still persists. The issue is that for files of the extension .php, .html, the default font-style of auto-paired double quotes is not parseable. To show you what I mean, notice the font-style of the double quotes in the <div> on the left. Whereas with .js and .css files, the double quote auto-pairing has the proper font-style as shown in the <div> on the right>. This must be a setting somewhere but I don

Using the Command-line Command to launch Sublime Text 2 on OS X

北城余情 提交于 2019-12-25 01:48:36
问题 I just started reading Michael Hartl's book on Rails and I've run across a problem in the setup phase. Hartl keeps referring to making a file in my home directory, but I'm not quite sure how to do this. For example, when I try to setup the command line for sublime text the instructions tell me to do this: Assuming you've placed Sublime Text 2 in the Applications folder, and that you have a ~/bin directory in your path, you can run: ln -s "/Applications/Sublime Text 2.app/Contents

Sublime Text won't automatically change code, when I switched to different branch

人盡茶涼 提交于 2019-12-25 01:31:04
问题 Lately, I'm learning GitHub, in the tutorial videos they used Eclipse for editing the project/repository. In that vid I saw the code changed when he switch to another branch. I'm currently using Sublime Text 2 and can't get the same behavior, is there anyway to make Sublime Text 2 behave like Eclipse? Here is my Preferences -> Settings-User: { "font_size": 12 } 来源: https://stackoverflow.com/questions/24412876/sublime-text-wont-automatically-change-code-when-i-switched-to-different-branc

Problems with running Python 32 in Sublime Text 2

随声附和 提交于 2019-12-24 21:58:09
问题 I know that there are lots of questions about running Python in Sublime Text 2, but i have a problem. I've changed "Python.sublime-build" file in AppData package on this one { "cmd": ["C:\\Program Files\\Python32\\python.exe", "-u", "$file"], "file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)", "selector": "source.python" } Where "C:\Program Files\Python32\python.exe" is my own path. When I press Ctrl + B. I see "building..." and than the inscription disapeers and nothing happens. What to do

Move line to next section with SublimeText

*爱你&永不变心* 提交于 2019-12-24 20:30:04
问题 I'm looking for a way to move a line to the "next section" with SublimeText. It could be in the "next paragraph" if it's text (see below), in the "next node" if it's XML, in the "next code block" if it's code, etc. Currently I'm using CTRL SHIFT DOWN ARROW many times to move it to the next section, but I think SublimeText might have this feature out-of-the-box. Example of main use case: &section1 abcdef ghijkl <--- if the cursor is in this line, pressing CTRL+DOWN would move this line...

Regular Expression search in Sublime for all font-family: not preceded by an opening comment

孤街浪徒 提交于 2019-12-24 15:53:47
问题 I have to remove a lot of font-family: declarations from my website, they are hundreds and I have replaced most of them with the same line, only commented (ex: /* font-family: "Segoe UI","Helvetica","Arial"; */ ). Now, if I could only search for the un-commented ones to find the few that are left. My first atempt clearly demonstrates I do not fully understand regular expressions: ^(?!(?:/*)).*\s*."font-family:"."*" The syntax is Boost (but only a subpart of it, as the replacement is PCRE

Can Sublime text 2 Follow path in a file?

六眼飞鱼酱① 提交于 2019-12-24 15:32:13
问题 Is it possible to open a linked file in sublime text 2 ? What I mean is, imagine I have the following code : <?php require_once( 'include/const-inc.php' ); require_once( 'include/db-inc.php' ); require_once( 'classes/dummy-class.php' ); ?> I would love to be able to click on the files to open the corresponding file. Sublime text knows the local file path so should be able to resolve the corresponding files paths no? 回答1: Check out the Open-Include plugin, available via Package Control. It