Editing Code

From Tekkotsu Wiki

Jump to: navigation, search

Tekkotsu applications should be developed using a text editor that supports syntax highlighting and parenthesis matching. There are several options:

Contents

XEmacs

XEmacs is an advanced text editor available from xemacs.org. XEmacs is recommended because it can automatically reindent code for you (hit tab anywhere on the line, or use M-x indent-region to indent a range of lines.)

  • Linux install: sudo apt-get install xemacs21
  • To turn on syntax and bracket highlighting, install this init.el file in ~/.xemacs/init.el.
mkdir ~/.xemacs
cd ~/.xemacs
wget http://Chiara-Robot.org/download/init.el

vim

vim is an improved version of the vi text editor included with most Linux distributions. To turn on syntax highlighting for fsm files, install this .vimrc file in ~/.vimrc. Do this as "user", not as "root".

sudo apt-get -y install vim
cd
wget http://chiara-robot.org/download/dot-vimrc
mv dot-vimrc .vimrc

gedit

gedit is included with Linux distributions such as Ubuntu that use the Gnome desktop environment

  • Linux install: sudo apt-get install gedit
  • Go to Edit > Preferences and check the "Bracket Matching" and "Display Line Numbers" boxes in the View tab
  • For better-looking syntax highlighting, go to Edit > Preferences > Font & Colors and select the Tango color scheme
  • To permanently turn on syntax highlighting for fsm files under Ubuntu Linux, install this fsm.xml file in ~/.local/share/mime/packages/fsm.xml, and then run "update-mime-database ~/.local/share/mime"
cd
wget http://Chiara-Robot.org/download/gedit-fsm.xml
mkdir -p ~/.local/share/mime/packages
mv gedit-fsm.xml ~/.local/share/mime/packages/fsm.xml
update-mime-database ~/.local/share/mime
  • If you don't follow the previous step, you can turn on syntax highlighting for individual files by going to View > Highlight Mode > Sources > C++

sublime

sublime is a popular alternative to gedit with much greater functionality. It's available at sublimetext.com. A syntax highlighting package for Tekkotsu fsm files for use with sublime, developed by Albert Toledo, is available on github.

kate

kate is included with Linux distributions that use the KDE desktop environment, but it also works in Ubuntu

  • Linux install: sudo apt-get install kate
  • To turn on syntax highlighting for fsm files, go to Settings > Configure Kate > Open/Save > Modes & Filetypes, select Sources/C++, add *.fsm to the list of extensions, and hit Enter to apply the change.
  • Go to Settings > Configure Kate > Editing > Indentation and set the default indentation mode to C Style.
  • Go to View and select Show Line Numbers


Eclipse

Eclipse is a widely-used open source IDE available at Eclipse.org. Visit the Eclipse install instructions page if you need to install Eclipse for C/C++ Developers. If you already have Eclipse installed, follow the last few steps on that page to configure Eclipse for edting Tekkotsu code.


XCode (MacOS)

XCode is an Eclipse-like IDE for the Mac.