sublimetext

Automatically convert indentation from 2 to 4 spaces in Sublime Text 3

别说谁变了你拦得住时间么 提交于 2021-02-10 18:23:01
问题 There are a few topics about auto-conversion of the indentation in Sublime Text, but I didn't find the way to do it automatically. Many files I download have indentation of 2, which I hate, so I want to convert them to 4. What I do is: Select Tab size: 2 Convert indentation to Tabs Select Tab size: 4 Convert indentation to Spaces I don't think I need to mention that it's too much work for every single file. Some people suggest Reindent option, but for my experience, it almost never works

Convert - -(double dash) to -> automatically in SublimeText 3

社会主义新天地 提交于 2021-02-08 12:02:29
问题 During my work I use -> many times and on a hungarian keyboard there is no dedicated > button, so I have to use 3 keys to enter this and sometimes I also misstype. Is there a way to convert -- (double dash) automatically a ->? Snippet is not so good because it requires a TAB to convert. Thanks 回答1: It's possible to do this with a simple key binding such as the following: { "keys": ["-", "-"], "command": "insert", "args": { "characters": "->" }, }, Now when you type -- as soon as you hit the

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

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

“Import Statistics” Fails To Run

冷暖自知 提交于 2021-01-28 09:26:33
问题 When I use IDLE the code "import statistics" runs, however when I use sublimetext while other packages, such as matplotlib, can be imported I cannot import the statistics module. It gives me this error code: import math import matplotlib import statistics I expect nothing to happen on the screen, but in the command line it spits out. Note that the first two lines of code did work. ImportError: No module named statistics [Finished in 1.2s with exit code 1] [shell_cmd: python -u "/Users/Ivan

Auto-run a command on saving in Sublime Text

别说谁变了你拦得住时间么 提交于 2021-01-28 05:42:34
问题 Is it possible to run eslint automatically when I save either a .js or .jsx file in Sublime Text? I'm using the ESLint sublime package right now but I have to manually run it each time using Cmd + Option + e . Thanks! 回答1: Yes this can be done with a simple event driven plugin like the one I've written below. The plugin has been tested but not with the eslint command since I did not want to install that package. Clearly any command could be run instead of eslint in the plugin's run_command(

PHP's HERE Doc (EOT) syntax highlighting discrepancy with forward slash on Sublime Text 3

不打扰是莪最后的温柔 提交于 2021-01-28 02:27:08
问题 I am unfamiliar with how Sublime Text 3 uses syntax highlighting, as in, if it purely relies on the theme or has it's built in standard that themes run off of but in my case, there's some syntax highlighting discrepancy with using PHP's HERE docs and forward slashes. Once a forward slash is present, it appears ST3 thinks all the following code is apart of that tag. Is this something I can fix? Forward slash syntax highlighting discrepancy No forward slash and correct syntax highlighting 回答1:

PHP's HERE Doc (EOT) syntax highlighting discrepancy with forward slash on Sublime Text 3

雨燕双飞 提交于 2021-01-27 22:51:03
问题 I am unfamiliar with how Sublime Text 3 uses syntax highlighting, as in, if it purely relies on the theme or has it's built in standard that themes run off of but in my case, there's some syntax highlighting discrepancy with using PHP's HERE docs and forward slashes. Once a forward slash is present, it appears ST3 thinks all the following code is apart of that tag. Is this something I can fix? Forward slash syntax highlighting discrepancy No forward slash and correct syntax highlighting 回答1:

Sublime Text Indentation Settings Being Overwritten By a File

我们两清 提交于 2021-01-27 04:23:11
问题 I am working on a project where tab size is supposed to be 4 and tabs should not be spaces. I updated my Preferences.sublime-settings file to include "detect_indentation": "false", "tab_size": 4, "translate_tabs_to_spaces": false, When I open a new file these settings are set to how I want and everything works. However, if I open an existing file (scss or html) that has indentations as 2 spaces, my Sublime settings are overwritten and indentations change to 2 spaces. If I click View >