Coder Social home page Coder Social logo

sindresorhus / editorconfig-sublime Goto Github PK

View Code? Open in Web Editor NEW
1.8K 35.0 108.0 73 KB

Sublime Text plugin for EditorConfig - Helps developers maintain consistent coding styles between different editors

License: MIT License

Python 100.00%
sublime-package sublime-text-plugin sublime-text editorconfig python

editorconfig-sublime's Introduction

EditorConfig

EditorConfig helps developers maintain consistent coding styles between different editors

Install

Install EditorConfig with Package Control and restart Sublime.

Getting started

See the EditorConfig site for documentation.

Supported properties

  • root
  • indent_style
  • indent_size
  • end_of_line
  • charset
  • trim_trailing_whitespace
  • insert_final_newline

Explanation of the properties can be found on the EditorConfig site.

The tab_width property is intentionally not supported.

Example file

My recommended default settings

root = true

[*]
indent_style = tab
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

Tips

EditorConfig snippet

If you can't remember all settings managed by the EditorConfig file, you'll love the editorconfig snippet.

Just type editorconfig + tab, and your editor will focus on the first setting's value (indent_style = lf). You can change the value, if you want, and jump to the next setting's value by hitting tab and so on. Settings are somewhat autocompleted, and if you don't remember all possible values, simply remove the setting value to see them all as a comment.

You can be in a context where editorconfig + tab trigger another snippet. In that case, simply use Goto anywhere (Ctrl + P on Linux/Windows or + P on macOS), type editorconfig, select Snippet: editorconfig and hit Enter.

View active config

The active config is printed in the Sublime console.

Trailing whitespace

Even though there is a trim_trailing_whitespace property. I would still recommend you set "draw_white_space": "all" and/or "trim_trailing_white_space_on_save": true in your Sublime settings to prevent you from accidentally committing whitespace garbage whenever a project is missing a .editorconfig file.

editorconfig-sublime's People

Contributors

andig avatar coliff avatar deathaxe avatar ifdattic avatar ismell avatar jfcherng avatar jwortmann avatar kipit avatar ktrotter-emsi avatar kubo2 avatar kzvi avatar mercurykd avatar oker1 avatar sindresorhus avatar timgates42 avatar treyhunner avatar vogu66 avatar xaka avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

editorconfig-sublime's Issues

Scroll position moves on save

A recent update added a bug that causes the editor to scroll up 1 line every time the editor is saved. I think 2e68c0c is causing it because I'm pretty sure this wasn't happening last week.

I'm using Sublime Text 3 on Mac OSX 10.9 / Ubuntu 13.10.

Cannot make it work

I am used to work with an .editorconfig file at the root of my projects and this one works great with phpstorm. But for some reasons I cannot make it work with Sublime.
I tried this package installation with the console and manually but no change : Sublime just use his default settings for indentation.
https://sublime.wbond.net/installation#st2

Any idea what I should check ??

Rules for files in subdirectory doesn't apply

Hi,
In ST3, it seems rules for files in subdirectories are not working.

Here is my .editorconfig file (full path: C:\gR\forge-config-mgt\.editorconfig) :

root = true
[*]
indent_style = tab
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.yml]
indent_style = space
indent_size = 2

