# Need a text-based code editor that WORKS... any ideas?



## Eponasoft (Oct 19, 2010)

I'm looking around on freshports for a code editor for the console that works properly... so far I found setedit, which doesn't work for squat (no mouse control and F10 doesn't do a damn thing), and mined (which works alright but isn't a code editor, just a text editor, so no syntax highlighting). I tried led but for that, I might as well be using vi... eww... and 'edit' of course works (what is this, nano? pico?) but the same as mined... no syntax highlighting. Something like RHIDE, but for FreeBSD, would be nice... does anyone know of anything decent that fits the bill? And yeah, there's a reason why I don't just use one of the many X-based editors... I'm running 8.1 in a VM that only has 64MB of RAM so it's X-less... the console is all I have.


----------



## fronclynne (Oct 19, 2010)

[cmd=""]edit[/cmd] should be to whatever $EDITOR is set as, I think this defaults to /usr/bin/ee (_quo vide_: ee(1)), though this might depends on your shell and what's in your ~/.cshrc, ~/.tcshrc, ~/.profile, _et al_.

editors/vim seems to make some people happy.  If editors/joe has syntax highlighting* (I don't honestly know) maybe it's more your speed.

I dunno if any of this is holpenfull:  http://en.wikipedia.org/wiki/Source_code_editor


*Okay, according to http://en.wikipedia.org/wiki/Comparison_of_text_editors joe does have syntax highlighting.  Well, wikipud is never actually wrong (just poorly edited, yeah right?).


----------



## roddierod (Oct 19, 2010)

Inside of the midnight commander port is mcedit, which reminds me of old Borland Turbo C or Pascal.


----------



## gilinko (Oct 19, 2010)

You can always run emacs in console mode by installing the -nox11 port of emacs, editors/emacs-nox11, which is my chosen weapon when I need syntax highlighting and other items for source code editing(like git etc).


----------



## SirDice (Oct 19, 2010)

Nice thread to kick off a VI vs. Emacs flamewar :OOO

I hope it doesn't end that way though...

Anyway, I think either vim or emacs will do fine. Both have a bit of a learning curve but in the end it pays off. I personally prefer vim but that's just because I get lost in emacs (and it's usually not installed, vi is).

Both are preferably build (by their hardcore users) with the make option *WITHOUT_X11*


----------



## graudeejs (Oct 19, 2010)

Pick vim, pick vim


----------



## DutchDaemon (Oct 20, 2010)

I'm sure I can borrow Eponasoft's signature to state that "editor fanaticism is for the cranially disadvantaged". 

Which magically prevents it from happening in this thread now.


----------



## fronclynne (Oct 20, 2010)

DutchDaemon said:
			
		

> I'm sure I can borrow Eponasoft's signature to state that "editor fanaticism is for the cranially disadvantaged".
> 
> Which magically prevents it from happening in this thread now.



But how do you feel about the Oxford Comma?  Don't hold back.


----------



## UNIXgod (Oct 20, 2010)

Wow these threads really do exist. If you're really not happy with the current crop of text editors out there you could always pretend you're stuck in the 70's with ed(1)()


----------



## DutchDaemon (Oct 20, 2010)

fronclynne said:
			
		

> But how do you feel about the Oxford Comma?  Don't hold back.



I have no problem with the Oxford Comma whatsoever. I know, like, and use it.


----------



## Eponasoft (Oct 20, 2010)

Hrm... if I could squash 'joe' and 'mined' together, it'd make the perfect editor for my purposes.  I haven't installed joe yet but from the screenshots I've seen, it doesn't appear to have any menus... everything is keystroke-oriented which for me is a problem... my big fingers often mistype keystrokes and foul things up, which is why I don't like vi*... I need my menus, even if they're not mouse-controlled.


----------



## luna (Oct 20, 2010)

Try editors/nano, it's small and easy to learn. You can quickly turn on syntax highlighting by
`$ sed 's/^# inc/inc/' /usr/local/share/examples/nano/nanorc.sample >~/.nanorc`

vim (unlike ex-vi or nvi) is bloated nowadays, even lite version.


----------



## Eponasoft (Oct 22, 2010)

Excellent, thank you for the tip... this seems to suit my purposes and I seem to already be a little familiar with this editor. I hope it will do the job. Thanks again!

UNIXgod, I don't have to like something just because it's there.  I am a very, very picky user and I want things *my way*, and if nothing fits the bill, then I'm not just gonna settle for what's available and pretend I'm happy with it.


----------



## Sopalajo (Feb 21, 2016)

luna said:


> Try editors/nano, it's small and easy to learn. You can quickly turn on syntax highlighting by
> $ sed 's/^# inc/inc/' /usr/local/share/examples/nano/nanorc.sample >~/.nanorc



Thanks a lot, Luna.
Could you please expand on why this line enables syntax highlighting?


----------



## tobik@ (Feb 21, 2016)

It edits (uncomments) # inc lines in /usr/local/share/examples/nano/nanorc.sample and saves the result in ~/.nanorc (which is your users nano config file). It enables this line

```
include "/usr/local/share/nano/*.nanorc"
```
 which loads all syntax highlighting files for various file types.


----------

