Difference between revisions of "CudaText"

From Free Pascal wiki
Jump to navigationJump to search
Line 104: Line 104:
  
 
If program runs and cannot find "data/lexlib" near it, it opens dirs from "~/.cudatext". This allows to install binary to PATH, and data dirs to homedir.
 
If program runs and cannot find "data/lexlib" near it, it opens dirs from "~/.cudatext". This allows to install binary to PATH, and data dirs to homedir.
 +
 +
==Linux Qt==
 +
For CudaText Qt version, library libQt4Pas needed.
 +
 +
For Ubuntu: install it using apt-get.
 +
For all: [[Qt_Interface#Quick_start_guide_for_Linux]]
 +
You need to download binary from libQt4Pas homepage.
  
 
== more ==
 
== more ==

Revision as of 23:12, 3 September 2015

About

CudaText is a cross-platform text editor, written in Lazarus.

  • Syntax highlight for many languages: C, C++, Java, Pascal, JavaScript, HTML, CSS, PHP, Python, XML... totally about 140 lexers exist.
  • Code folding.
  • Multi-carets, multi-selections.
  • Find/replace with regex.
  • Command palette like ST3.
  • Text configs.
  • Made on ATSynEdit engine.

Image:

cudatext.png

Download

Homepage: http://uvviewsoft.com/

Versions for Windows, Linux, OS X exist.

Configs

Editor has config system like ST3 editor: call menu item "Settings-default" and you'll see default config. Copy any lines to config called by "Settings-user" and edit lines in this user config. Config saves in JSON. Default config is not read, only user config is read.

Lexer-override config: settings for single lexer only. E.g., if you open Pascal file, lexer-override for Pascal is read after user config. You can call it via Options menu.

File-types config: specify in it mapping between file types (name or extension) and lexer names. Such mapping exists in lexer-library, this config overrides it. You can call it via Options menu.

Color-theme: one of color theme configs may be selected via Options menu. It will define all colors in app. You can create new color themes also via Options menu, "Color theme" dialog.

Help topics

Mouse shortcuts

Multi-carets:

  • Ctrl+click - add/delete caret
  • Ctrl+drag - add caret with selection
  • Ctrl+Shift+click - add carets column in several lines (from previous caret to clicked line)

Select:

  • Alt+drag - select column of text (Note: it may look weird if word-wrap on, because wrap is not considered here at all. Simple rectangle of coordinates [x1,y1]-[x2,y2] is always selected, even if this gives bad looking screen)
  • drag on gutter's line numbers - select by entire lines
  • double-click and immediately drag - select text by words

Clicks:

  • double-click - select clicked word
  • triple-click - select entire line (limited by end-of-lines)
  • middle-button click - start "Browser Scroll" mode: circle mark appears and mouse moving around this mark auto-scrolls text in 4 directions; speed of scrolling depends on distance of cursor from circle mark (any click to turn off)

Lexers

Lexers (syntax hiliters) from SynWrite editor used. Used EControl.ru syntax parser with mods. Main mod is support for folding in Python.

  • Dialog "Lexer prop" allows to config some props of current lexer (selected via statusbar panel in CudaText). You can config: lexer name, file types, line-comment-string for language, styles (colors, font-styles, border-styles).
  • Dialog "Lexer library" shows list of all lexers. It's file "data/lexlib/lib.lxl" (can be changed by option). You can delete items, or config them.

Lexer library file has only subset of lexers. Other lexers (from SynWrite) are here: http://sourceforge.net/projects/synwrite-addons/files/Lexers/

These zip packages can be installed in CudaText: open any zip file via "File--Open" and confirm installation.

Note. After reinstalling of app, lexer library may be reset. You'll need to re-add lexers you added. So make a copy of file in "data/lexlib" and set this copy name in config: option "lexlib".

Lexers editing

You can modify/create lexers. But not in CudaText. Install SynWrite (needed Wine on Linux) and in it you have lexer editor dialog.

  • In Synwrite call menu "Options--Addons manager--Install", install needed lexer from web. Synwrite lexer-library must have lexer before you edit it.
  • In Synwrite call "Lexer prop" dialog and edit all you need. Or make new lexer.
  • In Synwrite install "ExLexer" addon. Call it in "Plugins" menu, select needed lexer. You have exported zip file.
  • In CudaText open this zip file. Confirm installation of lexer.

File-types config

Menu item "Settings - file-types" allows to edit file-types config. Example of file:

 {
   "*.mht": "HTML",
   "myconfig.conf": "Nginx",
   ".profile": "Bash script",
 }
 

This allows to open files with extension "mht" with custom lexer, and file with name "myconfig.Conf" with another custom lexer. Value "-" means "don't activate lexer".

Other method is to call "settings--lexers--lexer properties" dialog. But this writes option to the lexer-library file, so it's reset on reinstalling.

Linux installation

On Linux you can install program in such way:

  • copy file "cudatext" to folder /usr/bin or any other
  • copy dirs (data, readme, settings_default) to "~/.cudatext"

If program runs and cannot find "data/lexlib" near it, it opens dirs from "~/.cudatext". This allows to install binary to PATH, and data dirs to homedir.

Linux Qt

For CudaText Qt version, library libQt4Pas needed.

For Ubuntu: install it using apt-get. For all: Qt_Interface#Quick_start_guide_for_Linux You need to download binary from libQt4Pas homepage.

more

FAQ

1) I installed app: Linux (deb), or OSX. I see outdated history.txt, and outdated default settings.

You need to delete dirs (data, readme, settings_default) inside "~/.cudatext". They will be re-created on next program run (from "/usr/share/cudatext" on Linux, or from app resources on OSX).

2) How to config colors?

Open dir "data/themes" (inside portable dir, or inside "~/.cudatext" for installed app). Add json file(s) there. Select them in program in "Color themes" menu.