mswank
mswank

Reputation: 103

Vim/Terminal color scheme appears over SSH but not on local Mac

I use terminal on my Macbook to SSH into Linux machines in order to complete my homework for a class. I use Vim to code in C, for which I have a small set of .vimrc configurations that is the exact same on the remote (Linux) machine as well as my local (Mac) machine. None of these should affect the color scheme of terminal/Vim.

Over SSH, the C code is illustrated with a color scheme that I have come to enjoy. Here's a snippet: vim over ssh

However, when I try to write code in the same way on my local machine instead of SSH, there are no colors at all. Here is the same code I have copied onto my local machine: vim on local

My Mac is set to the new Catalina Dark Mode, and Terminal is on the Basic (Default) color profile. My .vimrc contains the following:

set linebreak
set showbreak=+++
set textwidth=100
set showmatch

set hlsearch
set smartcase
set ignorecase
set incsearch

set autoindent
set cindent
set shiftwidth=4
set smartindent
set smarttab
set softtabstop=4

set ruler

set undolevels=1000
set backspace=indent,eol,start

Would this be an issue with vim color schemes/config, terminal config, or perhaps something else? Help is appreciated!

Upvotes: 0

Views: 1553

Answers (2)

D. Ben Knoble
D. Ben Knoble

Reputation: 4683

Two things:

  1. Coloring is usually achieved via syntax highlighting. The command syntax enable (enable works better than on) can do this
  2. You can edit over ssh with vim:
vim scp://user@remote-host/path/to/file

Upvotes: 1

jeremysprofile
jeremysprofile

Reputation: 11445

You have to turn on the syntax highlighting.

:syn on

You can set this in your .vimrc to avoid typing it every time.

Upvotes: 1

Related Questions