• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login
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 808 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 Jun 27, 2019, 10:47 PM

    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
    • D
      Derelict LAYER 8 Netgate
      last edited by Jun 28, 2019, 12:06 AM

      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 Jun 28, 2019, 12:36 AM

        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 Jun 28, 2019, 1:16 AM

          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
          • D
            Derelict LAYER 8 Netgate
            last edited by Jun 28, 2019, 1:18 AM

            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 Jun 28, 2019, 1:24 AM

              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
              • D
                Derelict LAYER 8 Netgate
                last edited by Jun 28, 2019, 5:19 AM

                👍

                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
                2 out of 7
                • First post
                  2/7
                  Last post
                Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.
                  This community forum collects and processes your personal information.
                  consent.not_received