Initial commit
This commit is contained in:
@@ -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' }
|
||||
|
||||
Reference in New Issue
Block a user