Как открыть терминал в atom

Atom editor и Nodejs — быстрый старт

Atom — достаточно новый текстовый редактор для программистов, выпущенный командой GitHub. Сам по себе он очень похож на SublimeText, но только на первый взгляд, на самом деле он более гибок и удобен. Особенно для желающих программировать с использованием nodejs, ruby или python. Разумеется все три варианта я рассматривать в этой статье не буду, остановлюсь на ноде, как на более близком мне языке программирования.

Преимущества Atom

Возможно, для кого-то это и не проблема… а мне не нравится.

Дело в том, что я адепт весьма старой школы погромиздов и … так сложилось, что я не люблю, когда у меня открыто несколько окон, типа окна терминала, окна редактора и окна браузера. Переключение между ними меня раздражает. А тут еще и браузер надо открывать, чтобы посмотреть — применились изменения или нет. Короче целая пляска с бубном. Мне вот уже 3 года пытаются доказать, что нода, де, быстрее и удобнее для разработки приложений, чем php, но пока, из-за свистопляски с консолью, я что-то не спешу с этим соглашаться. К счастью есть atom, в котором можно добавить терминал и дебаггер прямо внутрь интерфейса, используя плагины. Причем работать все это дело будет как под линуксом, так и под шиндой.

Вот как выглядит atom в настроенном виде:

Как открыть терминал в atom

Внизу вы видите удобную вкладочку с терминалом и запущенный в ней тестовый nodejs сервер. Классно?

Но это еще не все «фичи», хехе. Atom не только позволяет запускать терминал, но так-же следит за синтаксисом и оформлением исходного скрипта. Стоит добавить лишний пробел или не верно оформить кавычки как он выдаст соответствующее предупреждение. «Говонкод» не пройдет! В качестве демонстрации я прямо сейчас, специально, допущу несколько ошибок в коде.

Как открыть терминал в atom

Первая ошибка — это отсутствие кавычки.

Как открыть терминал в atom

А вот вторая уже интереснее, хехе.

Как открыть терминал в atom

Это стилистическая ошибка, как выяснилось. То есть редактор сам следит за стилем написания кода. И если вы допускаете ошибки в этом самом стиле, он вас предупреждает.

Ну или, например, вот:

Как открыть терминал в atom

Поставил некрасивый или лишний пробел — на тебе ошибку! Зато на правильно стилизованный код он не жалуется:

Как открыть терминал в atom

Так-же имеется очень мощное автозавершение кода, которое было в том-же sublimetext, если вы его использовали. Но там, как вы помните, небыло подсветки аргументов функции. Тут — подсветка аргументов есть!

Как открыть терминал в atom

Однако, стоит заметить, что эти возможности «из коробки» не доступны. Вам придется настроить все самостоятельно. А я вам в этом помогу.

Настраиваем Atom и Nodejs

Для начала не плохо бы скачать и установить себе на пк оба этих приложения.

Nodejs можно скачать тут, а Atom — тут. Причем, если у вас Linux, думаю, можно будет поискать эти пакеты в доступных вам репозиториях.

После установки запустите Atom. Нужно будет установить ряд пакетов, чтобы все работало как надо.

Собственно список пакетов:

Источник

How to open the terminal in Atom?

How to open the terminal in Atom? Do I need to install a plug-in?

If possible, I also would like to know how to use shortcut keys to open the terminal.

Как открыть терминал в atom

8 Answers 8

For Windows follow the below steps

(1)go to file>setting and click on install Как открыть терминал в atom

(2) then type «platformio-ide-terminal» in packages and hit install Как открыть терминал в atom (3) after finish install restart atom and press

Как открыть терминал в atom

Как открыть терминал в atom

Edit: I no longer use Atom. The plugins I originally recommended here have all apparently ceased to be maintained. I’ve updated this answer with the suggestions in the comments, but please note I haven’t tried any of these and will no longer be maintaining this answer.

Please check the comments or other answers for more up-to-date recommendations.

There are a number of Atom packages which give you access to the terminal from within Atom. Try a few out to find the best option for you.

Open a terminal in Atom:

Open an external terminal from Atom:

Источник

atom-terminal-panel

Short note

This project uses jquery-autocomplete-js for autocompletion.

Development

This project is in alpha stage. Please contribute this project if you liked it. All the help is welcome. Thank you.

Usage

