- RachelScodes / init.coffee
- w3.org.ua
- уроки front-end и back-end
- Рубрики
- Brackets. Необходимые плагины
- Устанавливаем плагины в Brackets
- Switching Git Branches Breaks Autosave #2
- Comments
- cerebrl commented Dec 6, 2013
- cerebrl commented Dec 6, 2013
- martypenner commented Dec 9, 2013
- cerebrl commented Dec 9, 2013
- martypenner commented Dec 10, 2013
- martypenner commented Dec 10, 2013
- martypenner commented Dec 10, 2013
- cerebrl commented Dec 10, 2013
- cerebrl commented Dec 10, 2013
- martypenner commented Dec 10, 2013
- Save As file dialog is not closing. #1
- Comments
- negativefix commented Nov 4, 2013
- martypenner commented Nov 4, 2013
- martypenner commented Nov 5, 2013
- 8 awesome extensions for Brackets
- Autosave files on window blur
- Brackets Code Folding
- Document Outliner
- Emmet
- HTML Block Selector
- Reopener
- Right Click Extended
- Sidebar Plus
RachelScodes / init.coffee
# When Atom window is no longer in focus |
# I like to autosave all my files. |
# But I also keep a running notepad in an untitled file. |
# So when I switch windows it always prompts me to «Save As. « |
# I think that ^^^ is annoying. |
# For untitled note/scribbles that have been buffered, |
# I don’t need/want an alert to assign a filename. |
# Every time I switch windows! |
# So, when window is unfocused. |
atom . getCurrentWindow (). on ‘ blur ‘ , -> |
# go through the open panes . |
for pane in atom . workspace . getPanes () |
# TODO: save as package and toggle in settings |
if atom . config . settings . RachelSCodes . package |
# Ugh, you want to be prompted to save ‘untitled’ files? |
# Assign them a filename, and all that jazz? Great. |
# This will do that: |
pane . saveAllItems () |
else |
# Don’t want to do that? |
# This will go through the tabs. |
for item in pane . items |
# and only save if there’s a file |
if item . buffer . file |
pane . saveItem (item) |
# no prompts!! |
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
w3.org.ua
уроки front-end и back-end
Рубрики
Brackets. Необходимые плагины
Сегодня рассмотрим одну из программ, которую мы будем использовать для работы с версткой страниц – это Brackets. Скачать и установить программу можно с официального сайта по адресу brackets.io. В самой установке нет ничего сложного, а вот настройка для удобной работы займет у вас 5 минут.
Устанавливаем плагины в Brackets
Установка плагинов – это просто как дважды два. Запускаем Brackets, ищем панель в левой части и выбираем кнопку «Менеджер расширений».
В первый запуск программа инициализирует расширения, обновляя их базу. В менеджере расширений Brackets есть три вкладки: Доступные, Themes, Установленные. Соответственно нас интересуем вкладка Доступные.
В поле поиска вводим имя плагина, выбираем плагин и нажимаем «Установить». После установки всех плагинов – желательно перезагрузить программу.
Приведу ниже список плагинов, которые нам понадобятся:
- Emmet – плагин, который позволяет значительно ускорить написание кода html и css используя сокращения и аббревиатуры. Так, если вы хотите, чтобы знак восклицания (!) после нажатия клавиши tab превращался в полноценную html страницу то этот плагин вам необходим. Также позволяет оборачивать текст тегами HTML.
- Tabs — Custom Working – плагин, который добавляет красивые вкладки в Brackets. Помечает несохраненные файлы с помощью зеленых кружков. Основное назначение плагина – сделать работу более наглядной.
- Overscroll – плагин, который позволяет прокручивать код до конца страницы и даже делать прокрутку пустой области.
- Code Font – в современных версиях Brackets позволяет менять шрифт кода. В старых версиях – просто необходим, поскольку программа очень некрасиво отображала русский шрифт.
- Brackets Additional Right Click Menu – добавляет в контекстное меню много удобных «плюшек» — например пункты «Скопировать» и «Вставить».
- Autosave Files on Window Blur – плагин автоматического сохранения открытых файлов в тот момент, когда окно программы теряет фокус (например, если вы переключились на браузер).
Напоминаю, что после установки плагинов перезагрузите Brackets.
Также смотрите наше видео по установке плагинов в Brackets.
Switching Git Branches Breaks Autosave #2
Comments
cerebrl commented Dec 6, 2013
First off, I love this feature. I came from WebStorm to Brackets, so thank you for making this wonderful extension.
Second, this extension works well, but I can predictably break the autosave on blur after I switch git branches on the project. I have to quit and reopen brackets to get autosave working again.
Just thought I’d let you know. Thanks!
The text was updated successfully, but these errors were encountered:
cerebrl commented Dec 6, 2013
Nevermind, scratch that. I don’t know why it breaks. It worked really well when I was using the latest Edge Code; never had a single issue. But, with the latest Brackets, it just stops working.
martypenner commented Dec 9, 2013
Thanks for the kind words, @cerebrl. I’ll dig into this as soon as I can (hopefully today) and see what I can figure out.
cerebrl commented Dec 9, 2013
Thanks @martypenner! Let me know if I can help in any way. I do have a lot of other plugins installed, but I tried uninstalling the ones from Brackets that I didn’t have installed when I was using Code Edge, but that didn’t seem to help.
martypenner commented Dec 10, 2013
I’m fairly new to the whole bug-fixing process, so I appreciate the willingness to help. I’ve got a handful of plugins installed as well, and I’m seeing no issue whether they’re enabled or not.
Which platform are you on? I’ve only been able to test on OSX 10.9. And just to be clear: you are using Brackets 34.1?
martypenner commented Dec 10, 2013
I’ve just experienced the bug as well. The extension works if I’m only working on one file. Once I switch to editing another file, the autosave breaks on the first file.
martypenner commented Dec 10, 2013
@cerebrl Ah ha! I internally duplicate some of Brackets’ own file system code because that portion isn’t accessible to extensions. With the recent file system changes to the core API, my duplicated code would throw an error after saving the first file. I’ve fixed that.
I’ve also updated the extension in Brackets’ registry, so you can update the extension through the extension manager. Could you confirm the fix works for you?
cerebrl commented Dec 10, 2013
Sorry for being absent in this thread. I got swamped with tasks. I will test right now and let you know immediately if it works! Thanks so much for this!
cerebrl commented Dec 10, 2013
Yup! You fixed it! Thank you so much again. Having to save each individual file was driving me crazy.
martypenner commented Dec 10, 2013
No need to apologize. I really appreciate the way you handled things. Glad to help anytime 🙂
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Save As file dialog is not closing. #1
Comments
negativefix commented Nov 4, 2013
I insalled your extension to Brackets Sprint 33 and realized it causes save file dialog to stay open while saving files. Can you check it.
Steps to reproduce;
Launch Brackets
Create a new file (either through CTRL+N or File -> New)
Save File
«Save As» file dialog appears, clicking save button creates the file but does not close «Save As» dialog window. «Cancel» button also does not cancel operation and close the «Save As» dialog.
Platform Windows 8. Brackets Sprint 33.
The text was updated successfully, but these errors were encountered:
martypenner commented Nov 4, 2013
Thanks for bringing this to my attention, @negativefix. I built the extension without properly testing the different scenarios. I’ll look into this within the next few days.
martypenner commented Nov 5, 2013
It looks like there is no way to tell if the dialog is open to delay/prevent running the «save all» command. Even if that were possible, the dialog is modal and synchronous, so the «save all» call happens after the dialog is closed, regardless. This may be part of a larger issue with the Brackets API. I’ll contact the team to see what can be done.
8 awesome extensions for Brackets
Brackets has not yet replaced Sublime Text as my primary text editor, but it’s a definite possibility. The quick edit functions are great, it’s always nice to have a color picker handy, it’s light, it’s fast, and it looks kinda purdy.
I’ve used it for light editing, as well as a couple of code experiments, so I have a pretty good idea of what it’s like to use it regularly.
I have a few issues, of course; getting the live preview to work with a local copy of WordPress seems downright impossible at the moment. Also, while you can edit any linked CSS file directly from any HTML document, that doesn’t work so well when you’re using LESS or SASS. Oh, and I still want to be able to edit multiple lines of text at once, like I can in Sublime Text.
Then again, the program is still in relatively early stages of its development, so there’s a lot of good stuff that’s coming, it just isn’t here yet.
These issues aside, working in this application gives me an almost unconscious sense of pleasure and well-being, and that counts for a lot with me. Sure, that’s practically the definition of subjective criteria, but subjective criteria do matter when you’re looking for the software that’s right for you.
Then, there’s the extensions. The library of extensions is growing rapidly, as interest in Brackets spreads throughout the community. Most of the extensions don’t alter the program in any huge way; for the moment, they seem to take care of smaller, more “niggling” issues that its users encounter. But that’s the beauty of an IDE built in HTML and Javascript: almost anyone can go ahead and fix any problems that they find.
There are some great extensions, and more are being added all the time. Here are my favorites, in alphabetical order:
Autosave files on window blur
In this plugin‘s case, “on window blur” means that whenever you select a window that isn’t Brackets, your files will be saved automatically.
This is perfect for me, because I’m constantly switching between programs, such as my browser and image editor, while I work.
The files get saved, LESS files are compiled, it saves me a little time, and I don’t wear out my “Ctrl” and “S” keys.
Brackets Code Folding
This extension introduces basic code folding to Brackets, if you go in for that sort of thing. Does exactly what you expect, no more, and no less.
Document Outliner
If you’re working in an HTML5 file, this one’s interesting. It creates an “Outline” of your document based on things like nav, header, section, and footer tags. You can access this outline via a panel for quick and easy document navigation.
Emmet
The Brackets implementation of Emmet, formerly known as Zen Coding. Never leave home without this one. Also, why did they ever change that name?
HTML Block Selector
This is a quick and easy way to select an entire HTML block at once. Just “CTRL + Click” on the tag in question, and it will be selected along with all of its contents. Nifty.
Reopener
Need to quickly re-open a file you just closed? Reopener has you covered. Just go to “File > Reopen Closed Tab”, or hit “CTRL + ALT + W”.
Right Click Extended
I can’t believe I have to say this, but…
Dear Brackets Devs,
For the love of all that is holy and good in the world, put things like “Copy”, “Cut”, and “Paste” into the right-click context menu on your own. You really shouldn’t have to wait for someone to make an extension with that functionality. I mean, it should have been the first thing you did after the “Save File” function.
I do love you guys and all of your hard work, so it pains me to say it like this, but come on! There are times when I use my mouse to select text and move it around, or duplicate it. In fact, this is an actual real-life scenario that many, many people encounter every day.
Sincerely, and with much love,
In summary: So yeah, that’s what this extension does… it adds copy, cut, and paste functionality to the right-click menu.
Sidebar Plus
This extension hides the sidebar with a simple keyboard shortcut for those times when you just want to focus all of your attention on one file. Note: If you have the Brackets Tabs extension installed, it hides those too.