Hakob
Hakob

Reputation: 21

How do I enable syntax highlight in neovim?

I am running neovim on arch. I always thought syntax highlighting is enabled by default, but it doesnt work now. Here's my init.lua

vim.o.clipboard = "unnamedplus"
vim.o.number = true
vim.o.tabstop = 4
vim.o.shiftwidth = 4
vim.o.expandtab = true

vim.cmd('filetype plugin on')
vim.cmd('syntax on')

I noticed that there wasnt a variable $VIMRUNTIME, so I created it manually with value "/usr/share/nvim/runtime"

Upvotes: 2

Views: 3008

Answers (1)

KamielDev
KamielDev

Reputation: 579

  1. Given that you created the $VIMRUNTIME variable yourself, confirm that the path at /usr/share/nvim/runtime contains your vim-related files. :!ls $VIMRUNTIME should return a filelist that looks like this:

VIM runtime files

  1. Run through the troubleshooting steps at :help 06 (also available here)

Upvotes: 1

Related Questions