ap / vim-css-color

Preview colours in source code while editing
http://www.vim.org/scripts/script.php?script_id=5056
MIT License
1.77k stars 78 forks source link

Plugin doesn't show colors #160

Closed nix-enthusiast closed 2 years ago

nix-enthusiast commented 2 years ago

Hi. I installed the plugin via using vim-plug but i have issue. On this picture, hexadecimal color codes doesn't work. But if i look the example.css file it works. example.sh file doesn't seems to working too.

Am i missing a point? I am newbie at init.vim/.vimrc and plugins. I think i missed a point bu idk what is poing that i missed.

Here's my init.vim (I am neovim user)

[hoovy@turbine ~]$ cat .config/nvim/init.vim
"---------------------------"
"    Essential commands     "
"---------------------------"
source ~/.nvimrc "(btw, this file is blank file)

"---------------------------"
"    Alias-like commands    "
"---------------------------"
set number "show line numbers
set noshowmode "setting for lightline
let mapleader = " " "map leader to Space

"---------------------------"
"        Keybindings        "
"---------------------------"
map <leader>f :Ranger<CR> "Space+f for open Ranger.vim

"---------------------------"
"    Plugins (Vim-Plug)     "
"---------------------------"
" Put your plugins between plugin#begin and plugin#end commands
call plug#begin('~/.local/share/nvim/plugged')

Plug 'itchyny/lightline.vim' "status line changer
Plug 'ap/vim-css-color' "Color indicator 
Plug 'francoiscabrol/ranger.vim' "Vim integration for Ranger
Plug 'rbgrouleff/bclose.vim' "Dependency for Ranger.vim

call plug#end()

"---------------------------"
"      Plugins Config       "
"---------------------------"

"Wombat theme for Lightline
let g:lightline = {
      \ 'colorscheme': 'wombat',
      \ }
"End of the config

"Disable default keybindgs for Ranger.vim
let g:ranger_map_keys = 0
"End of the config
ap commented 2 years ago

Sorry I never responded to this. Are you still interested in working this out? (I’ll look into it regardless but if I can’t reproduce the problem I may need your feedback.)

nix-enthusiast commented 2 years ago

Oh. It works right now :) No problem.

image

ap commented 2 years ago

Nice. Should I close the issue then? What was the problem, what fixed it?

Elysium1436 commented 2 years ago

I just installed the plugin, and it isn't working at all. I'm using nvim on kitty terminal. I did run the PlugInstall command.

call plug#begin(stdpath('config') . '/plugged')

"Lsp related"
Plug 'neovim/nvim-lspconfig'
Plug 'glepnir/lspsaga.nvim'
Plug 'hrsh7th/nvim-cmp'
Plug 'hrsh7th/cmp-nvim-lsp'
Plug 'hrsh7th/cmp-buffer'
Plug 'folke/lsp-colors.nvim'
Plug 'hrsh7th/cmp-vsnip'
Plug 'hrsh7th/vim-vsnip'
Plug 'onsails/lspkind-nvim'
Plug 'williamboman/nvim-lsp-installer'

"Telescope"
Plug 'nvim-telescope/telescope-fzf-native.nvim', { 'do': 'make' }
Plug 'nvim-telescope/telescope.nvim'

"Themes"
Plug 'folke/tokyonight.nvim', { 'branch': 'main' }
Plug 'tjdevries/colorbuddy.nvim'

"Icons"
Plug 'lambdalisue/nerdfont.vim'
Plug 'mortepau/codicons.nvim'
Plug 'ryanoasis/vim-devicons'
Plug 'kyazdani42/nvim-web-devicons'

"Autopairs"
Plug 'windwp/nvim-autopairs'
Plug 'windwp/nvim-ts-autotag'

"Miscellaneous"
Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}
Plug 'preservim/nerdcommenter'
Plug 'tpope/vim-fugitive'
Plug 'tpope/vim-rhubarb'
Plug 'nvim-lua/plenary.nvim'
Plug 'nvim-lua/popup.nvim'
Plug 'hoob3rt/lualine.nvim'
Plug 'ap/vim-css-color'
call plug#end()

command! Erc edit $MYVIMRC
command! Elsprc edit ~/.config/nvim/after/plugin/lspconfig.rc.vim

source ~/.config/nvim/setfile.vim
source ~/.config/nvim/mappings.vim

"let g:tokyonight_style = "night"
"colorscheme tokyonight
Elysium1436 commented 2 years ago

2021-11-26-142201_938x1058_scrot

Elysium1436 commented 2 years ago

Ok I found the problem, it's with treesitter. Enabling treesitter highlighting is what caused the plugin highlight to fail. Disabling treesitter highlight or just setting up your own via syntax on makes it work. I think this will be an issue common enough to close this issue for now.

ap commented 2 years ago

Excellent, happy you got it going. 🙂