If you use the GNU Emacs editor you can use some helper functions we have created to ease the development process. Remember that this is fairly quick hacks made to speed up our development process. Not a lot of time has been used on them so don't be surprised if it blows up ;)
The code is in the elisp file at conf/emacs/openengine.el
To use it just add the following to your .emacs file after updating the file location to match your setup.
(load-file (concat (getenv "HOME") "/path/to/conf/emacs/openengine.el"))
The code contains three functions. All can be run by M-x oe-* RET .
- oe-doc
- Creates a documentation comment for a function.
- oe-class
- Creates a class template from the buffer name and file location.
- oe-compile
- Compiles the project by help of the make.sh script contained in the distribution.
The default key bindings are:
C-c C-r -- run the project binary (note that this does not compile in the case of changes). C-c C-v -- compile the project C-c C-t -- compile and run test-auto target C-c C-f -- compile the doxygen documentation (requires doxygen support and places the doc in build/doc/html).
In order to adhere to our CodingConventions we recommend adding something along the line of the following to your .emacs file. It configures emacs to use four spaces for indentation and no tabs.
(add-hook 'c-mode-common-hook (lambda () (setq tab-width 4) (setq c-basic-offset tab-width) (setq indent-tabs-mode nil)))
Nice modes / extensions for Emacs:
If you are using Gentoo these are easy to install. Emacs on Gentoo
- ido.el
- IDO is my "interactively do" package which provides replacements for the switch-buffer and find-file functions (and the various versions of these functions) for switching between buffers and opening files with an absolute minimum of keystrokes. This is included in Emacs 22.1. [ Link]
- cua.el
- CUA mode provides a complete emulatation of the standard CUA key bindings (Motif/Windows/Mac? GUI) for selecting and manipulating the region where S-<movement> is used to highlight & extend the region and (almost) transparently allows you to use the C-z, C-x, C-c, and C-v keys as you are accustomed to on systems like Windows. This is included in Emacs 22.1. [ Link]
- color-theme
- Color theme is an Emacs-Lisp package with more than 50 color themes for your use. [ Link]
- doxymacs
- The purpose of the doxymacs project is to create a LISP package that will make using Doxygen from within {X}Emacs easier. [ Link]
- cedet package
- CEDET is a collection of tools written with the end goal of creating an advanced development environment in Emacs. [ Link]
- ECB
- ECB stands for "Emacs Code Browser". While Emacs already has good editing support for many modes, its browsing support is somewhat lacking. That's where ECB comes in: it displays a number of informational windows that allow for easy source code navigation and overview. [ Link]
- backup-dir.el
- Nice extension to save all emacs backup files in one directory instead of all over your code. Here is what you should add to your ~/.emacs file.
;; Setting backup dir - store all bacup files in a central place so they ;; are not all over the place (require 'backup-dir) (setq bkup-backup-directory-info '((t "~/.emacs.d/backup" ok-create full-path)))
- glsl-mode.el
- Major mode for editing OpenGLSL grammar files, usually files ending with .vert' and .frag'. Is is based on c-mode plus some features and pre-specified fontifications.
;; OpenGL Shading Language. Please make sure your glsl-mode.el file is in your emacs load path
(autoload 'glsl-mode "glsl-mode" nil t)
(add-to-list 'auto-mode-alist '("\\.vert\\'" . glsl-mode))
(add-to-list 'auto-mode-alist '("\\.frag\\'" . glsl-mode))
Attachments
-
backup-dir.el
(22.7 KB) - added by Anders Bach Nielsen <abachn@daimi.au.dk>
5 years ago.
Added backup-dir.el - save all emacs backup files in one directory instead of the default location next to the original file
-
glsl-mode.el
(5.8 KB) - added by Anders Bach Nielsen <abachn@daimi.au.dk>
5 years ago.
OpenGL Shading Language mode for Emacs
