hi,
i'm using https://github.com/miconda/vscode-kamailio-syntax in VScode. its great!
But i need format code. Are there some formatters for kamailio.cfg? It can be for other editors than VScode.
Marek
The only other Kam syntax I know of is for vim
https://github.com/kamailio/vim-kamailio-syntax
Regards, --Sergiu
On Tue, Nov 24, 2020 at 11:39 AM marek cervajs64@gmail.com wrote:
hi,
i'm using https://github.com/miconda/vscode-kamailio-syntax in VScode. its great!
But i need format code. Are there some formatters for kamailio.cfg? It can be for other editors than VScode.
Marek
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Besides the vim syntax for Kamailio that you pointed and the one for VSCode pointed by Marek, I also wrote one for Atom editor:
* https://github.com/miconda/atom-extensions/tree/master/language-kamailio
But probably is not updated with the latest core keywords.
Then, even older and not updated (to my knowledge) is the of for mcedit (midnight commander editor), I wrote a blog post about:
* http://blog.miconda.eu/2010/04/mc-edit-syntax-highlighting-for.html
So, to summarize, there should be syntax highlighting (maintained at different levels) for the editors:
* vim (I guess also neovim) * vscode * atom * mcedit
Cheers, Daniel
On 24.11.20 18:24, Sergiu Pojoga wrote:
The only other Kam syntax I know of is for vim
https://github.com/kamailio/vim-kamailio-syntax https://github.com/kamailio/vim-kamailio-syntax
Regards, --Sergiu
On Tue, Nov 24, 2020 at 11:39 AM marek <cervajs64@gmail.com mailto:cervajs64@gmail.com> wrote:
hi, i'm using https://github.com/miconda/vscode-kamailio-syntax <https://github.com/miconda/vscode-kamailio-syntax> in VScode. its great! But i need format code. Are there some formatters for kamailio.cfg? It can be for other editors than VScode. Marek _______________________________________________ Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org <mailto:sr-users@lists.kamailio.org> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users <https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users>
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
On 11/24/20 1:48 PM, Juha Heinanen wrote:
Daniel-Constantin Mierla writes:
So, to summarize, there should be syntax highlighting (maintained at different levels) for the editors:
* vim (I guess also neovim) * vscode * atom * mcedit
Long list, but unfortunately the oldest editor is missing: emacs.
The lack of `ed` support is mortifying.
On 24.11.20 21:56, Alex Balashov wrote:
On 11/24/20 1:48 PM, Juha Heinanen wrote:
Daniel-Constantin Mierla writes:
So, to summarize, there should be syntax highlighting (maintained at different levels) for the editors:
* vim (I guess also neovim) * vscode * atom * mcedit
Long list, but unfortunately the oldest editor is missing: emacs.
The lack of `ed` support is mortifying.
Life is so harsh sometimes ... but you can fight this one, contribute it ;-) !
Cheers, Daniel
On 24.11.20 19:48, Juha Heinanen wrote:
Daniel-Constantin Mierla writes:
So, to summarize, there should be syntax highlighting (maintained at different levels) for the editors:
* vim (I guess also neovim) * vscode * atom * mcedit
Long list, but unfortunately the oldest editor is missing: emacs.
vim and mcedit variants were initially contributed from community, I kept updating the one for vim because I use the editor.
I never used emacs, so I cannot help, but if someone contributes syntax highlighting file for it, can be imported in the project repo.
Cheers, Daniel
ok thanks. these things are for highlighting, but i asked about formatting
something like
https://code.visualstudio.com/docs/languages/typescript
section "Formatting"
any tips? Marek
Dne 24/11/2020 v 19:42 Daniel-Constantin Mierla napsal(a):
Besides the vim syntax for Kamailio that you pointed and the one for VSCode pointed by Marek, I also wrote one for Atom editor:
* https://github.com/miconda/atom-extensions/tree/master/language-kamailio
But probably is not updated with the latest core keywords.
Then, even older and not updated (to my knowledge) is the of for mcedit (midnight commander editor), I wrote a blog post about:
* http://blog.miconda.eu/2010/04/mc-edit-syntax-highlighting-for.html
So, to summarize, there should be syntax highlighting (maintained at different levels) for the editors:
* vim (I guess also neovim) * vscode * atom * mcedit
Cheers, Daniel
On 24.11.20 18:24, Sergiu Pojoga wrote:
The only other Kam syntax I know of is for vim
https://github.com/kamailio/vim-kamailio-syntax https://github.com/kamailio/vim-kamailio-syntax
Regards, --Sergiu
On Tue, Nov 24, 2020 at 11:39 AM marek <cervajs64@gmail.com mailto:cervajs64@gmail.com> wrote:
hi, i'm using https://github.com/miconda/vscode-kamailio-syntax <https://github.com/miconda/vscode-kamailio-syntax> in VScode. its great! But i need format code. Are there some formatters for kamailio.cfg? It can be for other editors than VScode. Marek _______________________________________________ Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org <mailto:sr-users@lists.kamailio.org> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users <https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users>
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
-- Daniel-Constantin Mierla --www.asipto.com www.twitter.com/miconda --www.linkedin.com/in/miconda Funding:https://www.paypal.me/dcmierla
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
On Tue 24 Nov 2020, 20:21 marek, cervajs64@gmail.com wrote:
ok thanks. these things are for highlighting, but i asked about formatting
In Vim, I would type 'gg=G' to format the indentation.
Bring lazy I put the below in my .vimrc so I can just hit F7
map <F7> gg=G<C-o><C-o>
-Barry
something like
https://code.visualstudio.com/docs/languages/typescript
section "Formatting" any tips? Marek
Dne 24/11/2020 v 19:42 Daniel-Constantin Mierla napsal(a):
Besides the vim syntax for Kamailio that you pointed and the one for VSCode pointed by Marek, I also wrote one for Atom editor:
https://github.com/miconda/atom-extensions/tree/master/language-kamailio
But probably is not updated with the latest core keywords.
Then, even older and not updated (to my knowledge) is the of for mcedit (midnight commander editor), I wrote a blog post about:
So, to summarize, there should be syntax highlighting (maintained at different levels) for the editors:
- vim (I guess also neovim)
- vscode
- atom
- mcedit
Cheers, Daniel On 24.11.20 18:24, Sergiu Pojoga wrote:
The only other Kam syntax I know of is for vim
https://github.com/kamailio/vim-kamailio-syntax
Regards, --Sergiu
On Tue, Nov 24, 2020 at 11:39 AM marek cervajs64@gmail.com wrote:
hi,
i'm using https://github.com/miconda/vscode-kamailio-syntax in VScode. its great!
But i need format code. Are there some formatters for kamailio.cfg? It can be for other editors than VScode.
Marek
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Kamailio (SER) - Users Mailing Listsr-users@lists.kamailio.orghttps://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
-- Daniel-Constantin Mierla -- www.asipto.comwww.twitter.com/miconda -- www.linkedin.com/in/miconda Funding: https://www.paypal.me/dcmierla
Kamailio (SER) - Users Mailing Listsr-users@lists.kamailio.orghttps://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
I haven't done any formatting extensions, that's why I didn't reply to your email, but to the one from Sergiu to complete the list of syntax highlighting options.
I use rarely gg=G with vim, as pointed in another response, but for me it shifts left the comments in route blocks, so in most of the cases I just do the formatting manually, allowing me to also review/understand config content, as I typically need that when I do consultancy services. When I build configs, I do it formatted using tabs indentation (like in default kamailio.cfg).
As another idea, in VSCode you can change the file type (Change Language Mode) to something else (like javascript, shell, c, ...), then do document format and see if the result is satisfactory. With some file types I noted it doesn't work at all, because the formatter is based on compiler/interpreter for that language and obviously fails with kamailio.cfg, but maybe worth giving a try ...
And of course, one can write a formatter for kamailio.cfg and contribute it to the community -- no plans now in my side for doing one.
Cheers, Daniel
On 24.11.20 21:19, marek wrote:
ok thanks. these things are for highlighting, but i asked about formatting
something like
https://code.visualstudio.com/docs/languages/typescript
section "Formatting"
any tips? Marek
Dne 24/11/2020 v 19:42 Daniel-Constantin Mierla napsal(a):
Besides the vim syntax for Kamailio that you pointed and the one for VSCode pointed by Marek, I also wrote one for Atom editor:
* https://github.com/miconda/atom-extensions/tree/master/language-kamailio
But probably is not updated with the latest core keywords.
Then, even older and not updated (to my knowledge) is the of for mcedit (midnight commander editor), I wrote a blog post about:
* http://blog.miconda.eu/2010/04/mc-edit-syntax-highlighting-for.html
So, to summarize, there should be syntax highlighting (maintained at different levels) for the editors:
* vim (I guess also neovim) * vscode * atom * mcedit
Cheers, Daniel
On 24.11.20 18:24, Sergiu Pojoga wrote:
The only other Kam syntax I know of is for vim
https://github.com/kamailio/vim-kamailio-syntax https://github.com/kamailio/vim-kamailio-syntax
Regards, --Sergiu
On Tue, Nov 24, 2020 at 11:39 AM marek <cervajs64@gmail.com mailto:cervajs64@gmail.com> wrote:
hi, i'm using https://github.com/miconda/vscode-kamailio-syntax <https://github.com/miconda/vscode-kamailio-syntax> in VScode. its great! But i need format code. Are there some formatters for kamailio.cfg? It can be for other editors than VScode. Marek _______________________________________________ Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org <mailto:sr-users@lists.kamailio.org> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users <https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users>
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
-- Daniel-Constantin Mierla -- www.asipto.com www.twitter.com/miconda -- www.linkedin.com/in/miconda Funding: https://www.paypal.me/dcmierla
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users