Geany — продвинутый текстовый редактор с заявкой на среду разработки

Содержание:

Установка

  1. Для установки Geany в Ubuntu актуальной версии, нужно подключить дополнительный репозиторий:

    sudo add-apt-repository ppa:geany-dev/ppa & sudo apt-get update
    Подключение дополнительного репозитория launchpad.net

    sudo apt-get install geany geany-plugins
    Устанавливаем Geany

    Если по какой-то причине Вы не смогли установить вышеприведенным способом, то предлагается второй.

    Спойлер: Второй способ установки Geany.

    echo «deb http://ppa.launchpad.net/geany-dev/ubuntu natty main» `lsb_release -cs` main | sudo tee -a /etc/apt/sources.list
    Подключение дополнительного репозитория

    sudo apt-key adv —keyserver keyserver.ubuntu.com —recv-keys 71240B8FB3641232 && sudo apt-get update
    Устанавливаем ключ безопасности и обновляем список доступных пакетов

    sudo apt-get install geany geany-plugins
    Устанавливаем Geany

    После установки, Geany можно запустить через ярлык Приложения→Стандартный→Geany

    Скоро восьмое марта и каждый мужчина уже начинает задумываться о подарке для своей любимой женщине. Новогодние платья 2011 года на сайте Vsetke.ru для любой женщины являются «лакомым кусочком». Поэтому такой подарок будет для нее желанным и очень полезным.

    Статья опубликована 02.02.2011 · Автор статьи: Зюзгин Иван
    Статья относится к linux, windows, софт, ubuntu, репозиторий, gnome, текст, блоггинг, удобство

    Похожие 7 программ:

    1. SciTE — текстовый редактор для разработчиков
    2. Sublime Text 2 — один из лучших текстовых редакторов в Linux
    3. Geany — продвинутый текстовый редактор с заявкой на среду разработки
    4. Medit — это более быстрый аналог Gedit
    5. Gedit — текстовый редактор выбранный Canonical
    6. Juffed — текстовый редактор с широким функционалом и большим будущим
    7. Leafpad — очень быстрый и простой текстовый редактор

    Комментарии

    IT-новости

    • 09
      фев

      Apple патентует новый сенсорный экран с дактилоскопом

    • 02
      фев

      Быть ли продукции Apple в России?

    • 12
      дек

      Microsoft меняет название телефона Lumia

    • 26
      май

      Потоковая трансляция теперь доступна в Steam для всех платформ

    • 24
      фев

      Компания Microsoft закрывает почтовик Hotmail

    Популярное

    TOP 100

    Облако тегов

    Все теги

Creating a GTK runtime bundle

In order to run Geany and/or create an installer for distribution, you need a GTK runtime environment.
There is simple script which downloads all necessary packages and unpack them in an automated way.

After you have run the scripts as described below, you should copy the resulting files and directories
all into your Geany installation directory if you want to use it directly for your own Geany
installation.
In case you want to create an installer, leave the directories as they are and read on.

Geany

To run it, simply create a new directory where the GTK runtime environment should be
unpacked and change into this directory.
Then call the script and wait a bit. It will download all necessary MSYS2 packages and extract them.
Finally it will download the sources for *grep* and then compile *grep*.

cd
curl -L -o geany-gtk-bundle-from-msys2.sh https://raw.githubusercontent.com/geany/geany/master/scripts/gtk-bundle-from-msys2.sh
mkdir /h/geany-bundle
cd /h/geany-bundle
bash ~/geany-gtk-bundle-from-msys2.sh -2
rsync -a --delete /h/geany-bundle/ ~/geany/gtk/

There are a few command line options for this script. Run it with “-h” for details.
The most important option is “-2” and “-3” which defines the GTK version to be used.

The trailing “rsync” command is only necessary if you intend to create an installer later on.

Geany-Plugins

