Code Monkey home page Code Monkey logo

Comments (8)

bfrg avatar bfrg commented on May 23, 2024

Did you enable syntax in vimrc?

filetype plugin indent on
syntax on

from vim-cpp-modern.

bfrg avatar bfrg commented on May 23, 2024
  1. After you opened filename.c, check the output of :scriptnames.
  2. And can you post a screenshot?

from vim-cpp-modern.

seamusdemora avatar seamusdemora commented on May 23, 2024

I've done as you suggested, but it doesn't look any different. Here's the screenshot:

Screenshot 2024-02-04 at 11 16 34 PM

from vim-cpp-modern.

bfrg avatar bfrg commented on May 23, 2024

Well, you show me a screenshot that contains almost only comments. scriptnames shows that the syntax file is loaded. What did you expect from the plugin? It looks like main() is highlighted, so it seems to work.

from vim-cpp-modern.

seamusdemora avatar seamusdemora commented on May 23, 2024

@bfrg

Apologies for the confusion - I thought it was the output of scriptnames that you were interested in.

But no - at least I don't think it's working - vim-cpp-modern doesn't seem to be having any effect. The "syntax coloring" that you're seeing is from the "industry" coloring that I chose... using the color command IIRC. Here's another screenshot that might make that more clear:
Screenshot 2024-02-05 at 9 12 13 PM

from vim-cpp-modern.

seamusdemora avatar seamusdemora commented on May 23, 2024

And here's a tree output showing where it's installed:

/home/pi/.vim
└── pack
    ├── colorschemes
    │   ├── opt
    │   └── start
    ├── others
    │   ├── opt
    │   └── start
    └── syntax
        ├── opt
        └── start
            └── vim-cpp-modern
                ├── after
                │   └── syntax
                │       ├── cpp.vim
                │       └── c.vim
                └── README.md

14 directories, 3 files

And here's my ~/.vimrc file:

set number
set cursorline
syntax on
set tabstop=4
set shiftwidth=4
set expandtab
colorscheme industry
set laststatus=2
set statusline=%F
filetype plugin indent on
syntax on

from vim-cpp-modern.

bfrg avatar bfrg commented on May 23, 2024

The function names are highlighted, so the plugin seems to work.

If you add let g:cpp_member_highlight = 1, the plugin will also highlight struct members, as in foo.bar or foo->bar.

from vim-cpp-modern.

seamusdemora avatar seamusdemora commented on May 23, 2024

The function names are highlighted, so the plugin seems to work.

If you add let g:cpp_member_highlight = 1, the plugin will also highlight struct members, as in foo.bar or foo->bar.

Ah - so the syntax highlighting is adjustable then?

The files I'm working with now don't have a struct, but I did notice that (in some of my comments in the code) that when I typed in the word NOTE:, that seems to be highlighted - at least a different color from the rest of my comment.

Maybe I was expecting too much? I already had the "generic"(?) syntax option in .vimrc before adding vim-cpp-modern.

from vim-cpp-modern.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.