Alternative text editor?



  • Hey all,

    I don't know if it is just me, but VI in pfsense seems horribly broken.  I use VIM all the time in Linux, so I am familiar with the interface and commands, but there is just something completely wrong with this vi implementation.  Backspace doesn't work.  the i command to type doesn't always stick.  Pushing up or down to navigate when typing can cause everything to explode and all kinds of characters repeat all over the screen.

    I have literally tried to edit this one text file over 20 times now to make a tiny change, and each time, something goes wrong, and I find myself having to force quit (q!) and start over so I don't wreck the file.

    Is there a way to install vim, or maybe even nano (works, albeit over-simplified) in 2.3.1?  I know it used to be possible to install FreeBSD packages in previous versions of pfSense, but apparently that is no longer the case (Why on earth would you give up that capability???)

    I'd appreciate any suggestions.

    –Matt



  • Well.. it's definitely not broken. It's just how the vi editor worked back in the days of when mainframes were used with the VT terminals, for example the old terminals like many other computer keyboards at the time didn't have cursor keys so you're expected to know to use the jkhl keys. Try the ee editor that's included by default in FreeBSD and pfSense.


  • Banned

    Sorry, but these days are over.

    And is ee really a step towards better usability? http://gsp.com/cgi-bin/man.cgi?topic=ee

    Why not moving forward and have something like nano onboard without any mess? vi can stay for the pensioners still wanting it, but some alternative would be really good…



  • It would have to be from a package because licensing conflicts prevents importing of nano (for example) to the FreeBSD base system because it's GNU licensed.



  • ee works fine enough, I don't see why you would need nano on pfSense. It's not like you need to edit files on the system that often.



  • Nano is actually in the packages for 2.3.1, installed as any package:

    
    pkg install nano
    
    

    I do agree that a text editor like vi is not needed that often. There are graphical SSH clients like WinSCP and Filezilla that can be used for editing files. The webgui has a very rudimentary editor as well. In case you need to do disaster recovery on for example /etc/fstab the ee editor is more than enough for that.


  • Banned

    @fragged:

    ee works fine enough, I don't see why you would need nano on pfSense. It's not like you need to edit files on the system that often.

    Totally agree, but if you have to, then messing around with something like vi is PITA, at the very best…

    kpa, thank you, I knew that nano is available, but normally I simply forget to install, until I need it... ;-) That's why it should be there from the start. License mess not on my list, sorry for that! :-)

    PS: nano is not in the list of packages in the GUI, correct? Will installation survive the next update? It is not in the config.xml when installed manually, correct?



  • @kpa:

    It would have to be from a package because licensing conflicts prevents importing of nano (for example) to the FreeBSD base system because it's GNU licensed.

    What about vim?

    I actually kind of like vim.  Why not have it be the default instead of vi?  If this is how vi is supposed to behave, then vim is vastly superior.



  • @mattlach:

    @kpa:

    It would have to be from a package because licensing conflicts prevents importing of nano (for example) to the FreeBSD base system because it's GNU licensed.

    What about vim?

    I actually kind of like vim.  Why not have it be the default instead of vi?  If this is how vi is supposed to behave, then vim is vastly superior.

    Too many dependencies to be included in the base system and importing anything to the base system is done only if it's a crucial functionality that can not be satisfied by installing a package/port. The console only version of vim that you can build by turning off the X11/GUI options in the port would be fine as a pfSense package I think.



  • Nothing broken with vi. If backspace doesn't work, your terminal type is screwed up. ctrl-h will likely backspace in that case.

    nano and vim-lite are available for those who want another option. Those are available via pkg install, but not in the GUI's package manager. They'll be kept up to date by the upgrade process just like any other package, only diff is if you reinstall the system and restore the config, or restore the config to a diff system, that package won't be reinstalled by restoring the config.

    But those will be equally broken if your terminal type is wrong.


Log in to reply