catppuccin / nvim

🍨 Soothing pastel theme for (Neo)vim
MIT License
5.34k stars 237 forks source link

Support for Terminal Cursors #737

Closed u0398 closed 1 month ago

u0398 commented 1 month ago

Currently the highlight groups for terminal cursors are not set, so the terminal cursor is not visible in terminals when in normal, visual or command modes.

Fixing this would involve including highlights for TermCursor and TermCursorNC.

I'm currently working around the issue with this in my config:

vim.api.nvim_set_hl(0,'TermCursorNC', { fg='#24273a', bg='#a5adcb' })

Context: Cursors operate a little differently in terminals, with a separate cursor for the terminal line, on top of the standard one for cursor location in normal, visual, or command modes. This image illustrates the desired outcome with my fix from above. The terminal is in visual mode with a selected area, while also showing the terminal position:

nvim-terminal-cursor-highlights
u0398 commented 1 month ago

I realized this is possible with custom highlights:

custom_highlights = function(colors)
  return {
    TermCursorNC = { fg = colors.base, bg = colors.subtext0 },
  }
  end,

It's probably still worth adding as a default though.