HomeMiscellaneous

Vim and Emacs


Scripts and tips for VIM editor

Boussole: a simple tagged file navigator

A plugin for Vim which allows to navigate through edited file ising a list of "tags". Tags are created by an external format and are stored in a tag file.

Every line in this file corresponds to a tag; leading numeric characters of a tag are considered as source code line number, while rest of line is considered as tag decription.

For example, grep -n "^(define" $1 | sed 's/:/ /' will create a simple tag list for a Scheme source code file. Default name for this command is defined in boussole.vim as: s:tagextractor_command = "stg" Place boussole.vim in Vim plugin directory and a tag extractor somewhere in your PATH and include a key mapping in .vimrc: nmap <F1> :Tml<CR> and "F1" in normal mode will open a window with a list of tags.

'Enter' while cursor is in the line of desired tag will close tag buffer and move cursor to the selected declaration.

'Space' while cursor is in the line of desired tag will show corresponding declaration in another buffer

'q' will close tag buffer


Display status line information in ruler line

With the settings provided below information usually shown in the status line (such as cursor position and file modification flag) may be seen in the ruler line.

set laststatus=1        "show status line for multiple buffers only
set rulerformat=%30(%<%m%y%h%r%=%l,%c\ %P%)
If you want to include the current byte number just insert the %o in the rulerformat string.


Langmap setting for Cyrillic keyboard

It makes it possible to execute normal mode commands when keyboard is in cyrillic mode.

This line is for koi8-r encoding, in case of some another one you have to use a recoder against this string.


Date/Time stamps

Press triple "q" then "Enter" to insert time-stamp

iab qqq  <C-R>=strftime("%a %b %d %H:%M:%S %Y")


Comment out/uncomment the region of Scheme code

Include this in your .vimrc file:

vmap  o  :s/^/;/<CR>	"Comment out region: 'o' in Visual mode 
vmap  O  :s/^;//<CR>	"Uncomment it: 'O' 
Now, pressing "o" in Visual mode will just insert a semicolon in the first column of every line selected, and the "O" will remove such semicolon (if any).



Emacs/Scheme links

Quack
Emacs support for Scheme (and SXML)

Bee
Bigloo Integrated Programming Environment

HomeMiscellaneous