From 44f0fbbf3f9ea2b62a4830a1ecf470591433f240 Mon Sep 17 00:00:00 2001 From: yzinchuk Date: Mon, 15 Jun 2026 20:51:22 -0400 Subject: [PATCH] Initial commit --- init.lua | 36 ++++++++++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/init.lua b/init.lua index aff5250..8115642 100644 --- a/init.lua +++ b/init.lua @@ -178,6 +178,12 @@ end -- basic keymaps -- ============================================================ do + + -- [[ Yuriy Keymaps ]] + vim.opt.clipboard = "unnamedplus" + + + -- [[ Basic Keymaps ]] -- See `:help vim.keymap.set()` @@ -251,6 +257,11 @@ do group = vim.api.nvim_create_augroup('kickstart-highlight-yank', { clear = true }), callback = function() vim.hl.on_yank() end, }) + + -- [[ RPC Server for external control ]] + -- Used for changing the theme to light/dark from external tools (e.g. atom.cz) + local socket_path = '/tmp/nvim-' .. vim.fn.getpid() .. '.sock' + vim.fn.serverstart(socket_path) end -- ============================================================ @@ -385,15 +396,32 @@ do vim.pack.add { gh 'folke/tokyonight.nvim' } ---@diagnostic disable-next-line: missing-fields require('tokyonight').setup { + style = 'moon', -- default dark theme + light_style = 'day', -- theme used when background is light styles = { comments = { italic = false }, -- Disable italics in comments }, } - -- Load the colorscheme here. - -- Like many other themes, this one has different styles, and you could load - -- any other, such as 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'. - vim.cmd.colorscheme 'tokyonight-night' + -- Auto switch based on KDE Plasma system theme + local function set_theme() + local handle = io.popen "kreadconfig6 --group 'General' --key 'ColorScheme' 2>/dev/null" + if handle == nil then + vim.o.background = 'dark' + return + end + local result = handle:read '*a' + handle:close() + if result:match '[Dd]ark' then + vim.o.background = 'dark' + else + vim.o.background = 'light' + end + end + set_theme() + + -- Uses tokyonight (without suffix) so it respects vim.o.background + vim.cmd.colorscheme 'tokyonight' -- Highlight todo, notes, etc in comments vim.pack.add { gh 'folke/todo-comments.nvim' }