[host_vars/*]
indent_style = space
indent_size = 2

[group_vars/*]
indent_style = space
indent_size = 2

When i create a file named testinto subdirectory host_vars, rules are not applied. Console output:

EditorConfig
C:\gR\forge-config-mgt\host_vars\test
{'charset': 'utf-8',
 'end_of_line': 'lf',
 'indent_size': '4',
 'indent_style': 'tab',
 'insert_final_newline': 'true',
 'tab_width': '4',
 'trim_trailing_whitespace': 'true'}

Combine ST2 and ST3 version

Beforehand I thought it would require radical changes to upgrade it to PY3 and ST3, but it turned out not to. Don't see any reason why they can't be combined into one version for easier maintenance.

@dotcypress interested?

[Feature request] Disable EditorConfig settings in console output

1. Summary

I don't want to see EditorConfig settings in my console output. I don't need it.

2. Expected behavior

No EditorConfig settings in my console output.

3. Actual behavior

Example of my console output.

Click here to see full output.
key evt: control+p
command: show_overlay {"overlay": "goto", "show_files": true}
chr evt: o (0x6f)
chr evt: i (0x69)
chr evt: p (0x70)
key evt: backspace
command: hungry_backspace
key evt: backspace
command: hungry_backspace
chr evt: p (0x70)
chr evt: e (0x65)
chr evt: n (0x6e)

EditorConfig
D:\Поиск Кристиниты\opensearch.xml
{'charset': 'utf-8',
 'end_of_line': 'lf',
 'indent_size': '4',
 'indent_style': 'tab',
 'insert_final_newline': 'true',
 'tab_width': '4',
 'trim_trailing_whitespace': 'true'}

SublimeLinter: xmllint activated: C:\strawberry\c\bin\xmllint.exe 
SublimeLinter: sublimesyntax activated: <builtin> 
FuzzyFilePath cached 791 files in D:/Поиск Кристиниты
key evt: shift+control+p
command: show_overlay {"overlay": "command_palette"}
Init webFont
_download_font_info
chr evt: e (0x65)
chr evt: x (0x78)
chr evt: a (0x61)
chr evt: l (0x6c)
chr evt: t (0x74)
command: exalt_format_document
command: drag_select {"event": {"button": 1, "x": 267.5, "y": 106.5}}
command: word_highlight_click {"event": {"button": 1, "x": 267.5, "y": 106.5}}
command: drag_select {"event": {"button": 1, "x": 81.5, "y": 62.5}}
command: word_highlight_click {"event": {"button": 1, "x": 81.5, "y": 62.5}}
command: drag_select {"event": {"button": 1, "x": 297.5, "y": 452.5}}
command: word_highlight_click {"event": {"button": 1, "x": 297.5, "y": 455.5}}
15:25:44 INFO  requests.packages.urllib3.connectionpool:805            _new_conn() Starting new HTTPS connection (1): codestats.net
key evt: control+z
command: undo
15:25:46 DEBUG requests.packages.urllib3.connectionpool:401        _make_request() "POST /api/my/pulses/ HTTP/1.1" 201 23
key evt: shift+control+z
command: redo
key evt: control+z
command: undo
15:25:56 INFO  requests.packages.urllib3.connectionpool:805            _new_conn() Starting new HTTPS connection (1): codestats.net
15:25:56 DEBUG requests.packages.urllib3.connectionpool:401        _make_request() "POST /api/my/pulses/ HTTP/1.1" 201 23
command: drag_select {"event": {"button": 1, "x": 613.5, "y": 479.5}}
command: word_highlight_click {"event": {"button": 1, "x": 613.5, "y": 479.5}}
key evt: control+p
command: show_overlay {"overlay": "goto", "show_files": true}
chr evt: S (0x53)
chr evt: a (0x61)
chr evt: s (0x73)
chr evt: h (0x68)
chr evt: t (0x74)
key evt: backspace
command: hungry_backspace
chr evt: a (0x61)
no such context .repository in Packages/stposh/Support/PowerShell.tmLanguage
no such context .repository in Packages/stposh/Support/PowerShell.tmLanguage
no such context .repository in Packages/stposh/Support/PowerShell.tmLanguage
no such context .repository in Packages/stposh/Support/PowerShell.tmLanguage
chr evt: S (0x53)
key evt: up
command: move {"by": "lines", "forward": false}
key evt: up
command: move {"by": "lines", "forward": false}
key evt: up
command: move {"by": "lines", "forward": false}

EditorConfig
D:\Sublime Text 3\Data\Packages\SashaSublime\SashaSublime.tmTheme
{'charset': 'utf-8',
 'end_of_line': 'lf',
 'indent_size': '4',
 'indent_style': 'tab',
 'insert_final_newline': 'true',
 'tab_width': '4',
 'trim_trailing_whitespace': 'true'}

FuzzyFilePath cached 277 files in D:/Sublime Text 3/Data/Packages/SashaSublime
key evt: shift+control+p
command: show_overlay {"overlay": "command_palette"}
command: drag_select {"event": {"button": 1, "x": 618.5, "y": 480.5}}
command: word_highlight_click {"event": {"button": 1, "x": 618.5, "y": 478.5}}
key evt: alt+b
command: bang_search_input {}
chr evt: p (0x70)
chr evt: c (0x63)

I don't want to see in my console:

EditorConfig
D:\Поиск Кристиниты\opensearch.xml
{'charset': 'utf-8',
 'end_of_line': 'lf',
 'indent_size': '4',
 'indent_style': 'tab',
 'insert_final_newline': 'true',
 'tab_width': '4',
 'trim_trailing_whitespace': 'true'}

4. Steps to reproduce

The problem is reproduced for me in a version of Sublime Text without plugins and user settings.

I install and set EditorConfig → I restart Sublime Text → periodically I get in my console messages with my EditorConfig settings.

5. Environment

Operating system and version:
Windows 10 Enterprise LTSB 64-bit EN
Sublime Text:
Build 3126

Thanks.

insert_final_newline = false | not working

From the docs:

insert_final_newline: set to "true" ensure file ends with a newline when saving
and "false" to _ensure it doesn't_.

As I understand this, it should remove final newlines if present. That doesn't happen.

Update editorconfig-core-py

Please update editorconfig-core-py and release new version to Package Control.

They fix one critical for me bug in fnmatch.py

Sublime text 3?

Im trying to install this in sublime 3, yet when I enter "EditorConfg" in the install package search, it shows nothing?

Files get edited when preview

When previewing a file in command palette (Ctrl-P) without opening it, it seems that when the file doesn't conform to some editorconfig rules, it would directly pop open the file and indicating that the file is edited.

Can I have the file modified only when I open it up and save?

In my case when I config end_of_line = lf but preview a file with crlf line end, it would pop open and edited the file's line end.

Indentation settings ignored on ST3

I have this rule in my .editorconfig:

[{composer.json}]
indent_style = space
indent_size = 2

Yet, when saving composer.json indentation is always converted back to tabs.

[Feature Request] Bulk format

A command to bulk apply editorconfig on all files in the project (or in a specified folder), instead of having to open each file and save manually for editorconfig to apply.

Automatic .editorconfig generation

Would be awesome if the plugin could generate an .editorconfig file from the users current settings. That would also make it less scary/hard to get started with it.

PR welcome :)

Error occurred while getting EditorConfig properties

The console is showing an error:
Error occurred while getting EditorConfig properties

my .editorconfig:

# editorconfig.org
# configuration used by Jeff Shields
# July 26, 2015

root = true

[*]
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
indent_size = 4
indent_style = space

[*.{markdown,md,todo}]
trim_trailing_whitespace = false

[**.js]
indent_style = tab

// cms builder has its own format
[cmsb/**.php]
indent_size = 2
end_of_line = crlf

[package.json]
# The indent size used in the `package.json` file cannot be changed
# https://github.com/npm/npm/pull/3180#issuecomment-16336516
indent_size = 2
indent_style = space

[*.py]
indent_size = 4

I have no idea what the error could be and none of the rules are being applied

TypeError: unhashable type: 'dict',when i install editorconfig plugin in sublime text3

When I install editorconfig plugin in sublime text3, it doesn't work.

I found the console log is
TypeError: unhashable type: 'dict'

environment
mac os 10.12.1 python 2.7.10 sublime Text3 build 3126

details logs

Traceback (most recent call last):File "package_control.package_installer in /Users/zsr/Library/Application Support/Sublime Text 3/Installed Packages/Package Control.sublime-package", line 154, in on_doneFile "package_control.package_disabler in /Users/zsr/Library/Application Support/Sublime Text 3/Installed Packages/Package Control.sublime-package", line 144, in disable_packages File "package_control.settings in /Users/zsr/Library/Application Support/Sublime Text 3/Installed Packages/Package Control.sublime-package", line 72, in save_list_setting TypeError: unhashable type: 'dict' reloading settings Packages/User/Package Control.sublime-settings

I don't know what happened,is the plugin's problem or myself?

Enforce EditorConfig settings for newly created files

Not sure if this is under plugin's control but here's the issue anyway.

I have a project (saved as a .sublime-project) with an .editorconfig file in its root directory with the following contents:

# This file is for unifying the coding style for different editors and IDEs
# editorconfig.org
root = true

[*]
indent_style = tab
tab_width = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

However, I also have "translate_tabs_to_spaces": true (my default preference) which always forces spaces in the new files that I create, even if I have a project with indent_style = tab currently open in ST2 window. Is there a way editorconfig-sublime can override whitespace settings for new files that get saved in project directory so that .editorconfig is always respected?

Indentation mix spaces and tabs

I set "indent_style" to "space", and then if a indentation mixed some tabs in spaces, these tabs won't be converted to spaces when save the file.

Notification when opening a file that has incorrect line endings

Again, another idea taken from https://github.com/SublimeText/LineEndings

Use case...

I'm about to do some hacking on a repo with LF endings (on Windows). Somehow, a file sneaks in with CRLF endings. When I open that file, I want to know right away that I should save / commit this file, so that when I start making real commits, they don't get lost in whitespace noise.

I already get a bit of this by using Modific which supports gutter marks for file changes... but it might be nice to totally get the Gong up-front.

SublimeText is worst code editor ever

cant provide suggestions, cant suggest code even though you just typed variable 3 times it shows it last in suggest box, cant autocomplete i hate it

Does this work with Sublime Text 3?

I have installed the latest version of the plugin and can see it being reloaded in the console, but it seems that my .editorconfig file isn't being applied as I have a mix of tabs and spaces in files.

Does not delete all end of lines if there are duplicates

For example in the screen capture below you see that there are duplicate empty lines. This plugin will not remove all end of lines at the end of the document when saved.

I'm not sure if this is actually a feature, but to me it seems like a bug.

capture

Error after install

This is what the console tells me after install:

EditorConfig
Traceback (most recent call last):
File "C:\Program Files\Sublime Text 3\sublime_plugin.py", line 303, in on_activated
callback.on_activated(v)
File "EditorConfig in C:\Users\a25058\AppData\Roaming\Sublime Text 3\Installed Packages\EditorConfig.sublime-package", line 37, in on_activated
File "EditorConfig in C:\Users\a25058\AppData\Roaming\Sublime Text 3\Installed Packages\EditorConfig.sublime-package", line 59, in init
File "EditorConfig in C:\Users\a25058\AppData\Roaming\Sublime Text 3\Installed Packages\EditorConfig.sublime-package", line 7, in unexpanduser
File "X/re.py", line 170, in sub
File "X/functools.py", line 258, in wrapper
File "X/re.py", line 274, in _compile
File "X/sre_compile.py", line 493, in compile
File "X/sre_parse.py", line 724, in parse
File "X/sre_parse.py", line 347, in _parse_sub
File "X/sre_parse.py", line 694, in _parse
File "X/sre_parse.py", line 338, in _escape
sre_constants.error: bogus escape: '\U'

Digging into the package I can see that the username is the problem:

import re
re.search(r'c:\Users\foo', '~')

gives an error. Instead, in the unexpanduser(path) function the \ path separators need conversion to \\ first. The following does not throw the error:

re.search(r'c:\\Users\\foo', '~')

Breaks git commit -v (git commit --verbose)

Issuehunt badges

According to the documentation for git-commit (emphasis mine)

-v
--verbose
Show unified diff between the HEAD commit and what would be committed at the bottom of the commit message template to help the user describe the commit by reminding what changes the commit has. Note that this diff output doesn’t have its lines prefixed with #. This diff will not be a part of the commit message.

Git is apparently able to ignore the diff block thanks to a marker preceding it, which looks like this:

# ------------------------ >8 ------------------------
# Do not touch the line above.
# Everything below will be removed.
#

Today I've discovered that the plugin causes the full diff to be included in the commit message (disabling/uninstalling it fixes the problem.) I'm assuming it must be messing with the "Do not touch the line above." line, causing Git to get confused.

I could add a [COMMIT_EDITMSG] section to my .editorconfig file to try and have this file left alone, but this feels hackish. Furthermore, adding this to every repository would get tiresome.

I wonder if there is a more elegant solution to this. git commit -v is just too good to give up!

In case it matters, this is my .editorconfig file:

root = true

[*]
end_of_line = crlf
indent_size = 4
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

IssueHunt Summary

vogu66 vogu66 has been rewarded.

Backers (Total: $40.00)

Submitted pull Requests


Tips

override for specific directory/files not working

Maybe I'm missing something here so sorry if it's me and not an issue.

My .editorconfig (only one in root of laravel project

# editorconfig.org
root = true

[*.php]
indent_style = tab
indent_size = 1
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[resources/views/**.php]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.js, *.css, *.html]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false

Console output:

D:\projects\larabook4\resources\views\pages\home.blade.php
OrderedDict([(u'indent_style', u'tab'), (u'indent_size', u'1'), (u'end_of_line', u'lf'), (u'charset', u'utf-8'), (u'trim_trailing_whitespace', u'true'), (u'insert_final_newline', u'true'), ('tab_width', u'1')])

I want views (blade.php) to use the same style as html files.

I've tried

[*.blade.php]
[resources/views/**.php]
[resources/views/**.blade.php]

But the settings for .php are applied to them instead of the override.

Sublime Text 3 running on Windows 8

After installing the ST3 version of EditorConfig I still can't get the plugin to work with ST3 version 3047 on Windows 8 Pro.

Has anyone else gotten EditorConfig to working in this environment? Maybe I am just missing something.

Plugin seems to ignore language-specific indent settings for makefile, auto-converting tabs to spaces

Hi. First, the plugin is super-helpful. Thank you very much for it.

For the first time ever, I seem to be encountering a defect, however. Either that, or I'm totally misreading my docs and config format.

I've got a makefile, where the tabs are significant. But, editorconfig seems to be the culprit in converting all my tabs back to spaces every time I save. So, i use the "Convert Indentation to Tabs" command to put it back. Which works. Then I save... and it's spaces again.

(Is auto-converting indents on save a feature of editorconfig, or some other plugin that's interacting with it?)

Notably, when I go into .editorconfig and convert the default indent_style to tab, then try to save my makefile again, it's fine.

Here's my project's .editorconfig, with make-specific overrides at bottom:

# http://editorconfig.org

# A special property that should be specified at the top of the file outside of
# any sections. Set to true to stop .editor config file search on current file
root = true

[*]
# Indentation style
# Possible values - tab, space
indent_style = space

# Indentation size in single-spaced characters
# Possible values - an integer, tab
indent_size = 2

# Line ending file format
# Possible values - lf, crlf, cr
end_of_line = lf

# File character encoding
# Possible values - latin1, utf-8, utf-16be, utf-16le
charset = utf-8

# Denotes whether to trim whitespace at the end of lines
# Possible values - true, false
trim_trailing_whitespace = true

# Denotes whether file should end with a newline
# Possible values - true, false
insert_final_newline = true

[Makefile]
# Indentation style
# Possible values - tab, space
indent_style = tab

And here are the Sublime syntax-specific settings:

{
  "translate_tabs_to_spaces": false,
}

Am I reading this right, or just overlooking a configuration detail? Thanks!

Enforce Styles on Save? ST3?

A few of these issues seem to indicate that this plugin should enforce a .editorconfig's rules on a file when that file is saved, but I have a JS file with 2-space indentation that I want to convert to 4-space indentation and saving, opening, etc. the file isn't doing anything. Am I misinterpreting what this plugin is supposed to do? SublimeText 3, Build 3059 on Mac OS X 10.9.4. Here's my .editorconfig:

# editorconfig.org
root = true

[*]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.json]
indent_size = 2

[*.md]
trim_trailing_whitespace = false

… and here's my ST3 console (I don't know if this is actually useful):

startup, version: 3059 osx x64 channel: stable
executable: /Applications/Sublime Text.app/Contents/MacOS/Sublime Text
working dir: /
packages path: /Users/matthayes/Library/Application Support/Sublime Text 3/Packages
state path: /Users/matthayes/Library/Application Support/Sublime Text 3/Local
hardware concurrency: 8
zip path: /Applications/Sublime Text.app/Contents/MacOS/Packages
zip path: /Users/matthayes/Library/Application Support/Sublime Text 3/Installed Packages
found 14 files for base name Default.sublime-keymap
found 1 files for base name Default.sublime-mousemap
found 13 files for base name Main.sublime-menu
loading bindings
loading pointer bindings
found 1 files for base name Spacegray Light.sublime-theme
theme loaded
app ready
wrote startup cache, added files: 7 orphaned files: 0 total files: 158 cache hits: 151
pre session restore time: 0.279394
using gpu buffer for window
using gamma: 2 (err: 6.9282)
first paint time: 0.60469
startup time: 0.676102
using gpu buffer for window
launching: /Applications/Sublime Text.app/Contents/MacOS/plugin_host
loaded 1319 snippets
reloading plugin Default.block
reloading plugin Default.comment
reloading plugin Default.copy_path
reloading plugin Default.delete_word
reloading plugin Default.detect_indentation
reloading plugin Default.duplicate_line
reloading plugin Default.echo
reloading plugin Default.exec
reloading plugin Default.fold
reloading plugin Default.font
reloading plugin Default.goto_line
reloading plugin Default.history_list
reloading plugin Default.indentation
reloading plugin Default.kill_ring
reloading plugin Default.mark
reloading plugin Default.new_templates
reloading plugin Default.open_file_settings
reloading plugin Default.open_in_browser
reloading plugin Default.pane
reloading plugin Default.paragraph
reloading plugin Default.paste_from_history
reloading plugin Default.save_on_focus_lost
reloading plugin Default.scroll
reloading plugin Default.set_unsaved_view_name
reloading plugin Default.side_bar
reloading plugin Default.sort
reloading plugin Default.swap_line
reloading plugin Default.switch_file
reloading plugin Default.symbol
reloading plugin Default.transform
reloading plugin Default.transpose
reloading plugin Default.trim_trailing_white_space
reloading plugin CSS.css_completions
reloading plugin Diff.diff
reloading plugin HTML.encode_html_entities
reloading plugin HTML.html_completions
reloading plugin AdvancedNewFile.AdvancedNewFile
reloading plugin DocBlockr.__init__
reloading plugin DocBlockr.jsdocs
reloading plugin EditorConfig.EditorConfig
reloading plugin Emmet.emmet-plugin
reloading plugin Markdown Preview.helper
reloading plugin Markdown Preview.markdown_settings
reloading plugin Markdown Preview.markdown_wrapper
reloading plugin Markdown Preview.MarkdownPreview
reloading plugin Minifier.Minify
reloading plugin Package Control.Package Control
reloading plugin Pretty JSON.PrettyJson
[Errno 2] No such file or directory: 'jq'
reloading plugin SideBarEnhancements.Edit
reloading plugin SideBarEnhancements.SideBar
reloading plugin SideBarEnhancements.SideBarDefaultDisable
reloading plugin SideBarEnhancements.StatusBarFileSize
reloading plugin SideBarEnhancements.StatusBarModifiedTime
reloading plugin SublimeLinter-csslint.linter
SublimeLinter: csslint linter loaded 
reloading plugin SublimeLinter-jshint.linter
SublimeLinter: jshint linter loaded 
reloading plugin SublimeLinter-json.linter
SublimeLinter: json linter loaded 
reloading plugin TrailingSpaces.trailing_spaces
reloading plugin CSScomb JS.CSScomb
reloading plugin SFTP.SFTP
reloading plugin SublimeLinter.commands
reloading plugin SublimeLinter.sublimelinter
plugins loaded
SublimeLinter: debug mode: off 
found 13 files for base name Main.sublime-menu
PyV8: Creating new thread
Emmet: Creating thread
Emmet: Loading https://api.github.com/repos/emmetio/pyv8-binaries/contents
Emmet: You have the most recent PyV8 binary
Package Control: No updated packages
SublimeLinter: Using an unsupported shell: sh 
SublimeLinter: jshint activated: /usr/local/bin/jshint 
Writing file /Users/matthayes/path/to/project/gulpfile.js with encoding UTF-8 (atomic)

Plugin should respect current file settings

The current window setting should supersede the settings in .editorconfig

Let's say .editorconfig says to indent using spaces. When I edit a file and uncheck 'Indent Using Spaces' in the UI:


And Convert Indentation to Tabs:

Upon save it uses the .editorconfig settings instead of the UI setting I just set before saving to disk, and then reverts it:

This forces me to temporarily disable the plugin or edit my .editorconfig just to save a file with a non-normal indentation configuration.

Defaults for files without an .editorconfig file

Editorconfig seems to be overriding my user preferences for new files with no .editorconfig file. In my Sublime preferences, I have

"tab_size": 2,
"translate_tabs_to_spaces": true

and yet new files start out with 4 spaces set as their default.

Is there any way to set this default within Editorconfig? I don't see any preferences under Preferences -> Package Settings.

ST3 doesn't respect .editorconfig settings

It seems my .editorconfig file has no effect on how ST3 wants to handle indentation. For example, even in a file where the indentation is clearly tabs, ST3 still thinks I'm using spaces to indent.

Edit: I wish I could provide more information off-the-bat, but this plugin seems like it should be very simple so I'm not sure what to look for that might affect this issue. Am I right in assuming that EditorConfig will override ST3's default indentation preferences on a per-directory basis?

trim_trailing_whitespace = true not working

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
insert_final_newline = true
trim_trailing_whitespace = true
draw_white_space = true
trim_trailing_white_space_on_save = true

cannot exclude files

Hi,

I try to display only js files in the left panel but it does not work

all files are showing up in the left folders panel

# top-most EditorConfig file
root = true

# try to only edit these files
[{/*.js}]
charset = utf-8
indent_style = space
indent_size = 4
insert_final_newline = true
trim_trailing_whitespace = true

sublime text can do it via it's config but I want it to be different from one project to another

"file_exclude_patterns":
[
  "*.anyextension"
],

thanks

Multiple string matching + wildcards failing

I have an editorconfig that tries to make use of the multiple-string matching to keep things simple, but also wildcards:

[*]
end_of_line = CRLF
indent_style = tab

[{*.html,*.cshtml}]
indent_style = space
indent_size = 4

This seems to work in the Visual Studio plugin but not in Sublime Text 3 (registered).

When I open a .html file and look in the Sublime console I see the dictionary of settings and it only includes the ones from the [*] match.

However, if I change the file to:

[*]
end_of_line = CRLF
indent_style = tab

[*.cshtml]
indent_style = space
indent_size = 4

[*.html]
indent_style = space
indent_size = 4

Then my settings are correctly applied in both Sublime and Visual Studio.

Am I misusing the multi-string match function?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.