cd
curl -L -o geany-plugins-gtk-bundle-from-msys2.sh https://raw.githubusercontent.com/geany/geany-plugins/master/build/gtk-bundle-from-msys2.sh
mkdir /h/geany-plugins-bundle
cd /h/geany-plugins-bundle
bash ~/geany-plugins-gtk-bundle-from-msys2.sh -2
rsync -a --delete /h/geany-plugins-bundle/ ~/geany-plugins/contrib/

The trailing “rsync” command is only necessary if you intend to create an installer later on.

Geany Review

Geany is a lightweight, quick, and responsive Integrated Development Environment (IDE). It was designed to be speedy and easy to use, with only a few package dependencies- independent from specialized Desktop Environments like KDE and GNOME. Geany only needs GTK2 runtime libraries to function. If you’ve got that together, you’re not likely to have any problems with it.

Essential Features

— Syntax highlighting

— Code folding

— Symbol name auto-complete

— Construct and complete/snippets

— Auto-close XML and HTML tags

— Call tips

— Many supported file types

— Symbol lists

— Code navigation

— Build system to compile and execute code

— Simple project management

— Plug-in interface

Geany runs under every major OS, as well as FreeBSD, NetBSD, OpenBSD, AIX v5.3, and Solaris Express. You should be able to use this editor on any platform supported by GTK libraries. Only the Windows, (surprise), Geany port is missing a few features. The code is GNU licensed, so you can use it as you like, just keep your hands off the innards.

My opinion is that there are only two good IDEs available at the moment, and Geany is one. Compared to Eclipse, its only real competition, Geany is equal in every way, but lighter.

Geany supports all the major relevant programming languages and has all the features that you expect with an IDE such as line numbering and syntax highlighting. When you start it up, (and it opens fast!), you’ll be presented with a tidy, no-frills interface and plenty of space to work. All compiler messages appear in the box at the bottom- and this is indispensable for debugging code. From there, you can open new files and choose the file type for the language you want to use. And away you go.

Light is Nice

In addition to being lightweight, Geany is powerful, non-interruptive, and displays everything you need handily. Syntax highlighting, line numbers, automatic brace closing, parenthesis, and more- all do precisely what you expect them to with no unpleasant surprises.

If you’re an experienced programmer, you know it’s best when you can fall into habits that are routine and comfortable. You want an IDE that doesn’t switch things up on you. Geany is very stable, reliable, and predictable.

Compiling your code and running it couldn’t be easier. Just click a button and it compiles everything for you, click another and your creation will run.

What you get after pressing ‘run’ depends on what you’ve written. If the program you’ve written is only a simple Java creature- run it, and the output will come through your terminal. Just press enter once and it will exit. This lean and mean IDE will keep everything as straightforward and tidy as possible- just like Geany itself.

GTK+3 compilation

This is effectively the same procedure as cross-compiling on Linux. You can either clone the source code from the GIT repository or download a release tarball (1.27 or later) and unpack it.

curl -L -o geany-master.zip https://github.com/geany/geany/archive/master.zip
unzip geany-master.zip
cd geany-master
# autogen.sh is not needed for tarballs!
NOCONFIGURE=1 ./autogen.sh
# configure and make take a while, don't panic
./configure --enable-gtk3 --prefix=/c/geany
make -j2
make install

After that, you can run Geany either through msys2 shell () or use the Windows Explorer to locate the executable and run it.

The first run should look like this, on GTK+ 3.18.6

2.2.2. Написание программ¶

2.2.2.1. Python¶

Для запуска интерпретатора Python откройте терминал и введите команду python (или python3 ), после чего интерпретатор будет запущен и перейдет в интерактивный режим, ожидая ввода команд (Рисунок 2.2.12).

Рисунок 2.2.12 — Запуск интерпретатора Python ¶

После ввода команды ее необходимо подтвердить нажатием клавиши . При этом, если команда подразумевает возврат какого-либо результата, интерпретатор автоматически отобразит его в консоли (Рисунок 2.2.13).

