On Thu, 20 Feb 1997, Josh Brittenham wrote: > I'm just interested in what some of you use for editors in linux. I've > been using Pico, and have found it to be really annoy sometimes. Is > there any editor in Linux that allows finding/replacing, or such commands > that would make a coders job easier?:) 'joe' is IMHO one of the better editors. While as it does not have all the sophistication and customization of emacs, it is much easier to learn for someone coming from a DOS world: if you are used to qedit, many of the keys are the same. >From a programmer's point of view, here are some of the greatest features about joe: tag search: press ^K;, type do_get, return. joe will load the file with do_get command, and place you on it's first line. search/replace: it has it, and it supports regular expressions too. say, you want to replace the word xyzzy, but only if it is at the beginning of a line. Press Search, \^xyzzy, return, replace, return. Other forms of regexps are supported too, e.g. \? matches one character, so b\?d would find bad, bid and bod. customization: it is easy to swap keybindings around. I'd suggest once you get used to joe, to move some of the commands to your F1-F10 function keys. I have a .joerc file that I find useful, complete with some instructions if you want it. filtering: You can mark a block and filter it through any unix command. You want something sorted: mark the block, press ^K/, sort, return. It's sorted. You want a C function indented because it looks messy: mark it, run indent on it (check man indent if you haven't seen met this program before, there a 100 options you can set to customize how it will indent your source code). autoindent: after you press TAB to indent, following lines will start indented too. command parsing: Not sure how to call it. If you have a window that looks like this: file:2342 Blah blah blah You can press 'parse' and have joe parse this file: it will assume that the first part of the line is a filename, followed by a line number. This is useful for compiling: you run a compile, then parse the output. joe will now go to the first error, and you can go to next error using Alt-=. This is also useful for finding where stuff is used: run "grep -n word *.c" in a window: grep will return where "word" is found in your .c files, and you can visit each place by using Alt-=. Paren matching: pressing control-G takes you to the previous ({[. Say, you are writing some complicated function call, like foo(bar[a+foo2(4*(3+2))]) and want to make sure you got the parens right: stand on any of them, press Control-G and it will jump to the correspodning begnning/ending paren: if it jumps someplace wild, it means that the count is somehow wrong. Multiple, optionally split windows. Multilevel undo/redo. Rectangular blocks: say you have some code like this: + blah blah + blah blah + blah blah + blah blah and you want to get rid of the +s. You press Control-T X, which sets joe in rectangular block mode, go to the first +, press start block, go to the space after the last +, and press end block: the block will be rectangular (rather than following the text) and pressing delete-block will remove the +s and the space after it. Macros: simple recording of keystrokes, but useful when you want turn a dozen things into a dozen other things. Macros in conjuction with the repeat-command command are especially useful. Say you have made a macro that searches for something and rearranges its position on the line: if you press Alt-\, type 100 (which means the next command is repeated a 100 times) and run your macro, it will stop once it gets an error (e.g. when it cannot find any more of the text). Other editors like to repeat your macro 100 times no matter what, which can have bad effects. It doesn't have syntax highlighting though. jed and xemacs have it, but I never liked it personally. It reminds me a bit of Microsoft *shudder* Visual *shudder* C :) ============================================================================== Erwin Andreasen Viby J, Denmark Computer Science Student at Aarhus Business erwin@pip.dknet.dk <URL:http://pip.dknet.dk/~pip1773/> College ============================================================================== +-----------------------------------------------------------+ | Ensure that you have read the CircleMUD Mailing List FAQ: | | http://cspo.queensu.ca/~fletcher/Circle/list_faq.html | | Or send 'info circle' to majordomo@cspo.queensu.ca | +-----------------------------------------------------------+
This archive was generated by hypermail 2b30 : 12/18/00 PST