Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow disabling Visual highlight #41

Open
NotAShelf opened this issue Jun 5, 2023 · 17 comments
Open

Allow disabling Visual highlight #41

NotAShelf opened this issue Jun 5, 2023 · 17 comments
Assignees

Comments

@NotAShelf
Copy link

NotAShelf commented Jun 5, 2023

Hello! I would like to remove the colored backgrounds from modes, especially in visual. Is it possible?

edit: to clarify, I just would like it to make it possible that modes.nvim does not alter colors for modes like v-snip, because it creates a conflict with the implementation of configurable themes in my setup

@fitrh
Copy link
Collaborator

fitrh commented Jun 6, 2023

You can cofigure line_opacity per mode, set it to 0 to remove the background

require('modes').setup({
   line_opacity = {
      visual = 0,
   },
})

Or you can override ModesVisual or ModesVisualXXX highlight group where XXX is

  • CursorLine
  • CursorLineNr
  • CursorLineSign
  • CursorLineFold
  • Visual

@NotAShelf
Copy link
Author

NotAShelf commented Jun 6, 2023

Configuring line_opacity is the first thing I've tried, it results in a black background on VISUAL mode selections.

Update: seems to be exclusive to the Catppuccin theme.

@fitrh
Copy link
Collaborator

fitrh commented Jun 6, 2023

Can you provide reproduction steps with minimal config? By minimal config I mean no package manager, just packadd it manually

I can't reproduce your issue with the following config

vim.o.termguicolors = true
vim.cmd.packadd("modes.nvim")
vim.cmd.colorscheme("catppuccin") -- assuming you cloned the theme as `start` package
require("modes").setup({
  line_opacity = {
    visual = 0,
  },
})

@NotAShelf
Copy link
Author

NotAShelf commented Jun 6, 2023

That might be a little tricky, given I use Nix to manage plugins for me.

But I think a minimal config would look like a combination of :

set termguicolors
set t_Co=256
require('modes').setup({
  set_cursorline = false,
  colors = {
    copy = "#f5c359",
    delete = "#c75c6a",
    insert = "#78ccc5",
    visual = "#9745be",
  },
})
-- Catppuccin theme
require('catppuccin').setup {
  flavour = "mocha",
  transparent_background = false,
  integrations = {
      nvimtree = {
          enabled = true,
          transparent_panel = false,
          show_root = true,
      },

    hop = true,
      gitsigns = true,
      telescope = true,
      treesitter = true,
      ts_rainbow = true,
    fidget = true,
    alpha = true,
    leap = true,
    markdown = true,
    noice = true,
    notify = true, -- nvim-notify
    which_key = true
  },
}

-- setup must be called before loading
vim.cmd.colorscheme "catppuccin"

Those are my configured defaults, minus the

line_opacity = {
    visual = 0,
  },

part which changes the visual mode background to black.

@fitrh
Copy link
Collaborator

fitrh commented Jun 6, 2023

I still can't reproduce your issue with your config

@NotAShelf
Copy link
Author

NotAShelf commented Jun 6, 2023

I've experienced different results in different terminals (where footerm shows black, but kitty shows a darker shade of purple for visual)

Perhaps it is a terminal thing, which terminal are you testing with?

Edit: turned out to be unrelated, I remain clueless

@fitrh
Copy link
Collaborator

fitrh commented Jun 6, 2023

Perhaps it is a terminal thing, which terminal are you testing with?

I'm using Alacritty

Can you provide a screenshot of what it looks like, and what do you expect it to look like?

@mvllow
Copy link
Owner

mvllow commented Jun 6, 2023

Are you using tmux?

@NotAShelf
Copy link
Author

NotAShelf commented Jun 6, 2023

Perhaps it is a terminal thing, which terminal are you testing with?

I'm using Alacritty

Can you provide a screenshot of what it looks like, and what do you expect it to look like?

With line_opacity set to 0, here is what it looks like on catppuccin:
image

vs. the same selection, in neovim's built-in desert theme:
image

Are you using tmux?

I'm not, it's just a raw terminal window.

@fitrh
Copy link
Collaborator

fitrh commented Jun 7, 2023

@NotAShelf Do other non-built-in themes behave like catppuccin?

Can you reproduce your issue with the following config

-- minimal.lua
vim.o.termguicolors = true
vim.cmd.packadd("modes.nvim")
vim.cmd.colorscheme("catppuccin") -- assuming you cloned the theme as `start` package
require("modes").setup({
  line_opacity = {
    visual = 0,
  },
})

with nvim --clean -S minimal.lua -- minimal.lua command?

@fitrh
Copy link
Collaborator

fitrh commented Jun 7, 2023

The thing is it seems you disabled the cursor line with set_cursorline = false, so the expected behavior should be no cursor line at all

@NotAShelf
Copy link
Author

NotAShelf commented Jun 7, 2023

Do other non-built-in themes behave like catppuccin?

no, none of the built-in themes behave like catppuccin, but the "default" theme does

Can you reproduce your issue with the following config

I cannot.

@fitrh
Copy link
Collaborator

fitrh commented Jun 7, 2023

Looks like catppuccin has something about compile-thing, do you think that's the cause of your issue? Have you tried asking the catppuccin people?

@NotAShelf
Copy link
Author

I am not sure if the problem is with the catppuccin theme itself, but how the background is drawn by neovim since the issue also occurs on the default theme of neovim.

@fitrh
Copy link
Collaborator

fitrh commented Jun 7, 2023

But if you can't reproduce your issue with nvim --clean, it's most likely from your config

@NotAShelf
Copy link
Author

That is a fair point.

@mvllow
Copy link
Owner

mvllow commented Sep 21, 2023

I believe you could overwrite ModesVisual* highlight groups to be your theme's background instead of transparent. :hi ModesVisual<tab> should show the relevant group names.

@mvllow mvllow changed the title unsetting colors Allow disabling Visual highlight Jun 9, 2024
@mvllow mvllow self-assigned this Jun 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants