color toggle and file name helper

This commit is contained in:
Brian Henderson 2025-12-05 01:04:40 +01:00
parent 1b1837be48
commit 4c2e332359
No known key found for this signature in database
3 changed files with 40 additions and 6 deletions

View File

@ -809,6 +809,8 @@ require('lazy').setup({
javascript = { 'prettier' }, javascript = { 'prettier' },
typescript = { 'prettier' }, typescript = { 'prettier' },
typescriptreact = { 'prettier' }, typescriptreact = { 'prettier' },
markdown = { 'markdownlint' },
yaml = { 'prettier' },
}, },
}, },
}, },

View File

@ -5,11 +5,12 @@ return {
config = function() config = function()
vim.o.background = 'dark' -- or 'light' vim.o.background = 'dark' -- or 'light'
vim.cmd.colorscheme 'solarized' vim.cmd.colorscheme 'solarized'
vim.keymap.set('n', '<leader>Scl', function() vim.keymap.set('n', '<leader>tc', function()
vim.o.background = 'light' if vim.o.background == 'light' then
end, { desc = '[S]et the [c]olorscheme background [l]ight' })
vim.keymap.set('n', '<leader>Scd', function()
vim.o.background = 'dark' vim.o.background = 'dark'
end, { desc = '[S]et the [c]olorscheme background [d]ark' }) else
vim.o.background = 'light'
end
end, { desc = '[T]oggle the [c]olorscheme background' })
end, end,
} }

View File

@ -10,6 +10,37 @@ vim.keymap.set('n', '<C-l>', '<C-w><C-l>', { desc = 'Move focus to the right win
vim.keymap.set('n', '<C-j>', '<C-w><C-j>', { desc = 'Move focus to the lower window' }) vim.keymap.set('n', '<C-j>', '<C-w><C-j>', { desc = 'Move focus to the lower window' })
vim.keymap.set('n', '<C-k>', '<C-w><C-k>', { desc = 'Move focus to the upper window' }) vim.keymap.set('n', '<C-k>', '<C-w><C-k>', { desc = 'Move focus to the upper window' })
local function copy_path(path_type)
local path_to_copy
local msg_suffix
if path_type == 'full' then
path_to_copy = vim.fn.expand '%:p'
msg_suffix = 'full path'
elseif path_type == 'relative' then
path_to_copy = vim.fn.expand '%:.'
msg_suffix = 'relative path'
elseif path_type == 'filename' then
path_to_copy = vim.fn.expand '%:t'
msg_suffix = 'filename'
else
print 'Invalid path type specified for copy_path'
return
end
vim.fn.setreg('+', path_to_copy)
print('Copied ' .. msg_suffix .. ' to clipboard')
end
vim.keymap.set('n', '<leader>cp', function()
copy_path 'full'
end, { desc = 'Copy full file path' })
vim.keymap.set('n', '<leader>cr', function()
copy_path 'relative'
end, { desc = 'Copy relative file path' })
vim.keymap.set('n', '<leader>cf', function()
copy_path 'filename'
end, { desc = 'Copy filename' })
require('guess-indent').setup {} require('guess-indent').setup {}
return {} return {}