sublimetext3

How can a Sublime Text build system access the contents of a buffer, not a file?

柔情痞子 提交于 2019-12-04 10:58:16
Let's say I open a new buffer in Sublime Text 3 (ST3); how can I access the contents of that buffer from my build system? i.e. Let's say I have a build system that will run a file thorough node —in that case I can simply use $file , but as far as I can tell, there is no build system variable for the current buffer's contents. Is there any way to pull the contents of the currently selected, unsaved buffer into a build process? To do this you will need to write a custom plugin to perform the build process, then add "target": "my_plugin_class" to your .sublime-build file instead of the standard

Double click highlight variable Sublime Text 3 include $

冷暖自知 提交于 2019-12-04 10:13:52
问题 I wanted ST3 to include the "$" when selecting PHP files so I edited word_separators by removing $ as such : "word_separators": "./\\()\"':,.;<>~!@#%^&*|+=[]{}`~?" And now it highlight the whole varibale including the "$" when double clicking a variable. However, now Sublime is not matching/outlining those variables using the default match_selection functionality. Any thoughts on this? Is there a setting I am missing. Much appreciated. 回答1: Please see my answer to this question for an in

Sass compiler not working in sublime text 3

故事扮演 提交于 2019-12-04 10:04:12
I have Sass installed on my Windows 7 machine and I'm trying to compile some scss. Each time, I get the following output: 'sass' is not recognized as an internal or external command, operable program or batch file. [Finished in 0.2s with exit code 1] [cmd: ['sass', '--update', 'W:\\exocet\\web\\build\\mirror\\css\\style.scss:W:\\exocet\\web\\build\\mirror\\css/style.css', '--stop-on-error', '--no-cache']] [dir: W:\exocet\web\build\mirror\css] [path: C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\EgisTec\MyWinLocker 3

How to set JSX files default to Babel text highlighting in sublime

拈花ヽ惹草 提交于 2019-12-04 08:59:01
问题 I have a babel text highlighting that i added in my sublime. However every time I open a new react project it defaults to javascript text highlighting then i have to reset each javascript file to get the correct text highlighting. As you can see in the lower right of my screenshot it is by default set to javascript. 回答1: The syntax that Sublime selects is based primarily on the extension that the file has. You can select View > Syntax > Open all with current extension as... from the menu

Sublime Text wrap selection with snippet

别来无恙 提交于 2019-12-04 07:41:08
问题 I've been digging into Sublime's snippets, plugins and macros, but I can't seem to find what I'm looking for. I'm trying to turn this: .content { color: @blue; } Into this: .content { color: darken(@blue, 5%); } Ideally, I'd be able to select the @blue part, hit a command, and wrap the whole thing properly. Any ideas? Is this even possible? 回答1: As can be seen here: Tools -> New Snippet... -> save as darken.sublime-snippet in Data\Packages\User\ <snippet> <content><![CDATA[darken($SELECTION,

Configure Sublime Text build system for Scala?

ぃ、小莉子 提交于 2019-12-04 07:39:47
I'm trying to configure a build system for Scala with SublimeText, but I am having some difficulty. I have tried both of the following: { "shell_cmd": "scala", "working_dir": "${project_path:${folder}}", "selector": "source.scala" } { "cmd": ["/path/to/bin/scala", "$file_name"], "working_dir": "${project_path:${folder}}", "selector": "source.scala", "shell": true } Both of these attempts produce the same failed output - it seems to start up the interactive Scala shell rather than running my script. Any advice? The answer that worked turned out to be very close to the second answer - apparently

How to Install Sublime Text 3 using Homebrew

冷暖自知 提交于 2019-12-04 07:31:37
问题 How can I use homebrew cask to install Sublime Text 3? I only see sublime text 2 in the repos. I even tried tapping homebrew/versions, but no luck. Thanks! EDIT: Answered by my answer below 回答1: I originally used this page to solve the same problem in the past - however it would appear as if the sublime-text cask has been updated to now be the most recent release of Sublime Text 3 . No workarounds are necessary anymore. Installation is as simple as brew cask install sublime-text . 回答2: brew

How to use sidebar with the keyboard in Sublime Text 2 and 3?

…衆ロ難τιáo~ 提交于 2019-12-04 07:20:51
问题 When using Sublime Text 2 we tend to open the side bar to navigate thru files/folders in our projects. For that we can use the hotkey ctrl+k ctrl+b (in windows). However, once we're in the side bar , we can't use it with keyboard (arrows for instance). We have to stick using it with our own mouse... Just a note : I installed SideBarEnhancements plugin, but I didn't find anything that could solve my problem. Any solution you might know? 回答1: You can type Ctrl + 0 ( Ctrl + Zero ) to focus on

Replace \n with actual new line in Sublime Text

只谈情不闲聊 提交于 2019-12-04 07:19:12
问题 How can I replace \n in Sublime Text with real in-editor displayed new line so: foo\nbar becomes: foo bar in the editor when I view the file in it. 回答1: Turn on Regex Search and Replace (icon most to the left in search and replace bar or shortcut Alt + R ) Find What: \\n Replace with: \n Cheers 回答2: Use Find > Replace , or ( Ctrl + H ), to open the Find What / Replace With Window, and use Ctrl + Enter to indicate a new line in the Replace With inputbox. 回答3: Fool proof method (no RegEx and

How do you execute a lua file in sublime text 3?

假装没事ソ 提交于 2019-12-04 05:40:32
How do you execute a lua file in sublime text 3? I tried opening the console and typing build <filename>.lua . I also looked through the menu's for a build and run. Supposedly saving a file or hitting F7 is supposed to execute lua scripts, but that did not work either. I expected 'helo world' to print in the console upon save and all it said was the file was written. contents of helo.lua: print('helo world'); You can manually create a build configuration for Lua. However, I suggest that it is simpler to install a Lua package that includes one. Install Package Control Open the Command Palette