Рисунок 2.2.13 — Ввод команд и отображение результата ¶

Введите в консоли по очереди команды, приведенные в Листинге 2.2.1. Комментарии вводить не обязательно. Один из возможных результатов выполнения приведен на Рисунке 2.2.14.

Рисунок 2.2.14 — Результат ввода программы в интерактивном режиме ¶

Даже если не знать синтаксис Python, благодаря его «простоте», можно понять, что происходит в программе.

2.2.2.2.1. Atom¶

Для создания и запуска программы необходимо выполнить нескольких шагов:

Для создания файла выберите меню File -> New File (Ctrl + N).

Сохраните файл с расширением ‘.py’ (например, ‘main.py’ ), используя меню File -> Save (Ctrl + S). Убедитесь, что кодировка файла установлена в UTF-8.

Наберите текст программы из Листинга 2.2.1.

Для запуска программы нажмите клавишу F5.

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

Проверьте, исправьте возможные стилевые ошибки (до исчезания соответствующего окна сообщений) и сохраните окончательный вариант программы (Рисунок 2.2.15).

Рисунок 2.2.15 — Работа в IDE Atom ¶

2.2.2.2.2. Geany¶

Для создания и запуска программы необходимо выполнить нескольких шагов:

Для создания файла выберите меню Файл -> Создать (Ctrl + N).

Сохраните файл с расширением ‘.py’ (например, ‘main.py’ ), используя меню Файл -> Сохранить (Ctrl + S). Убедитесь, что кодировка файла установлена в UTF-8.

Наберите текст программы из Листинга 2.2.1.

Для запуска программы нажмите клавишу F5 или кнопку Выполнить на панели инструментов.

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

Проверьте, исправьте возможные стилевые ошибки, выбрав меню Сборка -> PEP8 и сохраните окончательный вариант программы (Рисунок 2.2.16).

Рисунок 2.2.16 — Работа в IDE Geany ¶

2.2.2.2.3. PyCharm¶

PyCharm использует концепцию проектов, поэтому в первую очередь необходимо создать пустой проект, и, введя его название, нажать кнопку OK (Рисунок 2.2.17).

Рисунок 2.2.17 — Создание проекта IDE PyCharm ¶

После открытия проекта необходимо выполнить нескольких шагов:

Для создания файла выберите меню File -> New (Alt + Ins).

Выберите Python File и введите имя файла (например, ‘main.py’ ), после чего подтвердите создание нажатием кнопки OK.

Наберите текст программы из Листинга 2.2.1.

Для запуска программы нажмите клавишу F5.

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

Проверьте, исправьте возможные стилевые ошибки (до исчезания подчеркиваний в редакторе кода) и сохраните окончательный вариант программы (Рисунок 2.2.18).

Рисунок 2.2.18 — Работа в IDE PyCharm ¶

2.2.2.2.4. Автоматическая проверка заданий¶

Начиная с 3-й темы заключительным этапом решения задачи должна быть автоматическая проверка (клавиша F6 в Atom и PyCharm или меню Сборка -> Проверить в Geany). Подробнее см. раздел Выполнение практикума и самостоятельной работы .

Miscellaneous Use-Cases

Multiple Project Files

There is no reason that you cannot have multiple project files for the one
source tree, allowing commands for differing uses to be stored, but not mixed.
An example would be to have “secret-project-x-linux.geany” that used GCC and
friends to compile the project and “secret-project-x-windows.geany” that
contained the commands to compile with the windows tools.

Since you can only get one set of commands or the other depending on which project file you opened instead of having two sets of commands side
by side in the same menu there is no chance of hitting the wrong one.

When doing this it is best to turn project session files off.

Different Build Types

Often software has the concept of different build types which use differing
options such as “debug”, “release” or “testing”.

These differing commands are good candidates for replacing the default Make
commands, either in the project or your own user preferences if you haven’t
used a project.

