Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
VIM syntax highlighting, not working
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
dreamLogic
n00b
n00b


Joined: 26 Mar 2024
Posts: 13

PostPosted: Wed Apr 10, 2024 1:17 am    Post subject: VIM syntax highlighting, not working Reply with quote

Hello.

I have emerged VIM-9.0.2167 (without the minimal flag) and there is no syntax highlighting. I also have "filetype plugin on" and "syntax on" in my .vimrc
Back to top
View user's profile Send private message
bstaletic
Apprentice
Apprentice


Joined: 05 Apr 2014
Posts: 253

PostPosted: Wed Apr 10, 2024 5:07 am    Post subject: Reply with quote

Code:
:scriptnames


That will show what vim scripts have been sourced.

Code:
:filetype


That will show if you have really set `filetype`.

Code:
:set


That will show all set options.

Code:
:verbose set $THING


That will show from where was $THING set.
Back to top
View user's profile Send private message
dreamLogic
n00b
n00b


Joined: 26 Mar 2024
Posts: 13

PostPosted: Thu Apr 11, 2024 12:44 am    Post subject: vim command outputs Reply with quote

Here's the output

https://dpaste.com/5J2VZVU3B
Back to top
View user's profile Send private message
bstaletic
Apprentice
Apprentice


Joined: 05 Apr 2014
Posts: 253

PostPosted: Thu Apr 11, 2024 9:45 am    Post subject: Reply with quote

`filetype` is not set, therefore no syntax highlighting.
You do have `filetype detect` on, so vim will try to detect the filetype, but comes up empty in your case.

How are you invoking vim?
Back to top
View user's profile Send private message
dreamLogic
n00b
n00b


Joined: 26 Mar 2024
Posts: 13

PostPosted: Thu Apr 11, 2024 5:47 pm    Post subject: Reply with quote

Just normally, from the terminal.

Quote:
vim 'file'


Maybe the filetype has to be set in the file, or there has to be a file extension for it to detect?
Back to top
View user's profile Send private message
bstaletic
Apprentice
Apprentice


Joined: 05 Apr 2014
Posts: 253

PostPosted: Thu Apr 11, 2024 5:51 pm    Post subject: Reply with quote

Vim is a little smarter than just looking at the extension. It can detect the shell script shebang, for example. But yes, having an extension does help.

There're also modelines, as in :h modeline.

You can set the filetype manually with :h :setf.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum