Geany is configured as a handy PHP development tool on Ubuntu

Source: Internet
Author: User
Tags sorted by name netbeans



Ubuntu users install the latest version of Geany by adding a PPA source:
sudo add-apt-repository ppa:geany-dev/ppa
sudo apt-get update
sudo apt-get install geany geany-plugins lxterminal
because Geany does not support GNOME3 and KDE terminals, it is necessary to install a lxterminal as a geany built-in terminal.

in the Menu "edit-Preferences-Virtual terminal" can set the terminal font, foreground color, background color and so on.
Editor fonts and terminal fonts I use Dejavu Sans Mono.

in the Menu "Edit-Preferences-shortcut keys" To change the "autocomplete" shortcut to alt+/,
because its default shortcut key is Ctrl+space, it conflicts with the IME.
It is worth mentioning that the input method in the Geany editor cursor does not follow, will always appear in the lower left corner, which is a flaw.

in the Menu "edit-Preferences-file", for example you can set to use GB18030 encoding to open non-Unicode files,
This will open the Simplified Chinese encoding of the file will not be garbled.
and you can also encode and convert in document-Setup file encoding.

in the Menu "edit-Preferences-editor" There are some settings, such as "auto-complete", "Indent", "long line flag", etc.
For example, set the hit letter to automatically complete all the words in the currently open document.
For example, you opened two files functions.php and my.php, when you were editing the contents of my.php,
Geany In addition to the ability to prompt PHP library functions, but also to prompt the function in functions.php.
and after you use a function in the my.php, "Ctrl + Left-click" This function
is able to jump to the location of the function in functions.php.
When a keyword is selected, the Find/mark/Jump feature is also available in the right-click menu "Search".

in the menu "search-Find in multiple files" or use "ctrl+shift+f" to bring up the "Find in Multiple Files" dialog box,
if the shortcut key and IME conflict, you can modify it to "ctrl+alt+f".
This feature of Geany calls the system's grep to find files that contain search keywords in multiple files .
Fast , very stable, specify file suffix, encoding type, search directory and subdirectories, regular, etc. are supported.
The search results appear in the Information window below and click to open the specific line of the file where the search key is located.
If you accidentally search a large directory, use Killall grep to close the process.
in a word, using this function, it is very convenient to find things in the project.
Geany is not as precise as the IDE, such as NetBeans, but fast enough is Geany's position.

Genay Smart hints for PHP library functions come from the support of/usr/share/geany/php.tags,
Of course you can also use Geany to generate your own project's tags file.
For example, into the WordPress directory to generate tags files to the geany User Configuration directory:
geany-g ~/.config/geany/tags/wordpress.php.tags $ (find.-type f-name ' *.php '-o-name ' *.php5 ')
Note that the generated WordPress tags file suffix is. php.tags, and-o indicates the meaning of or (or).
The menu "tools-load Tag file" Loads the generated wordpress.php.tags so that it can take effect without restarting the geany.
Geany comes with a language tags file, the above mentioned Php.tags is just one of them:
Ls-lh/usr/share/geany/*.tags
The official source package Data Directory integrates the latest php.tags files.
More Tags code hints (php/js/html/css, etc.):
Http://wiki.geany.org/tags/start

Snippets Fragment completion (PHP/JS/HTML/CSS, etc.):
Http://wiki.geany.org/snippets/start
For example, the HTML file input form Press the TAB key to complete the fragment, PHP file input for or switch press the TAB key to complete.
Geany fragment completion is defined in snippets.conf:
/usr/share/geany/snippets.conf
~/.config/geany/snippets.conf
snippets.conf is a configurable text file, and you can customize some of your favorite clips.
in the menu "tools-profile" You can open snippets.conf for editing.

color scheme:
Http://wiki.geany.org/themes/start
Put the colorschemes and filedefs in the Geany color scheme into the ~/.config/geany to restart Geany to implement the installation,
in the "View-change color scheme" can choose their favorite color, the first picture of the color scheme is Bespin.

The most recently opened files are ~/.config/geany/geany.conf in the geany master configuration file:
[Files]
recent_files=xxx
you can build a clear.sh to clear the most recently opened files:
#!/bin/bash
sed-i '/recent_files=\//c recent_files= ' ~/.config/geany/geany.conf

in the menu "tools-Plugins Manager" for plug-in management, such as enabling "add-ons", "File Browser", "Treebrowser" and "Pair Tag highlighter".

Some plugins also provide preferences that can be configured inside. For example, in the menu "edit-plugin preferences " Add -ons "in
tick "Mark all occurrences of a word when double-clicking it"
so you can double-click a word and mark all the same words like you did in notepad++.
You can also select the word and press Ctrl+shift+m to mark it, and then press the shortcut again to unmark it.

Pair Tag Highlighter You can implement the click Tag in HTML to highlight it in pairs.
However, sometimes, the old highlight can not be cleaned up in time, then ctrl+s save after the execution ctrl+r reload file.

If you want an IDE-like project manager, enable Treebrowser this plug-in bar,
because my desktop is XFCE, I set the external file manager used by Treebrowser to the XFCE default Thunar, which is Thunar "%d"
since Treebrowser uses xterm to open the terminal in the current directory by default,
replace xterm with lxterminal to let Geany call lxterminal to open the terminal:
sudo mv/usr/bin/xterm/usr/bin/xterm.backup
sudo ln-s/usr/bin/lxterminal/usr/bin/xterm

There is also " Export "plugin, you can export the code file into a highlighted HTML file.
In short, the plugin is still a lot of, here is a C developer using geany developed .

Geany comes with the Tag List very good, it lists the current file's class/function/variable/fixed value and other information,
appear on the left, sorted by name by default, or in the order in which they appear.

geany the compiler command for PHP files corresponds to Php-l "%f" for checking the syntax and executing the command corresponding to PHP "%f" for running the script.
in the menu "build" can be "compile" (grammar check) or "Execute" operation, these operations can be further configured, such as specifying the absolute path of PHP.
information about the Compile action (grammar check) is listed in the Information window below, and the Execute action runs the program (such as a PHP script) in the popup terminal.
The toolbar also provides buttons for easy operation. You can customize your toolbars in your preferences.

Geany can automatically detect the file is modified, and prompts the user to reload, of course, you can also click on the toolbar's Reload button to manually reload.
geany shortcut keys are very convenient, such as ctrl+e can comment and anti-comment.
geany Control and editing of large files is also good, editing a tens of thousands of-line file is very easy, than win on the notepad++ experience is much better.
in the FileZilla Geany is set as the default editor, ftp/sftp remote modification of the file is also very convenient.

about the IDE:
Netbeans Perfect support for Html/css/javascript (JQUERY/ANGULARJS)/php smart tips and documentation tips, rich shortcut keys and macro support,
interface localization, support Xdebug,zenddebugger debugging, support GIT,SVN,HG version control, support PHPUnit unit test and Support remote project development under SSH encryption.
NetBeans dynamically collects the volume of all files under the project in real time, and even if you don't require the file, NetBeans will indicate which file is in which volume.
NetBeans as a ide,geany editor, high and low, work not tired.

Geany is configured as a handy PHP development tool on Ubuntu

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.