When doing this remember that the second filetype independent command pops up a dialog and appends text the user enters to the command.

Better syntax highlighting for Django templates

You can configure Geany to highlight variables and template tags in Django templates.
This helps a lot to differentiate between normal HTML code and Django
template code in the template files.

By default, highlighting of Django template tags is disabled because it may
cause glitches with other special sorts of HTML code and not everyone
is using the Django template language.

To enable that special highlight, you need to adjust the HTML filetype definition file.
Either create or edit the file /home/<username>/.config/geany/filedefs/filetypes.html
and add the following few lines (or just adjust the section if it already
exists):

~/.config/geany/filedefs/filetypes.html
lexer_properties
lexer.html.django=1

Fine-tune styling

You can adjust the styling to some extend using the following settings which should be placed in the section of filetypes.html:

  • html_asp
  • python_identifier
  • python_default

Explanation:

{% load pages_tags i18n %}

and will be styled with html_asp, , and
will be styled with python_identifier and the spaces between with
python_default.

Example:

~/.config/geany/filedefs/filetypes.html
styling
# foreground;background;bold;italic or named_style,bold,italic
html_asp=#ff0000
python_identifier=keyword_1,italic
python_default=default

The example above makes and styled in red (#ff0000) and the words in between will be styled with the named-style keyword_1 (which is by default dark blue) and renders it in italic.

Установка Python

Ошибка №1

Для решения первой проблемы (пункт 1) устанавливаем Python рис 13.
Скачиваем дистрибутив https://www.python.org/

рис. 13

После скачивания запускаем инсталлятор рис 14.

рис. 14

В первом окне ( рис 15) необходимо поставить галочку напротив “Add Python 3.7 to PATH” , это очень важно, так как отсутствие галочки может повлиять на работу языка Python с интегрированной средой Geany.
И нажимаем Install Now

рис. 15

Установка рис 18

После успешной установки, появится надпись “Setup was successful”. Это означает, что установка прошла успешно и можно возвращаться к нашей программе и попытаться ее запустить.

рис. 18

После установки запускаем снова нашу команду “Привет мир!”. Если ошибка все та же (как на рисунке 12), то значит мы столкнулись с ошибкой номер 2 (отсутствие привязки интегрированной среды Geany с интерпретатором Python). Это означает, что среды Geany не знает, где установлен Python, а в следствии чего не может его запустить.

Ошибка №2

Для решения этой ошибки необходимо запустить IDE Geany и выбрать наш файл с расширением “.py” или создать новый.
Следующий шаг: переходим в верхнее Меню программы Geany и выбираем пункт “Сборка”, далее в контекстном меню выбираем пункт: “Установить команды сборки” рис 19

рис. 19

Первое: в разделе “Команды для языка: Python” в первой строчке, в столбце Команды, меняем строку
“python -m py_compile «%f» ” на “C:\Users\AppData\Local\Programs\Python\Python36-32\python.exe -m py_compile «%f» ”
Это пример!
Мы заменяем команду “ python” на путь, где находится запускающий файл Python

В нашем пример это “C:\Users\AppData\Local\Programs\Python\Python36-32\python.exe” и не забываем добавить ключи “-m py_compile «%f» ”.
Второе: Очень похоже , что мы делали до этого, только в разделе “Выполнить команды” в первой строчке, в столбце Команды, меняем строку
“python «%f» ”
на “C:\Users\AppData\Local\Programs\Python\Python36-32\python.exe «%f» ”
ВНИМАНИЕ у вас может путь не совпадать с примером!
На рисунке 15 указано ссылка на каталог, куда вы устанавливали Python, в этом каталоге нужно найти файл python.exe это и будет тот самый полный путь, на который необходимо заменить команду “ python *”.
После проделанных шагов заново запускаем нашу первую программу и проверяем результат, при правильном выполнение инструкции у вас должен быть результат как на рисунке 20. Если у вас снова ошибка, то проделайте все шаги из этой инструкции и будьте внимательны, возможно пропустили важный шаг

рис. 20

Мы прошли все возможные этапы по установке и настройке интегрированной среды программирования Geany для работы с языком Python. Теперь мы можем создавать программы (проекты) на языке Python и делать этот мир лучше.

Useful Django snippets

Tomasz Karbownicki
created some useful snippets for the filetypes Python and HTML to assist you
working on Django code and templates.

For convenience, the relevant parts are copied below to easily be inserted into
your Geany snippet configuration file.
To do so, just open the configuration file in Geany by using
Tools → Configuration Files → snippets.conf and either paste the contents below completely
or extend the already existing sections Python and HTML.

Python
# Django models
# by Tomasz Karbownicki <tomasz@karbownicki.com>
mclass=class %cursor%(models.Model):\n\t'''%cursor%'''\n\n\tdef __unicode__(self):\n\t\treturn self.XXXXX\n\n\tdef get_absolute_url(self):\n\t\treturn "/XXXXX/%s/" % self.slug\n\n\tclass Meta:\n\t\tverbose_name = "%cursor%"\n\t\tverbose_name_plural = "%cursor%"
mchar=%cursor% = models.CharField(max_length=50, verbose_name=u'%cursor%')
mint=%cursor% = models.IntegerField(verbose_name=u'%cursor%')
mtext=%cursor% = models.TextField(verbose_name=u'%cursor%')
mkey=%cursor% = models.ForeignKey(%cursor%, verbose_name=u'%cursor%')
mimage=%cursor% = models.ImageField(upload_to='', verbose_name=u'%cursor%')
mbool=%cursor% = models.BooleanField(verbose_name=u'%cursor%')
mdate=%cursor% = models.DateField(verbose_name=u'%cursor%', help_text='Format daty: 2009-04-28')
memail=%cursor% = models.EmailField(verbose_name=u'%cursor%')
murl=%cursor% = models.URLField(verbose_name=u'%cursor%')
mslug=%cursor% = models.SlugField(verbose_name=u'%cursor%', unique=True)
 
HTML
# Django templates
if={% if %cursor% %}\n\t\n{% endif %}
for={% for sth in %cursor% %}\n\t%cursor%\n{% endfor %}
dv={{ %cursor% }}
db={% %cursor% %}
dbl={% block %cursor% %}\n\t%cursor%\n{% endblock %}
trans={% trans "%cursor%" %}
com={# %cursor% #}
comm={% comment%}
ecomm={% endcomment%}

More snippets for Python, HTML and many other languages can be found in this wiki, see Snippets.

Проблемы с графикой

При использовании Free Pascal в ОС Linux следует уделить внимание проблеме графики. Дело в том, что универсальный и удобный модуль GRAPH был предназначен для применения в консольном (текстовом) режиме MS-DOS

При переносе Free Pascal в операционные системы семейства Unix, в частности в Linux, пришлось взять за основу устаревшую и небезопасную библиотеку libvga (libsvga), также ориентированную на консольный режим и не имеющую к X Window никакого отношения. Главным недостатком этой библиотеки является то, что использующие её программы должны работать в режиме суперпользователя (root). Чем это грозит, думаю, понятно почти всем, а неопытным пользователям в любом случае необходимо пройти курс молодого бойца, позволяющий правильно оценить серьёзность данной проблемы. Какой же из этого следует вывод? Отказаться от использования GRAPH и начать осваивать графическое программирование в X Window. Но это тема отдельной статьи, а возможно, и цикла. Кстати, в русскоязычном Интернете можно найти материалы именно по этому вопросу.

Introduction

At some point in most software development workflows there comes a time when
the editing is over and a
command needs to be run. Some of the commands used are:

  • Simply running the program using an interpreter, e.g. Python code, or viewing HTML, where the command depends on the language being used.
  • Compiling a source file and running the result, or building a document, where again the command depends on the language in use.
  • Compiling and linking several source files and running/viewing the result
  • Complex processes involving multiple source files, installation, etc.

Where multiple files are involved it is usual to use some sort of build tool,
make, CMake, JHbuild, BJam, Ant, SCons, WAF, Fabricate, etc. These tools
usually have their own configuration and the commands to activate them do not
depend on the language the source files use.

It is also rare that a programmer works on only one thing at a time. Most of
us have several projects (using the word in its normal English meaning) on the
go at one time. These may need different tool sets, even for the same
source language.

Overall there can be potentially quite complex requirements of the task of
turning source text into execution.

Development environments have traditionally addressed this complexity in one
of two ways:

  1. Limiting the complexity by restricting the user to one or two tool sets. This tends to result in tight integration and detailed support from the development environment.
  2. Providing a lot of flexibility allowing users to configure the tools that suit them. This tends to result in a slightly more arms length approach to the integration of tools.

The approach of limiting the tool sets is appropriate for development
environments which concentrate on limited languages, the original model of
IDEs like Eclipse and NetBeans which heavily integrated the Java workflow.

However, Geany supports a wide range of platforms, programming, and
documentation languages, so it is more appropriate that it takes the approach
of providing flexibility.

This document describes the implementation of that flexibility in Geany, how
it is presented to the user and how it is configured using the GUI and by
editing the configuration files.

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

Geany — это текстовый редактор, который позволяет подключать сторонние библиотеки для создания полноценной среды разработки. Geany поддерживает 64 языка программирования. Имеет следующие особенности:

  • быстрый,
  • бесплатный,
  • кроссплатформенный,
  • портабельный,
  • русскоязычный,
  • расширяемый.

В настоящее время одной из самой популярной сред разработки является NotePad++. Эти два редактора основаны на одном движке Scintilla. При этом Notepad++  работает только в среде Windows, а Geany работает под управлением Windows, Linux, FreeBSD , NetBSD , OpenBSD , MacOS X, AIX v5.3 и Solaris Express.

Поэтому среди этих двух программ лучше выбирать Geany.

Основные функции Geany:

  • Подсветка синтаксиса,
  • Поддержка большого количества кодировок,
  • Сворачивание блоков кода,
  • Автозавершение имен,
  • Работа со сниппетами (фрагментами кода),
  • Автоматическое закрытие тегов XML и HTML,
  • Поддержка языков C, Java, PHP, HTML, Python, Perl, Pascal и других,
  • Списки имен,
  • Навигация по коду,
  • Отладка (требуется плагин GeanyGDB),
  • Использование контекстной документации man, Devhelp,
  • Сборка — система для компиляции и исполнения кода,
  • Простое управление проектом,
  • Интерфейс для модулей.

Настройка Geany для AVR Ассемблера

Для улучшенной подсветки синтаксиса AVR Ассемблера выполним команду, которая скачает с оффициального сайта документации шаблон синтаксиса для asm-файлов и сохранит его в домашней директории с настройками для Geany:

Откроем для редактирования в среде Geany какой-нибудь файл с расширением «.asm», можно создать пустой и открыть его. Теперь идем в меню Build — Set Build Commands, откроется окно с настройками для кнопок компиляции, сборки и выполнения. Заполним поля для команд как представлено на рисунке ниже:

Рис. 1. Настройка Geany для компиляции и прошивки микроконтроллеров используя язык AVR Assembler.

Здесь все просто, для каждой из кнопок мы указываем какие из команд нужно выполнять:

  • avra —includepath /usr/share/avra/ «%f»   — компилируем ASM файл, указав папку c INC-файлами для AVR чипов;
  • avr-size %e.hex   — смотрим статистику по размеру получившегося HEX-файла;
  • avrdude -c usbasp -p m8 -P usb -U flash:w:%e.hex   — прошиваем микроконтроллер ATmega8 (ключ -p m8) при помощи программы avrdude.

Сочетание символов «%f» — означает подстановку полного имени открытого файла (например my_program.c), а сочетание символов «%e» — подстановку только имени файла без расширения (например my_program).

Если у вас микроконтроллер другого типа то в команде прошивки для avrdude нужно указать соответствующий ключ -p (partno) с типом вашего микроконтроллера. Узнать значение опции для вашего микроконтроллера можно на страничке документации avrdude: http://www.nongnu.org/avrdude/user-manual/avrdude_4.html

В качестве программатора я использую USB ASP, поэтому если вы используете другой программатор то опция «-c usbasp» должна быть изменена. Список поддерживаемых программаторов и значений опций для avrdude приведены на справочной странице: http://www.nongnu.org/avrdude/user-manual/avrdude_12.html .

Более подробно программу avrdude, ее опции, а также использование с программаторами на онове COM или LPT порта мы рассмотрим в следующей статье. Пока что можете оставить все как есть, позже вы всегда сможете изменить настройки команд под любой тип программатора и микроконтроллера.

При компиляции для команды avra мы указывали путь к INC-файлам, что же это такое? — это файлы (расширение «.inc») с набором макросов и предопределений для конкретных моделей микроконтроллеров что нам будут необходимы в процессе написания наших программ на Ассемблере. Посмотреть список доступных файлов под разные модели чипов можно командой в консоли:

Для того чтобы результат прошивки микроконтроллера через avrdude при помощи кнопки Flash отображался во встроенном терминале нужно в настройках терминала Geany (Edit — Preferences — Terminal) установить галочку напротив пункта «Execute programs in the VTE».

Подготовка

Думаю что для начала наиболее подходящей и простой средой для разработки под чипы AVR является Geany. Позже можно попробовать и другие программы, часть из которых была рассмотрена в предыдущей статье, и потом уже самому выбрать ту которая вам подходит больше всего. К тому же никто не мешает использовать несколько сред для разработки вместе, распределяя между ними задачи. Здесь выбор за вами!

Итак, вы уже , перейдем к настройке данной среды для удобной разработки программ, но прежде разберемся с встроенным терминалом.

В на рисунке 2, где изображен скриншот Geany, снизу слева нет вкладки с названием «Terminal», если у вас также нет терминала то для появления возможности использовать терминал в Geany необходимо установить пакет libvte9:

Дальше мы настроим среду Geany для удобной компиляции и прошивки микроконтроллера при программировании на языках C и Assembler.

Implementation, how flexibility is achieved

Behind the simple menu presentation to the user Geany still has to manage the
complexity of the range of use-cases described in the introduction and map it
to the menu.

This is achieved using a technique that is common in software systems, ordering the
sources of information from most general to most specific and having more
specific settings override less specific ones. Examples of this approach that you
may be familiar with include, object oriented languages where functions
redefined on derived (i.e. more specific) types override the same function of
the (more general) base type, or cascading style sheets for HTML where more
specific and later settings override a less specific/earlier one.

This overriding occurs independently for each position in the build menu, so
some menu items may derive their settings from the user, some from the project
and some from the system sources.

For the build system configuration the sources of the settings are fixed and
the ordering (from general to specific) is:

  1. default settings coded in Geany

  2. settings in the system, that is the installed filetype file for the type of file selected in the editor
  3. settings from the user preferences file
  4. settings from a user configured filetype file for the type of file selected in the editor
  5. settings independent of filetype from the open project file
  6. settings for a specific filetype for the type of file selected in the editor which come from the open project file

Remember the setting from the source lowest in the list “wins”, i.e. that is
what is used in the particular menu item, and each menu item is determined
individually.

Not all the sources will exist, for example the user may have no configured
filetype files or may not have a project open. Missing sources are simply
ignored.

Notice that in reality there are only three sources, system, user and project
settings with project overriding user overriding system. Within each of these,
settings that depend on the filetype of the file selected in the editor are
considered more specific than, and so override, settings for all filetypes.

This simple paradigm handles most of the use cases outlined in the introduction.

Live Preview in Geany

Simply enable the Web helper plugin in Geany‘s plugin manager dialog, open it preferences dialog
and enable the option “Browser auto reload” (to automatically reload the page when you save a file in Geany).

Then you will get a new tab “Web preview” in the left message window (or whereever you configured the plugin
to show up) and you can enter any weg page address, e.g. those of your currently edited Django project.
Below is a screenshot demonstrating the plugin: the opened web page on the left, the template code on the right
and in the terminal window at the bottom, Django‘s runserver command is running:

This way you can edit your Django and template code in Geany as usual and have it automatically shown
as web page in the Web helper plugin without the need of switching to an external browser, and
the Django debug server can also be ran in Geany, using the embedded terminal.

One-time Setup

Run the installer and follow the instructions. In the following we will assume that you installed the 32bit version to C:\mingw32.

After installation, open the msys2 environment via

Next, execute:

pacman --needed -Sy bash pacman pacman-mirrors msys2-runtime

Now exit and re-open the msys2 environment and perform a system update:

pacman -Su

Restart msys2 once more, in case updated environment related packages.

Finally, install the dependencies needed by Geany.

# toolchain
pacman -S mingw-w64-i686-binutils mingw-w64-i686-gcc mingw-w64-i686-gdb
# make and Autotools
pacman -S make pkgconfig autoconf automake libtool intltool
# gtk familiy
pacman -S mingw-w64-i686-gtk2 mingw-w64-i686-gtk3
# for building html docs*
pacman -S mingw-w64-i686-python2 mingw-w64-i686-python2-docutils
# and if you fancy building from git
pacman -S git
# necessary for GTK bundle and installer steps
pacman -S rsync

*If you don’t install python docutils, you will need to pass to .

Make sure you have not installed both and , or you may get errors when building Geany.

At last, you want to add to your PATH environment variable, in order to run Geany from the Windows Explorer.

In case you want also compile the combined GeanyPlugins collection, you need the following dependencies:

# geany-plugins dependencies
pacman -S mingw-w64-i686-check mingw-w64-i686-enchant mingw-w64-i686-lua51 mingw-w64-i686-gpgme mingw-w64-i686-libsoup mingw-w64-i686-libgit2 mingw-w64-i686-gtkspell mingw-w64-i686-webkitgtk2 mingw-w64-i686-webkitgtk3

Приступаем к работе

В статье мы рассматриваем версию 0.16 “Argon”, которая является стабильной и корректно локализованной, а кроме того, входит в состав многих популярных дистрибутивов в виде стандартного пакета или без труда находится в репозитории соответствующего дистрибутива, поэтому при её установке не должно возникнуть никаких проблем (при условии, что у вас установлены ранее упомянутые runtime-библиотеки GTK2). Вопросы инсталляции не относятся к рассматриваемой нами теме, поэтому будем считать, что программа Geany уже присутствует в системе и готова к работе, и приступим к её изучению.

После запуска на рабочем столе появляется окно Geany, показанное на рисунке 1.

Рисунок 1. Окно программы Geany сразу после запуска

Окно действительно напоминает “солидную” интегрированную среду разработки. Под привычной строкой меню и панелью инструментов располагается основное окно просмотра и редактирования исходного кода, занимающее большую часть общей площади, а слева от него находится панель управления тэгами и документами с соответствующими закладками. Что такое “документы”, можно догадаться – это отдельные файлы, а вот с “тэгами” мы разберёмся позже. В нижней части окна размещена панель с пятью закладками – переключателями режимов. Сейчас активна закладка “Статус”, и в панели выводятся строки сообщений о текущем состоянии программы: сначала она “представляется” нам, затем “рапортует” о том, что открыт новый файл, и мы сразу же можем начать ввод исходного кода. Итак, знакомство состоялось!

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

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