Text editor: Difference between revisions

From 太極
Jump to navigation Jump to search
No edit summary
No edit summary
Line 77: Line 77:
* Markdown preview feature is OK but it cannot export to pdf or HTML.
* Markdown preview feature is OK but it cannot export to pdf or HTML.
* pandoc conversion to html/PDF is not good; scripts part has no rectangle, tables have no separate lines.  
* pandoc conversion to html/PDF is not good; scripts part has no rectangle, tables have no separate lines.  
== Packages ==
== Packages ==
To install a new package, go to Preferences -> Install -> type the package name and hit ENTER.
To install a new package, go to Preferences -> Install -> type the package name and hit ENTER.
Line 87: Line 88:
* [https://atom.io/packages/markdown-preview-enhanced Markdown Preview Enhanced]. It allows to view in browser (html) or export to PDF. Use '''r''' instead of '''R''' for R language syntax highlight. Another nice feature is the scrollings of the markdown file and preview are together.
* [https://atom.io/packages/markdown-preview-enhanced Markdown Preview Enhanced]. It allows to view in browser (html) or export to PDF. Use '''r''' instead of '''R''' for R language syntax highlight. Another nice feature is the scrollings of the markdown file and preview are together.
* [https://atom.io/packages/markdown-toc Markdown TOC]. It messes up the # sign in script blocks :( So I switch to RStudio which has a good support to [http://rmarkdown.rstudio.com/html_document_format.html create the TOC] (YAML header).
* [https://atom.io/packages/markdown-toc Markdown TOC]. It messes up the # sign in script blocks :( So I switch to RStudio which has a good support to [http://rmarkdown.rstudio.com/html_document_format.html create the TOC] (YAML header).
= Gedit =
* To create a new tab, Ctrl + t.
* Preferences
** View: display line numbers, highlight current line
** Font and colors: change to font size 14, color scheme = Cobalt
** Plugins: External Tools
* To split a screen, Do "Documents -> New Tab Group. No extra plugin is needed to download. I am using version 3.10.4 from Ubuntu 14.04.
* [https://github.com/Quixotix/gedit-restore-tabs Restore tabs] plugin. It works on my gedit 3.4 (ubuntu 12.04). Follow the instruction there exactly.
* [https://github.com/Quixotix/gedit-source-code-browser Source code browser] plugin. This makes gedit a good IDE for developing C++/Java code since the left panel can show symbols. Click F9 to show the side panel.
* [https://raw.githubusercontent.com/mig/gedit-themes/master/darkmate.xml Darkmate theme].
<pre>
cd /usr/share/gtksourceview-3.0/styles
sudo gedit darkermate.xml
</pre>
gedit > Edit > preferences > font and colors > color scheme.
== Launch from a command line ==
<pre>
gksu gedit XXXX
</pre>
== Plugins ==
* Gedit has no built-in options to show special characters except through [https://wiki.gnome.org/GeditPlugins gedit-plugins] (sudo apt-get install gedit-plugins). See [http://stackoverflow.com/questions/17162851/option-to-display-control-characters-in-gedit Draw Spaces].
* [https://cs50.stackexchange.com/questions/2026/how-do-i-open-a-terminal-window-in-gedit How do I open a Terminal window in gEdit?]
*# sudo apt-get install gedit-plugins
*# Edit -> Preferences -> Plugins -> Embedded terminal
*# View -> Bottom panel
= [http://www.geany.org/ Geany] =
'''Geany''' can be used to run a bash script file line by line. See [[Linux_Programming#Debugging_Scripts|Debugging_Scripts]].
== Display special characters ==
Geany has a way to show special characters (Tabs/LF/CR). Edit > Preferences > Display > Tick, Show whitespace (tabs) & Show Line endings(CR/LF).
For DOS text file, the line ending is CR+LF.
For Unix text file, the line ending is LF.
== Font size ==
Users can use either one of the following methods
# Edit -> Preferences -> Interface -> Fonts to adjust the font size.
# Keyboard bindings: Ctrl + Shift + '+' to increase the font size or Ctrl + '-' to decrease the font size. This does not affect the font size in Preferences.
== Printing ==
The font size in Preferences affects the printing. The font size changed by using the keyboard bindings does not affect printing.
== Remove vertical line ==
Edit -> Preferences -> Editor -> Display -> Uncheck Long line marker.


= Visual Studio Code =
= Visual Studio Code =

Revision as of 22:23, 12 October 2018

Platforms Pros Cons
Atom Cross built-in markdown file preview
Bluefish Cross remote file, project support crash when I try Print->Preview
Brackets Cross good for web designer
Emacs Cross split the buffers
Gedit Cross print preview (incorrect when landscape but pdf is right) no code folding
Geany Cross print preview; Terminal; split window
IntelliJ IDEA Cross
Notepad++ Win print line numbers, Right-click menu R syntax highlight not work with most themes
Qt Creator Cross split a window (even same file)
RStudio Cross folding, best IDE for R coding not support drag and drop a file but SendTo works
Sublime Cross
vi Cross
Visual Studio Code Cross Integrated Terminal, Markdown preview Should not include minimap function


HTML editors: see here.

Atom

  • Markdown preview feature is OK but it cannot export to pdf or HTML.
  • pandoc conversion to html/PDF is not good; scripts part has no rectangle, tables have no separate lines.

Packages

To install a new package, go to Preferences -> Install -> type the package name and hit ENTER.

To remove a package, just delete the related folder.

rm -rf ~/.atom/packages/markdown-toc
  • Markdown Preview Enhanced. It allows to view in browser (html) or export to PDF. Use r instead of R for R language syntax highlight. Another nice feature is the scrollings of the markdown file and preview are together.
  • Markdown TOC. It messes up the # sign in script blocks :( So I switch to RStudio which has a good support to create the TOC (YAML header).

Gedit

  • To create a new tab, Ctrl + t.
  • Preferences
    • View: display line numbers, highlight current line
    • Font and colors: change to font size 14, color scheme = Cobalt
    • Plugins: External Tools
  • To split a screen, Do "Documents -> New Tab Group. No extra plugin is needed to download. I am using version 3.10.4 from Ubuntu 14.04.
  • Restore tabs plugin. It works on my gedit 3.4 (ubuntu 12.04). Follow the instruction there exactly.
  • Source code browser plugin. This makes gedit a good IDE for developing C++/Java code since the left panel can show symbols. Click F9 to show the side panel.
  • Darkmate theme.
cd /usr/share/gtksourceview-3.0/styles
sudo gedit darkermate.xml

gedit > Edit > preferences > font and colors > color scheme.

Launch from a command line

gksu gedit XXXX

Plugins

Geany

Geany can be used to run a bash script file line by line. See Debugging_Scripts.

Display special characters

Geany has a way to show special characters (Tabs/LF/CR). Edit > Preferences > Display > Tick, Show whitespace (tabs) & Show Line endings(CR/LF).

For DOS text file, the line ending is CR+LF.

For Unix text file, the line ending is LF.

Font size

Users can use either one of the following methods

  1. Edit -> Preferences -> Interface -> Fonts to adjust the font size.
  2. Keyboard bindings: Ctrl + Shift + '+' to increase the font size or Ctrl + '-' to decrease the font size. This does not affect the font size in Preferences.

Printing

The font size in Preferences affects the printing. The font size changed by using the keyboard bindings does not affect printing.

Remove vertical line

Edit -> Preferences -> Editor -> Display -> Uncheck Long line marker.

Visual Studio Code

10 Essential Productivity Tips for Visual Studio Code

Sublime

Install it from the Snap Store on Linux

My settings file which takes care of the scheme, font size and word wrap.

{
	"color_scheme": "Packages/Color Scheme - Default/Monokai.sublime-color-scheme",
	"font_size": 16,
	"open_files_in_new_window": false,
	"word_wrap": true,
	"theme": "Default.sublime-theme"
}

Theme

Write or Code Faster in Your Linux Text Editor With Custom Themes