color toggle and file name helper
This commit is contained in:
parent
1b1837be48
commit
4c2e332359
2
init.lua
2
init.lua
|
|
@ -809,6 +809,8 @@ require('lazy').setup({
|
||||||
javascript = { 'prettier' },
|
javascript = { 'prettier' },
|
||||||
typescript = { 'prettier' },
|
typescript = { 'prettier' },
|
||||||
typescriptreact = { 'prettier' },
|
typescriptreact = { 'prettier' },
|
||||||
|
markdown = { 'markdownlint' },
|
||||||
|
yaml = { 'prettier' },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -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.o.background = 'dark'
|
||||||
vim.keymap.set('n', '<leader>Scd', function()
|
else
|
||||||
vim.o.background = 'dark'
|
vim.o.background = 'light'
|
||||||
end, { desc = '[S]et the [c]olorscheme background [d]ark' })
|
end
|
||||||
|
end, { desc = '[T]oggle the [c]olorscheme background' })
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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 {}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue