Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    How use vi as the command-line editor in the shell

    Scheduled Pinned Locked Moved Off-Topic & Non-Support Discussion
    7 Posts 2 Posters 928 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • G
      GregBinSD
      last edited by

      I am a brand-new user of pfSense, with 2 questions ;-)

      1- Has anyone here figured out how use vi as the command-line editor in the shell?
      2 - Would you be willing to share how to set it up with me?

      When I use other version of Unix and Linux, I just go to the .bash_profile and type this:
      set -o vi

      After logging off, and then back on, I can repeat any of my last commands with <Esc> k

      Then I can search through all past commands by using the vi search character /

      Right now, I am getting by using the up-arrow to repeat commands, but I do miss the vi command-line editor.

      1 Reply Last reply Reply Quote 0
      • DerelictD
        Derelict LAYER 8 Netgate
        last edited by

        It's tcsh for some historical reason.

        https://www.freebsd.org/cgi/man.cgi?tcsh(1)

        Try adding bindkey -v to the end of /root/.tcshrc

        Chattanooga, Tennessee, USA
        A comprehensive network diagram is worth 10,000 words and 15 conference calls.
        DO NOT set a source address/port in a port forward or firewall rule unless you KNOW you need it!
        Do Not Chat For Help! NO_WAN_EGRESS(TM)

        1 Reply Last reply Reply Quote 0
        • G
          GregBinSD
          last edited by

          RE: Try adding bindkey -v to the end of /root/.tcshrc

          That worked! Thanks a million! Now, I'm happy as a clam.

          1 Reply Last reply Reply Quote 0
          • G
            GregBinSD
            last edited by

            Oh, my elation was short-lived. It turns out that the .tcshrc file in /root is overwritten by a default file elsewhere. My quest is now to find that default file and fix it to my liking.

            1 Reply Last reply Reply Quote 0
            • DerelictD
              Derelict LAYER 8 Netgate
              last edited by

              Try changing /etc/skel/dot.tcshrc

              You will probably have to re-do this after an upgrade or reinstall or etc.

              Chattanooga, Tennessee, USA
              A comprehensive network diagram is worth 10,000 words and 15 conference calls.
              DO NOT set a source address/port in a port forward or firewall rule unless you KNOW you need it!
              Do Not Chat For Help! NO_WAN_EGRESS(TM)

              1 Reply Last reply Reply Quote 0
              • G
                GregBinSD
                last edited by

                You are too quick for me! Yes, I found it while searching on my own. That did it. I also added the .history file, so the history of keystrokes will span as many days and weeks as I need.

                Thanks for your help, Sir Derelict!

                1 Reply Last reply Reply Quote 0
                • DerelictD
                  Derelict LAYER 8 Netgate
                  last edited by

                  👍

                  Chattanooga, Tennessee, USA
                  A comprehensive network diagram is worth 10,000 words and 15 conference calls.
                  DO NOT set a source address/port in a port forward or firewall rule unless you KNOW you need it!
                  Do Not Chat For Help! NO_WAN_EGRESS(TM)

                  1 Reply Last reply Reply Quote 0
                  • First post
                    Last post
                  Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.