Sublime Text 2에 대한 Sass 지원?
Sublime Text 2 에서 Sass 를 편집하기위한 기존 패키지가 있습니까?
이것은 인기있는 것 같습니다 : https://github.com/n00ge/sublime-text-haml-sass
그러나 설치 후에는 scss
파일에 대한 구문 강조 만 제공하는 것으로 보입니다 .
이상적으로는 구문 강조 표시, 들여 쓰기 및 sass
구문 완성을 원합니다 .
SASS / SCSS와 호환되는 놀라운 코드 완성을 위해서만 https://github.com/nathos/sass-textmate-bundle을 사용하는 것이 좋습니다 .
패키지에 대한 의심, 그리고 가정에서 당신이 놀라운 숭고한 사용할 때마다 패키지 제어를 그냥 사용 패키지 목록 , 유형 뭔가를 (결과는 설치 수에 의해 정렬됩니다), 일반적으로 가장 인기 하나는 최고의 하나입니다.
scss 파일에서만 작동하는 이유는 Ruby HAML 강조 표시 설정이 sass 강조 표시를 재정의하기 때문입니다.
고토 Preferences
>Browse Packages...
폴더 Ruby Haml.tmLanguage
내에서 찾기 및 열기Rails
fileTypes를 다음에서 변경하십시오.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>fileTypes</key>
<array>
<string>haml</string>
<string>sass</string> <!-- This line is causing the problem -->
</array>
<key>foldingStartMarker</key>
<string>^\s*([-%#\:\.\w\=].*)\s$</string>
<key>foldingStopMarker</key>
<string>^\s*$</string>
...
에:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>fileTypes</key>
<array>
<string>haml</string>
</array>
<key>foldingStartMarker</key>
<string>^\s*([-%#\:\.\w\=].*)\s$</string>
<key>foldingStopMarker</key>
<string>^\s*$</string>
...
이제 설치 한 SASS 강조 표시 패키지가 제대로 작동합니다.
나는 최근에 이것에 대한 블로그 게시물을 작성했습니다 : How to Add SASS Support to Sublime Text .
다음은 간단한 요약입니다.
- 구문 강조를 얻으려면 단순히 패키지 제어에서 호출 되는 sass-textmate-bundle 플러그인을 설치하십시오
Sass
. 당신은 찾을sass
파일이 제대로 기본적으로 강조되지 않지만 포스트 I 세부에서 두 번째 수정 고상의 기본 플러그인 중 하나를 해킹 포함되지 않습니다. - SASS Build 플러그인 을 설치하여 Sublime에서 빌드
sass
및scss
파일 을 활성화 합니다. - 파일에 변경 사항을 저장할 때마다 자동으로 빌드를 실행하는 SublimeOnSaveBuild 플러그인을 추가 합니다.
자세한 내용 은 블로그 게시물 을 확인 하세요.
이 기사 와 관련하여 :
- sass-textmate-bundle 플러그인 설치
- sass 파일 열기
- click View | Syntax | Open all with current extension as … | Sass
If a package conflict is causing trouble ( like the Haml issue ) and you need to edit / override a package like removing the <string>sass</string>
part from the Ruby HAML
file, then I would highly recommend the Package Resource Viewer (and editor) plugin.
- Install
PackageResourceViewer
- Use the palette to do
PackageResourceViewer: Open Resource
:
- Select
Rails
thenRuby Haml.tmLanguage
: - Comment out the offending line:
Save the file ( this is the awesome part, because the
PackageResourceViewer
automatically saves just the overridden part automatically to the correct place.Done.
Now go and tweak all the little settings / defaults in the other packages that have been annoying you.
I ran into the problem of https://github.com/n00ge/sublime-text-haml-sass not recognizing Rails default .css.sass
files because of the extra .css
extension. I agree with Maxime above that using https://github.com/seaofclouds/sass-textmate-bundle is a better option and that installing via the package control is ideal http://wbond.net/sublime_packages/package_control. The way to fix the .css.sass extension not being recognized is to edit the Sass package directly. Go to Sublime Text 2 > Preferences > Browse Packages
and edit the Sass\Syntaxes\Sass.tmLanguage
file. Add <string>css.sass</string>
to the <array>
block.
<key>fileTypes</key>
<array>
<string>sass</string>
<string>css.sass</string>
<string>scss</string>
</array>
참고URL : https://stackoverflow.com/questions/11309185/sass-support-for-sublime-text-2
'programing' 카테고리의 다른 글
자리 표시 자와 대체 개체를 사용하여 JavaScript 문자열 형식을 지정 하시겠습니까? (0) | 2020.11.10 |
---|---|
요소 번호가있는 PostgreSQL unnest () (0) | 2020.11.10 |
margin-top 작동하지 않음 clear : both (0) | 2020.11.08 |
내 장고 관리 사이트에 CSS 스타일이없는 이유 (0) | 2020.11.08 |
주어진 파일에 대한 변경 사항을 포함하는 Git 브랜치 찾기 (0) | 2020.11.08 |