Mirror of the Rel4tion website/wiki source, view at <http://rel4tion.org>
Clone
HTTPS:
git clone https://vervis.peers.community/repos/yEzqv
SSH:
git clone USERNAME@vervis.peers.community:yEzqv
Branches
Tags
editor-support.mdwn
Nothing currently. Help always welcome.
Editors and widgets to which Idan support could be added:
- Vim
- Emacs
- GtkSourceView
For static syntax highlighting of code for presentation, see [[syntax-highlighting]].
Vim
Currently, Vim is the editor I use on a daily basis. I tried to learn Emacs in the past, and I will try again in the future, but right now Vim is what I know and it will be the first editor I’ll work with for Idan support.
In particular, help with GNU Emacs will be greatly appreciated.
On my machine, running Trisquel, there is a file /usr/share/vim/vim74/filetype.vim
. That file detects file types using their extensions, and sets the filetype
variable accordingly. The first step is to add support for detecting Idan and setting the file type correctly.
A fragment to add there (or somewhere else) for Idan could be:
" Idan
au BufNewFile,BufRead *.idan setf idan
au BufNewFile,BufRead *.idanl setf idanl
This text can be placed in a file ~/.vim/ftdetect/idan.vim
It seems file types can do 3 things: indentation, syntax highlighting and plugins. The basic things needed for Idan are:
- Indentation settings
- Syntax highlighting
The indentation can be done using a filetype plugin. Put the following in a new file ~/.vim/ftplugin/idan.vim
:
" Vim filetype plugin file
" Language: Idan
" Maintainer: fr33domlover <fr33domlover@riseup.net>
" Latest Revision: 2015-03-23
" Based on the Haskell syntax file by Nikolai Weibull <now@bitwi.se>
if exists("b:did_ftplugin")
finish
endif
let b:did_ftplugin = 1
let s:cpo_save = &cpo
set cpo&vim
let b:undo_ftplugin = "setl com< cms< fo<"
setlocal comments=s1fl:{-,mb:-,ex:-},:-- commentstring=--\ %s
setlocal formatoptions-=t formatoptions+=croql
setlocal shiftwidth=4 softtabstop=4 expandtab shiftround number
setlocal tabstop=4 colorcolumn=80 copyindent autoindent
let &cpo = s:cpo_save
unlet s:cpo_save
Now, what exactly does all of that mean? It’s Haskell’s file plus things from my vimrc, but I definitely should figure out what each line does and update as needed.
For syntax highlighting, define the rules in ~/.vim/syntax/idan.vim
and in ~/.vim/syntax/idanl.vim
. I’m going to base the work on existing files:
/usr/share/vim/vim74/syntax/haskell.vim
/usr/share/vim/vim74/syntax/lhaskell.vim
- [[http://www.vim.org/scripts/download_script.php?src_id=6882|n3.vim]]