Just press shift-enter or just Ctrl + ` (control + backtick) and enjoy your cool ATOM terminal 😀 Try pressing the ctrl in the terminal for dynamic suggestions list!

Screenshot

Terminal with fancy file links and interactive interface.

Как открыть терминал в atom

Fancy custom highlighting rules.

Как открыть терминал в atom

There’s also nice looking easy-to-use command finder dialog (just to search your custom commands and terminal build-ins):

Как открыть терминал в atom

Feature

And a lot more! See it by yourself!

Plugins

This ATOM plugin is modular. You can create your own commands or download existing from the other users. The release contains also the built-in plugins (for file system management etc.).

Terminal-commands.json

The config file contains:

The sample config file can look like:

The above configuration file will create highlight rule for all lines containing «warning: » text (this lines will be colored yellow).

Creating custom terminal shortcuts

You can create your own shortcuts buttons, which are placed on the terminal toolbar. To do it just put a new entry in the toolbar property:

E.g. creating a button, which displays all avaliable terminal bultin commands:

Another example. Now the button will move the terminal to the C: directory:

You can add also tooltips describing the button functions:

And now creating custom actions:

You can now bind the command to the specified keys by editing your keymap.cson :

Defining custom commands

Each command is defined in the commands entry the following way:

‘command0’, ‘command1’. are the commands that will be invoked by the user entry. Example involving g++ usage:

As you can see you are able to build the current C/C++ project using only a single command. You may also try creating a build command accepting single file path (simple source file path) and the auto_build command, which will execute build command with %(file) parameter. E.g.

Defining custom rules

The highlight rules that are placed in rules property can be defined using two methods. The simple way looks like:

Or more complex (and also more powerful) way:

The REGEXP will be replaced with REPLACEMENT and all the line with matched token will be colored to red(matchLine:true).

You can also override default regular expression flags (default are: gm ):

And specify how many lines under the match should be replaced:

Getting more from custom patterns

You can event make your patterns to be applied to the html code. Adding the forced option to the match :

From now your pattern will be applied to the html code, so it may seriously broke entire terminal output! The forced patterns must be carefully designed to correctly manipulate the html code. If you’re a beginner you should do most things without using forced patterns.

More about regex rules

You can use the following properties in regex matches:

Special annotation

Text formatting

Please use the %(^. ) modifiers to format the text:

Internally defined commands

You can take advantage of commands like memdump which prints information about all loaded commands (internal, not native!). Here the list of all commands:

Included example commands:

Internal configuration

You can modify the extensions.less file and add your own extension colouring rules. E.g:

Simple like making a cup of fresh coffee. Just dot, extension name and CSS formatting.

You can modify it to make the terminal look cooler.

Creating more advanced custom functions (plugins)

But if you’re using state.exec you must remember about passing not only command string but also state and args parameters (array of refernced parameters). The array of the referenced parameters contains all parameters which will be referenced by a command string (element at zero index in array will be used for %(0) replacement). If the command string do not reference its parameters you can pass only a null value. As you can see all terminal messages are displayed automatically (just return the string message). but you can also print them manually:

You can also export new variables:

More about console

You can also call other useful console methods:

Hotkeys

Example configuration

The regex rules preview can be easily checked by invoking echo command (e.g. echo warn test warning messages. ).

Note that after each config update you must call update command otherwise changes will take no effects.

Experiments

This package is in alpha development phase. You can enable experimental features, which may be added to the software in incoming releases.

I think this package is bad news.

Good catch. Let us know what about this package looks wrong to you, and we’ll investigate right away.

Источник

Как открыть терминал в Atom?

Как открыть терминал в Atom? Нужно ли устанавливать плагин?

Если возможно, я также хотел бы знать, как использовать горячие клавиши для открытия терминала.

ОТВЕТЫ

Ответ 1

Ответ 2

Для Windows выполните следующие шаги

(1) перейдите к файлу> настройки и нажмите кнопку установки Как открыть терминал в atom

(2) затем введите «platformio-ide-Terminal» в пакетах и нажмите «install» Как открыть терминал в atom (3) после завершения установки перезапустите Atom и нажмите

Как открыть терминал в atom

Ответ 3

Существует ряд пакетов Atom, которые дают вам доступ к терминалу изнутри Atom. Попробуйте несколько, чтобы найти лучший вариант для вас.

Некоторые рекомендации, которые работают в Ubuntu (с их основными сочетаниями клавиш):

Откройте терминал в Atom:

Редактировать: рекомендуемый плагин изменен, так как terminal-plus больше не поддерживается. Спасибо за голову, @MorganRodgers.

Откройте внешний терминал от Atom:

Если вы просто хотите, чтобы ярлык открыл внешний терминал изнутри Atom, попробуйте atom-terminal (это то, что я использую). Вы можете использовать ctrl-shift-t чтобы открыть свой внешний терминал в текущем каталоге файлов, или alt-shift-t чтобы открыть терминал в корневом каталоге проекта.

Ответ 4

Следующие скриншоты были сделаны на Mac.

Как открыть терминал в atom

Как открыть терминал в atom

Ответ 5

Ответ 6

После установки platmormio-ide-терминала я не могу активировать свою виртуальную среду. ЗАЧЕМ?

Ответ 7

Ответ 8

Во-первых, вы должны установить «platformio-ide-терминал»: Откройте «Настройки», « >> Нажмите » + Установить « >> В разделе » Поиск пакетов « введите » platformio-ide-терминал « >> Нажмите » Установить «.

И точно отвечая на вопрос. Если вы ранее установили, просто используйте:

Источник

PlatformIO IDE Terminal

A terminal package for Atom, complete with themes, API and more for PlatformIO IDE.

Как открыть терминал в atom

Install

You can install via apm: apm install platformio-ide-terminal

Caveats

Some Atom installations via flatpak may have incompatibilites, including an inability to find host system binaries from select directories, such as /usr/*. If you encounter issues using platformio-ide-terminal with flatpak, such as missing binaries, that are normally accessible from the path you have set in your shell of choice, or if you are not able to change directory into some directories, you may be affected. You can confirm this by looking for the nfsnobody permissions from the root of your disk. You can workaround this by installing another version of atom that is not inside a sandbox container. See here for full details.

Usage

platformio-ide-terminal stays in the bottom of your editor while you work.

Click on a status icon to toggle that terminal (or ctrl-` ). Right click the status icon for a list of available commands. From the right-click menu you can color code the status icon as well as hide or close the terminal instance.

