oni icon indicating copy to clipboard operation
oni copied to clipboard

how to change line number colors in onivim?

Open mrgees100peas opened this issue 8 years ago • 4 comments

Oni Version:0.36 Operating System:windows 7 and 10

Issue:change line numbers color

Hi. It is not clear (well, at least not to me) how to change the line numbers colors. I tried the examples provided but none of the attributes given changed the colors for the line numbers.

I imagine its something like this --> "colors.PUT_LINE_NUMBER_PROPERTY_HERE.background": "red" so, what is the property I need?

Using monokai and onedark color scheme.

On a separate note. how do i enable the line guides? might as well save asking a second question

mrgees100peas avatar Aug 06 '18 20:08 mrgees100peas

Hello and welcome to the Oni repository! Thanks for opening your first issue here. To help us out, please make sure to include as much detail as possible - including screenshots and logs, if possible.

oni-bot avatar Aug 06 '18 20:08 oni-bot

Hey!

So the line numbers are actually defined in the vim colour scheme level (ie here: https://github.com/onivim/oni/blob/60c647e3ee6a67a0adb08080680fa19b77135741/extensions/theme-onedark/colors/onedark.vim#L193).

So, to control that you need to either add highlight LineNr guifg=#770000 to your neovim config, or you can add:

    oni.editors.activeEditor.neovim.command("highlight LineNr guifg=#770000")

To your Oni config in the export const activate = (oni: Oni.Plugin.Api) => { bit. Technically I think doing it in the neovim config would be better, as you won't get a flash of the old colour before the Oni config is fully loaded, but apart from that its the same. So if you have a neovim config file, I'd use that, but if you haven't I don't especially think its worth making one for a single line of config.

And for the line guides, I think you'd either need to build from source, or wait a bit for the next release, as they've only been added to master recently, so they aren't in 0.3.6!

CrossR avatar Aug 06 '18 22:08 CrossR

Sorry, where exactly is this "oni config"? is it in %AppData%\Roaming\Oni\config.js or is it somewhere else. This is all I have in my config.js file

module.exports = { "ui.colorscheme": "onedark", "editor.fontSize": "14px", oni.editors.activeEditor.neovim.command("highlight LineNr guifg=#770000") }

but that last line gives: Error loading configuration SyntaxError[Config Error] Failed to parse C:\users\mrgees\AppData\Roaming\oni\config.js: unexpected token.

If I click on that message it opens 2 files. reference and config.tsx

mrgees100peas avatar Aug 07 '18 13:08 mrgees100peas

Never mind. I copied the config.tsx to config.js and added the line of code that you told me to the export const activate section. Thanks for the help.

mrgees100peas avatar Aug 07 '18 13:08 mrgees100peas