How to select multiple lines

Thomas Orgis thomas-forum at orgis.org
Tue Sep 8 09:59:29 CEST 2009


Am Tue, 08 Sep 2009 09:14:07 +0200
schrieb Eric Bouyoux <eric.bouyoux at insidefr.com>: 

> Hi,
> 
> The title is not very explicit. Let's have an example.
> My file contains :
> module toto ;
> ... (1000 lines of code)
> endmodule
> 
> I want to remove all lines between "module toto" and "endmodule".
> One possibility is to select all lines between the 2 keywords and to
> remove them. But how can I do this automaticaly ?

Interesting point. I am not sure how many other Fortran programmers are here... there is an equivalent task in C-style languages, the operation to got to a machting bracket/brace/parentheses:

function bla()
{
	(100 lines of code)
}

You can place the cursor on the first {, then press Ctrl+M and the cursor jumps to the closing brace. The interesting part for you is that you can hold the shift key while doing that, marking the whole block as result.
OK, that marks the braces, too, and they will be removed when you hit "delete", but they are easily replaced...

The whole functionality to jump to the end of a block would be nice for Wirth/Fortran-style languages (with begin / end, if / end if, do / end do, ...) when it worked with words instead of only braces / parentheses.
I'm quite confident that one could add this functionality as macro (is the current Ctrl+M already a macro, perhaps?), but I am not friends of the nedit macro language. I just keep getting told that I can implement every feature I want with it (visual indent of soft-broken lines, for example).


Alrighty then,

Thomas.

PS: I have to nit-pick: A 1000-line module would always reside in its own file in my code... so removing all the inner module code would involve pressing shift, then ctrl+end to mark everything up to the end... going a line back (to keep "end module"), hit delete.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
Url : http://www.nedit.org/pipermail/discuss/attachments/20090908/17df5d08/signature.bin


More information about the Discuss mailing list