|
| 1 | +local updateLineNumberColors = function() |
| 2 | + vim.api.nvim_set_hl(0, "LineNr", { fg = "#ffffff" }) |
| 3 | + vim.api.nvim_set_hl(0, "CursorLineNr", { fg = "#ffffff", bold = true }) |
| 4 | +end |
| 5 | + |
| 6 | +vim.api.nvim_create_user_command("LineColor", updateLineNumberColors, {}) |
| 7 | +vim.keymap.set("n", "<leader>clc", updateLineNumberColors) |
| 8 | + |
| 9 | + |
| 10 | +function SetColorscheme(scheme) |
| 11 | + vim.cmd("colorscheme " .. scheme) |
| 12 | + updateLineNumberColors() |
| 13 | +end |
| 14 | + |
| 15 | +function ListColorschemes() |
| 16 | + local themes = {} |
| 17 | + for _, theme in ipairs(vim.fn.getcompletion('', 'color')) do |
| 18 | + table.insert(themes, theme) |
| 19 | + end |
| 20 | + return themes |
| 21 | +end |
| 22 | + |
| 23 | +-- Create SetColorscheme command |
| 24 | +vim.api.nvim_create_user_command('SetColorscheme', function(opts) |
| 25 | + SetColorscheme(opts.args) |
| 26 | +end, { |
| 27 | + nargs = 1, |
| 28 | + complete = function(lead) |
| 29 | + return vim.fn.getcompletion(lead, 'color') |
| 30 | + end, |
| 31 | +}) |
| 32 | + |
| 33 | +-- Create ListColorschemes command |
| 34 | +vim.api.nvim_create_user_command('ListColorschemes', function() |
| 35 | + local available_themes = ListColorschemes() |
| 36 | + print("Available colorschemes:") |
| 37 | + for _, theme in ipairs(available_themes) do |
| 38 | + print(theme) |
| 39 | + end |
| 40 | +end, {}) |
0 commit comments