Terminal

You can open the last active terminal with the platformio-ide-terminal:toggle command (Default: ctrl-` ). If no terminal instances are available, then a new one will be created. The same toggle command is used to hide the currently active terminal.

From there you can begin typing into the terminal. By default the terminal will change directory into the project folder if possible. The default working directory can be changed in the settings to the home directory or to the active file directory.

Features

Full Terminal

Every terminal is loaded with your system’s default initialization files. This ensures that you have access to the same commands and aliases as you would in your standard terminal.

Themes

The terminal is preloaded with several themes that you can choose from. Not satisfied?
Use the following template in your stylesheet:

Process Titles

By hovering over the terminal status icon, you can see which command process is currently running in the terminal.

Как открыть терминал в atom

Terminal Naming

Need a faster way to figure out which terminal is which? Name your status icons!

Available via the status icon context menu.

Color Coding

Color code your status icons!

The colors are customizable in the settings, however the color names remain the same in the context menu.

Sorting

Organize your open terminal instances by dragging and dropping them.

Как открыть терминал в atom

Resizable

You can resize the view vertically, or just maximize it with the maximize button.

Working Directory

You can set the default working directory for new terminals. By default this will be the project folder.

File Dropping

Dropping a file on the terminal will insert the file path into the input. This works with external files, tabs from the Atom tab-view, and entries from the Atom tree-view.

Insert Selected Text

Insert and run selected text from your text editor by running the platformio-ide-terminal:insert-selected-text command ( ctrl-enter ).

Как открыть терминал в atom

If you have text selected, it will insert your selected text into the active terminal and run it.
If you don’t have text selected it, will run the text on the line where your cursor is then proceed to the next line.

Quick Command Insert

Quickly insert a command to your active terminal by executing the platformio-ide-terminal:insert-text command.

Как открыть терминал в atom

A dialog will pop up asking for the input to insert. If you have the Run Inserted Text option enabled in the settings (default is false), platformio-ide-terminal will automatically run the command for you.

Support for Special Keys

Support for IME, dead keys and other key combinations via the Insert Text dialog box. Just click the keyboard button in the top left of the terminal or set up a keymap to the platformio-ide-terminal:insert-text command.

Как открыть терминал в atom

Note: Make sure you have the Run Inserted Command toggle off otherwise it will run your inserted text.

Map Terminal To

Map your terminals to each file or folder you are working on for automatic terminal switching.

Как открыть терминал в atom

Folder

Как открыть терминал в atom

Toggling the Auto Open a New Terminal (For Terminal Mapping) option will have the mapping create a new terminal automatically for files and folders that don’t have a terminal. The toggle is located right under the Map Terminals To option.

Как открыть терминал в atom

Commands

CommandActionDefault Keybind
platformio-ide-terminal:newCreate a new terminal instance.ctrl-shift-t or cmd-shift-t
platformio-ide-terminal:toggleToggle the last active terminal instance.Note: This will create a new terminal if it needs to.ctrl-` (Control + Backtick)
platformio-ide-terminal:prevSwitch to the terminal left of the last active terminal.ctrl-shift-j or cmd-shift-j
platformio-ide-terminal:nextSwitch to the terminal right of the last active terminal.ctrl-shift-k or cmd-shift-k
platformio-ide-terminal:insert-selected-textRun the selected text as a command in the active terminal.ctrl-enter
platformio-ide-terminal:insert-textBring up an input box for using IME and special keys.––––––––––––
platformio-ide-terminal:fullscreenToggle fullscreen for active terminal.––––––––––––
platformio-ide-terminal:closeClose the active terminal.ctrl-shift-x or cmd-shift-x
platformio-ide-terminal:close-allClose all terminals.––––––––––––
platformio-ide-terminal:renameRename the active terminal.––––––––––––

I think this package is bad news.

Good catch. Let us know what about this package looks wrong to you, and we’ll investigate right away.

Источник

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *