0

When I'm on my own computer's terminal, when I enter the command vim filename and vim opens the file in the terminal.

When I log into my school account using SSH, and I enter vim filename, nothing happens. I assume it's trying to open it using XQuartz, which I recently uninstalled.

How do I make it open in the terminal window, like on my own computer?

I have tried not using -Y when logging on, but it doesn't make a difference.

Mateusz Piotrowski
  • 8,029
  • 10
  • 53
  • 79
user
  • 352
  • 3
  • 13
  • What do you mean nothing happens? Do you get an error? Are you sure vim is installed on the computer you are try to connect to using ssh? Can you try `vi filename`, `which vim`? vim is a terminal application it it doesn't need X session. – stee1rat Jan 20 '16 at 18:48
  • @stee1rat Nothing happens, no error. I can't enter any more commands in. vi filename does the same thing. – user Jan 20 '16 at 18:58
  • 2
    Do you use `-X` besides `-Y`? Try adding `-x` to `ssh` command line to forcefully disable X11 forwarding. – Paul Jan 20 '16 at 21:06

1 Answers1

0

Actually, there is a workaround. You can try to edit it using the scp option in Vim.

Just run vim scp://user@schoolserver.edu/path/to/your/file from your terminal and you'll start editing the file using Vim from your local machine.

If you want to learn more about scp in Vim type :help scp in Vim.

Mateusz Piotrowski
  • 8,029
  • 10
  • 53
  • 79