sublimetext3

Double Filetype Extension: Correct Syntax Highlighting in Sublime Text 3

十年热恋 提交于 2019-12-10 19:12:29
问题 I am working with some .scss.liquid files and they always open as HTML Liquid, no matter how many times I set the syntax. Update: I tried open all with current extension as option, but unfortunately this affects files that are .js.liquid and .html.liquid as well. 回答1: Sublime Text allows you to apply settings on a per-language basis (actually, per syntax). One of the available settings allows you to map file extensions to the given syntax. Assuming you're using a syntax named SCSS , Create an

How to add custom HTML tags in Sublime Text 3

戏子无情 提交于 2019-12-10 18:56:59
问题 In ST3 if you type <st in an HTML field it shows known tags for autocompletion: For my templating engine TYPO3 Fluid i need to add custom tags (like <f:for each="" as=""></f:for> ). How can i do this? Regular snippets are not enough here as long as they don't show up in the nice typeahead. 回答1: Contrary to what was posted in the comments, there is a very straightforward way of doing this using a custom .sublime-completions file for HTML. These files are great because not only can you just

How do you set the default file extension for a syntax in Sublime Text 3?

那年仲夏 提交于 2019-12-10 16:31:27
问题 I'm not asking about associating a syntax with a file extension, but about associating a file extension with a syntax. That is, setting the file extension suggested in the save file dialog after you create a new file, then set the syntax, then hit save. You can change the extension in the save dialog, but it would be better not to have to do that every time. 回答1: For saving plain text files with a .txt extension by default, you can achieve this with a small plugin: import sublime import

Sublime Text 3 Python Interactive Console? [duplicate]

断了今生、忘了曾经 提交于 2019-12-10 14:58:06
问题 This question already has an answer here : Issue with Sublime Text 3's build system - can't get input from running program [duplicate] (1 answer) Closed 3 years ago . I have been using a lot of sublime text 3 to write python. However, whenever a program I make needs user input, nothing happens. For example: number = input("What is your favorite number?: ") print(number) This simply gives me the input prompt in the console, but anything that I type is ignored. The print(number) is never run.

mongo --shell file.js and “use” statement

大兔子大兔子 提交于 2019-12-10 14:52:48
问题 can't find solution for simple question: I have file text.js use somedb db.somecollection.findOne() When I run this file in cmd with redirection command from file: "mongo < text.js" it's work properly But when I try this way "mongo text.js" or "mongo --shell test.js" I got this error message MongoDB shell version: 2.2.0 connecting to: test type "help" for help Wed Dec 05 16:05:21 SyntaxError: missing ; before statement pathToFile \test.js.js:1 failed to load: pathToFile \test.js.js It's fail

visual studio 2015 sublime theme

北城余情 提交于 2019-12-10 14:15:03
问题 Is there Sublime theme for Visual Studio 2015? For example for Visual Studio 2015 Color Theme Editor . Themes from Studio Styles not correct working with Visual Studio 2015. 回答1: The default color scheme of Sublime Text is Monokai by Wimer Hazenberg and I bet there are several attempts of porting it to Visual Studio. I'm not sure whether there's a full theme, since Sublime Text has very little of a UI that could be ported. Here are several that I found online: You can build Monokai (and other

Sublime Text: How to hide all code and show only comments

牧云@^-^@ 提交于 2019-12-10 13:19:49
问题 Lets say we have code like this: //description 1 code block 1 { .. .. } //description 2 code block 2 { .. .. } In sublime text, how to show only the comments and hide all the code? 回答1: In a code like the one you've used as example, you can just "Fold All" the code. Set the cursor outside any function then: Ctrl + K + Ctrl + 1 then you'll see only the comments and the function/struct signiatures (hidding the body). 来源: https://stackoverflow.com/questions/18265047/sublime-text-how-to-hide-all

Boundary sensitive Ctrl+D in Sublime Text 3(windows)

℡╲_俬逩灬. 提交于 2019-12-10 10:45:33
问题 I have same requirement with maček I borrow maček's example here: my code pic1 : I select the first instance of es and see this (using cursor select) pic2 : Perfect! However, when I tap ctrl + D a couple times, it will end up selecting this pic3 : The answer from Taylan says If you put your cursor (caret) on the word but not select it and then press Cmd + d it is going to select like in 2nd image. Quite confusing. In windows, there is always a input cursor (a flashing vertical line, maybe

Sublime code folding of comments (as in Ace)

爱⌒轻易说出口 提交于 2019-12-10 10:35:08
问题 In Cloud9 (based on the Ace editor) I can define arbitrary code folding regions within comments, for example: // Descriptor { function() { // Code } // } Folds to: // Descriptor {<->} Try it here to see what I mean. Is there an existing way to replicate this in Sublime? 回答1: Select the block of code and Hit "Ctrl + Shift + [" to fold. To unfold place pointer before the folded block and hit "Ctrl + Shift + ]" here's an youtube video link: https://www.youtube.com/watch?v=80UUPMUAP-g 回答2: From

How to enable sublime text to take first line as file name while saving?

自古美人都是妖i 提交于 2019-12-10 10:33:33
问题 Earlier the Sublime used to take first line as file name by default but now it's "untitled". Is there a way to enable it or is there a plugin for that? Thanks 回答1: The first line is only used as the file name for unsaved files when the syntax is set to Plain Text. As soon as you change the syntax highlighting and type something, it will change the tab name to "untitled". The implementation for this is in the Default package, set_unsaved_view_name.py file. To get it to work for all syntaxes: