vim with syntax highlighting Re: [Asterisk-Users] Best GPL Gui?
Robert Michel
news at robertmichel.de
Mon Jul 3 14:20:14 MST 2006
Salve C, salve Tzafirir!
What a short name....
On Mon, 03 Jul 2006, C F wrote:
> Thanks Tzafrir, I realy enjoyed reading it.
me, too.
> On 7/3/06, Tzafrir Cohen <tzafrir.cohen at xorcom.com> wrote:
> >[off-topic]
Not 100%, I'm a asterisk newbee and think that the
rigth editor with syntaxhighlighting can help much ;)
> >On Sun, Jul 02, 2006 at 10:56:03AM -0400, C F wrote:
> >And if you wondered about the license of vim: a copyleft license quite
> >similar to the GPL, and in recent versions: also compatible with it. and
> >contribution to the children of Uganda are always welcomed.
This charity *and* vim itself are great honorable work from Bram!
> >Now you were asking something about a web interface?
*g* I would propose ssh2 and if I want to use it from
the internetterminals of my bibliothek some java ssh2 client
like mindterm....
Than you can use vim via web ;)
And vim is powerfull, unbeleavable powerfull
-but you have to like to learn and read the
buildin help and all the external tips and tricks.
Syntaxhighlighting for extensions.conf:
1) Does your terminal support colors?
try ls --color
2)seriosly systems should have vim already installed
when not do so
3) cd /usr/share/vim/vim63/syntax
4)grep -RO ftp://ftp.informatik.uni-oldenburg.de/pub/vim/runtime/syntax/asterisk.vim
when you use MP3Player() then open asterisk.vim and add:
syn match asteriskApp ",\zsMP3[a-zA-Z]\+\ze(" "added by rob
5)add inside: /usr/share/vim/vim63/filetype.vim
" Apache style config file
au BufNewFile,BufRead extensions.conf setf asterisk
next time you open extensions.conf with vim
you should have a colored world of asterisk :)
Some small tricks with vim.
You are opening /extensions.conf every day?
You whant to swith to a pattern e.g. exten => 2345 directly?
1)Write a small skript
#!/bin/bash
#ast-e.sh
vim +/$1 /etc/asterisk/extensions.conf
2) chmod u+x....
3) add inside your ~/.bashrc
alias ast-e='/home/user/skripte/ast-e.sh'
After a restart of your bash you can type
#ast-e 2345
And the best of this (of vim of course)
you can swicht to the next 2345 by pressing
n, as you would do after
vim /etc/asterisk/extensions.con
/2345
alias ast-m='vim -R + /var/log/asterisk/cdr-csv/Master.csv'
would help to start readonly on the last page...
I'm working on asteriskcsv.vim
AFAIK is it possible to create syntax highlighting
in context over several lines -
exten => rob,1,
exten => rob,1, <= that 1 would become red
And the best 2 month ago Bram published vim7
with:
- Spell checking support for about 50 languages
- Intelligent completion for C, HTML, Ruby, Python, PHP, etc.
- Tab pages, each containing multiple windows
- Undo branches: never accidentally lose text again
- Highlighting of cursor line, cursor column and matching braces
(Haven't time to play with vim7)
Does anybody knows about a try to have intelligent code
completion for asterisk inside vim?
I think would be somthink like this:
[e]TABxten => [123],1,[A](Answer|Auto..)TABanswer()[Return]
exten => 123,2,[M]
And with scripting some cool thinks would be possible,
cloning extentions, changing nummers of on block,
So it is not only the question of a good tool,
it is also the question how good your skills are
to use the power of it ;)
> >Now you were asking something about a web interface?
http://www.mindterm.com/products/80_MindTerm/index.php
but wait, it isn't GPL anymore sie jsch from jcraft
http://www.jcraft.com/jsch/index.html
to use vim with screen and ssh2.
http://www.vim.org
http://www.gnu.org/software/screen/
Probably just another answer about a GUI for asterisk,
C, doesn't expected.
So again, does somebody knows about intelligent asterisk
completion with vim7?
Greetings,
rob
PS1: The shellpower: Erlang - the movie
http://video.google.com/videoplay?docid=-5830318882717959520
PS2: Tzafirir thank you for the bash -x tip,
the debuggmessages are visible inside the CLI ;)
More information about the asterisk-users
mailing list