flat assembler
Message board for the users of flat assembler.
Index
> Main > VIM support for FASM Goto page 1, 2 Next |
Author |
|
vid 26 Nov 2003, 19:34
someone could write VIM filetype plugin for FASM. I would but i am new to VIM so best i managed is syntax highlighting script (attached).
It should be quite easy to make plugin (with folding, jump-to-definition, register/instruciton completion etc.) compared to effort you get - new vi-based FASM IDE.
|
|||||||||||
26 Nov 2003, 19:34 |
|
vid 08 Jan 2004, 19:27
1. folding procedures declared with 'proc'...'return' including comments before procedure to fold. Maybe folding of paragraphs (few lines of code preceded by comment)
2. jump to defnition, CTRL + ] on symbol will jump to it's definition (including local labels, macros etc.) Of course it will not be 100% and probably limited to simple file but would come fine. Also something to open file which is argument to 'include' 3. And mainly, resolving fasm error message to list of errors what allows jumping on error inside macro(s) like in FASMW. and of course VIM allows much more |
|||
08 Jan 2004, 19:27 |
|
ronware 09 Jan 2004, 17:14
vid wrote: 1. folding procedures declared with 'proc'...'return' including comments before procedure to fold. Maybe folding of paragraphs (few lines of code preceded by comment) First, try to accomplish what you want just with manual folding. So 'set fdm=manual' to start with, and then something like: Code: :% /proc/,/return/ fold To fold everything between lines containing 'proc' to 'return'. The reason I haven't done something like this is that I don't use 'proc' and 'return' macros; so this isn't terribly useful to me. However, you could use the 'marker' foldmethod, in which case you just insert appropriate markers in the code (":help fold-marker" for more info). In that case, you would also either want a modeline in the file to set the appropriate fold method, or have a 'filetype' plugin to set things up for all asm files. Quote:
Look at 'ctags' - ctags.sf.net Quote:
:help quickfix :help make Quote:
[/quote] Indeed, it does |
|||
09 Jan 2004, 17:14 |
|
mvil 10 Jan 2004, 13:59
vid wrote: 3. And mainly, resolving fasm error message to list of errors what allows jumping on error inside macro(s) like in FASMW. I tried to do that a while back, but it seemed really hard to make vim accept fasm-style multiline error messages. Finally I just gave up and modified FASM to give errors in the same format as GCC. If you get the errorformat working, please do post it here! thx |
|||
10 Jan 2004, 13:59 |
|
vid 11 Jan 2004, 10:52
ctags can be used with fasm?
mvil: please post your modified version of FASM |
|||
11 Jan 2004, 10:52 |
|
mvil 11 Jan 2004, 14:55
OK, the code that displays error messages is in system.inc, so here's my modified version of that file. This is only for Win32...
I have commented out lines 411,412, 429,430 and 470-472, and I've changed the strings in the bottom of the file... Not a perfect solution, but it works.
|
|||||||||||
11 Jan 2004, 14:55 |
|
ronware 14 Jan 2004, 17:52
vid wrote: ctags can be used with fasm? Ah, no, sorry. But you could easily write a perl script or something (even ... a FASM code!) to make a tags file. On the topic of the syntax file you uploaded, I have used it now and made some small modifications. First and most important, you should not hard-code colors in a syntax file - you should prefer to link to 'standard' syntax groups so that the 'colorscheme' settings will allow people to use colors they prefer. Second, I added that a label at the beginning of a line is highlighted as a label. I am attaching the zipped-up version of the syntax file, v2, for your review.
|
|||||||||||
14 Jan 2004, 17:52 |
|
vid 15 Jan 2004, 19:28
thx, but i dont like tags file way, i would more appreciate direct jumping to labels (in same file). I'll try to code similar thing later.
|
|||
15 Jan 2004, 19:28 |
|
ronware 21 Jan 2004, 06:25
vid wrote: thx, but i dont like tags file way, i would more appreciate direct jumping to labels (in same file). I'll try to code similar thing later. Hi - Here's an updated syntax file for vim, which I just posted to the vim-dev list for including in the vim distro. Just put the file in your runtime\syntax directory, and do :let asmsyntax='fasm' It includes all the identifiers from FASM 1.50, using vim to process the FASM source code and suck them up. Enjoy!
|
|||||||||||
21 Jan 2004, 06:25 |
|
vid 21 Jan 2004, 19:51
your file is good (i haven't tested it on-run yet, i just looked at it), but i dislike few things:
1.syn keyword fasmAddressSizes byte dword word i would rather call this fasmSizeOperator as in docs. And you missed few of them, which are in "fasmSYmbols" (tword). 2. "shr" "and" etc. are defined as fasmoperator, but they should be fasmNumericOperator. 3. fasmSpecial misses %t 4. some registers are in fasmRegister and some in fasmSymbol, they should all be in fasmRegister |
|||
21 Jan 2004, 19:51 |
|
ronware 21 Jan 2004, 19:56
vid wrote: your file is good (i haven't tested it on-run yet, i just looked at it), but i dislike few things: Hi! The file is generated by a vim script, so I would be able to run it against any future FASM release and keep it up-to-date with very little work. I'll look at your points and see how to incorporate them. |
|||
21 Jan 2004, 19:56 |
|
ronware 29 Jan 2004, 00:16
VIM syntax file for FASM 1.51.
I swtiched to using a perl script which can be more easily tweaked. Please review and give me your feedback.
|
|||||||||||||||||||||
29 Jan 2004, 00:16 |
|
render 20 Sep 2011, 10:07
who write correctly errorformat ? I'm very need errorformat=)
errorformat=%E%f\ \[%l\]%.%#:,%Z%m,%Ierror:\ %m,%Z is not working. Help:) |
|||
20 Sep 2011, 10:07 |
|
XVilka 10 May 2012, 17:42
My update for vim syntax - added SSEx, AVX and AVX2 instructions.
Last edited by XVilka on 24 May 2012, 18:36; edited 1 time in total |
|||
10 May 2012, 17:42 |
|
gunblade 11 May 2012, 10:30
Thanks for that - I do use vim for fasm work - and the lack of 64-bit registers especially was quite a nuissance.. Should probably push your latest version up to mainstream (maybe after adding any new instructions added by 1.70 (unless you already did but just didnt update the header comment?))
|
|||
11 May 2012, 10:30 |
|
randall 11 May 2012, 13:48
Thanks, I also use vim. Some directives are missing (elf64, segment, readable etc.).
|
|||
11 May 2012, 13:48 |
|
XVilka 12 May 2012, 16:55
Updated comment about supported version, added missing directives and instructions (though not all instructions - need to do deep review of sse and xop commands, or write some script) - after reading fasm sources.
Last edited by XVilka on 24 May 2012, 18:37; edited 2 times in total |
|||||||||||
12 May 2012, 16:55 |
|
gunblade 14 May 2012, 15:41
Nice job fixing it - Just one comment (and a change which I made to your file before using it..) in my opinion, "format" should be a FasmDirective, not a FasmInstr.. so that it shows up as blue as well (well, blue in my theme) - otherwise the colours for Format and ELF/Executable/MZ/PE dont match..
Thanks again |
|||
14 May 2012, 15:41 |
|
neuron 28 Aug 2013, 11:11
This is really helpful! Thanks =)
|
|||
28 Aug 2013, 11:11 |
|
Goto page 1, 2 Next < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.