1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Vi, or Some Other Editor?

Discussion in 'HD/HDR-FOX T2 Customised Firmware' started by Black Hole, Feb 21, 2012.

  1. Black Hole

    Black Hole Theloniuos Abbot

    (cotinued from HERE)

    Almost as bad! I seem to remember something like that in the early days of MS-DOS :rolling:

    Brilliant (and hilarious)!

    The thing is, it's not "features" the occasional file-tweaker needs, it's intuitive usage. At least now vi can use the cursor keys, I remember having to use the h j k l keys to move the edit cursor (had to look that up).

    I think one could get by if the cursor keys work, backspace and delete work, and typing anything inserts it straight in at the cursor (instead of having to enter "insert mode"), then Ctrl-Z asks you whether you want to save, save as, or quit without saving.

    Beyond that home, end, Ctrl-home, Ctrl-end would be nice, and a means to mark, Ctrl-C, Ctrl-X, Ctrl-V.
  2. af123

    af123 Administrator Staff Member

    Yeah, that's all there but you have to re-learn it. ( :1 for home, :$ for end, Shift-V to mark, yy to copy, p to paste - can also copy/paste to named buffers which is particularly useful). I don't use the cursor keys, happy keeping my fingers near the home keys.

    We definitely should have another editor package available that we can point people to who need to tweak a file on the box. FTP + Windows causes too many issues with line endings. Joe sounds like a candidate, or perhaps pilot? We probably shouldn't have too many different options.

    I will get around to adding a text editor the web interface at some point for these simple tweaks.
  3. mingw.android

    mingw.android New Member

    Nano is intuitive in those terms and has on screen help plus syntax highlighting.
  4. Black Hole

    Black Hole Theloniuos Abbot

    Can the syntax highlighting be turned off (preferably by default)? Confusing for people used to Notepad.
  5. Sam Widges

    Sam Widges Active Member

    Vi is for geeks, but I agree that something like joe or nano should be included for novices who just want to tweak one or 2 simple files to make something work.

    Apart from that, I'm surprised that Emacs hasn't been mentioned yet, although my personal view on that is that it's a decent Operating System, if somewhat lacking in editing facilities. Never mind though, you can always use it to play Tetris.
  6. Ezra Pound

    Ezra Pound Well-Known Member

    Emacs did get a bit of a mention in the thread that this one was split from LINK HERE Top of this thread and back to #18
  7. Sam Widges

    Sam Widges Active Member

    You're right

    Bearing in mind that some of the EMACS backronyms are "Emacs Munches All Computer Storage" or "Eighty Megabytes and Constantly Swapping", I'm with Af123 on that one.
  8. MrPuddington

    MrPuddington New Member

    As much as I like Emacs, in a terminal and on an embedded system it is no fun. It just takes too long to load, and it has too many buffers in the background. But I am a very happy user of jed - a light nimble Emacs clone with mostly compatible commands (although the replace commands have some naming differences). It works in a Debian chroot, but I supposed it could also be compiled for uclib.
  9. Sam Widges

    Sam Widges Active Member

    The ':syntax off' command is worth a punt, but making it the default is more difficult as root's home directory is '/' and therefore doesn't persist beyond a reboot.
  10. coffeecat

    coffeecat Member

    Oh no, someone beat me to the emacs operating system joke! Although I have to say it's by far and away my favourite editor for daily use at work. It was a great joy to discover it after many painful years of vi...

    Having said that, I am under no illusion about the idea of trying to run it on the humax. Bad!

    And this has brought back long forgotten unpleasant memories of having to use h j etc to move the cursor in vi. Bleh!

    Anyway, what a fun way to spend a Tuesday evening, reliving the great text editor Holy War!

    But seriously, for this purpose I'd be happy to stick with vi, although I don't have much experience of all the other lightweight editors like nano.

    Sent from my HTC Desire S using Tapatalk
  11. xyz321

    xyz321 Well-Known Member

    I think most people will advocate their own favourite editor. However, if we are looking to provide something that novice users can easily use then I think something like nano would be the way to go. The reason for this is that most users will probably only want to use the save command anyway after some basic editing. Since nano uses ctrl-X for save it would be much easier to explain to novice users since it is on-screen and is a single command. The likes of emacs and joe use ^x c and ^k x respectively. Most editors will allow redefinition of the command keystrokes but it is probably easiest to use one that does it by default.
  12. Ezra Pound

    Ezra Pound Well-Known Member

    There seems to be quite strong feelings about editors, Emacs followers seem to have turned it into a Religion by setting up news group Alt.Religion.Emacs and claiming that vi is the Editor of the beast (vi vi vi is 666 in Roman Numerals). If we're taking a vote I would stick with vi
  13. af123

    af123 Administrator Staff Member

    There are always strong feelings about editors and I'm not entirely sure why! I'm happy with vi, I don't expect everyone else to be and I certainly don't think it's of any practical use to novices. I think nano is a clear winner to add to the repository to provide an alternative (or maybe pico if nano is too large).

    Well, if you update your webif packages, you'll find a (very) simple text editor option on the diagnostics page.

    That may not be where it ends up, but it lets people do things like update their /mod/etc/exports file without having to use telnet and an unfamiliar editor or FTP and experience the newline conversion that almost inevitably occurs when they open the file in a Windows program.
    Ezra Pound and Sam Widges like this.
  14. Sam Widges

    Sam Widges Active Member

    Excellent, I hadn't spotted that one before - any chance of a browser interface as well? ;)
  15. Black Hole

    Black Hole Theloniuos Abbot

    I don't think that's confined to editors. I believe it's about the time invested getting to know the ins and outs of one editor in particular, and therefore a natural unwillingness to switch. That does not account for trying to sway somebody else, without the same time investment, to your particular editor. The situation is (was!) the same with me and microprocessors - I knew how to use a Z80 in miniscule detail, so if I needed to embed a micro the Z80 would be the first choice even if it was not the perfect match for the job.

    With my management hat on I try to take a detached view and observe what is needed rather than what my preferences might be.
  16. af123

    af123 Administrator Staff Member

    It's early, which may account for it, but I don't understand!

    The editor needs some more checks in it to make sure that you don't try to edit a very large or binary file, although all you will do is kill your browser at the moment : )
  17. Sam Widges

    Sam Widges Active Member

    It would be helpful to be able to navigate to files and then select them for editing.
  18. Black Hole

    Black Hole Theloniuos Abbot

    Please miss, miss... 'e means an "open file" dialogue thingy!
  19. Ezra Pound

    Ezra Pound Well-Known Member

    Editor works well, file navigation would be good, But as it is likely to be used by most people very rarely, It's just the thing to able to say goto Diagnostics >> File Editor and enter /mod/etc/modservices for example
  20. af123

    af123 Administrator Staff Member

    Try webif 0.9.3-1 : )
    Sam Widges likes this.