parent
78e145660a
commit
1569339c0e
|
|
@ -41,4 +41,5 @@ vim.o.expandtab = true
|
||||||
local set = vim.opt_local
|
local set = vim.opt_local
|
||||||
set.shiftwidth = 2
|
set.shiftwidth = 2
|
||||||
vim.o.shiftwidth = 2
|
vim.o.shiftwidth = 2
|
||||||
|
vim.keymap.set('n', '<leader>yb', '<cmd>let @+ = expand("%")<CR>', { desc = 'yank to plus register current relative path' })
|
||||||
return {}
|
return {}
|
||||||
|
|
|
||||||
|
|
@ -12,9 +12,7 @@ vim.keymap.set('n', 'j', "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = tr
|
||||||
-- See `:help vim.highlight.on_yank()`
|
-- See `:help vim.highlight.on_yank()`
|
||||||
local highlight_group = vim.api.nvim_create_augroup('YankHighlight', { clear = true })
|
local highlight_group = vim.api.nvim_create_augroup('YankHighlight', { clear = true })
|
||||||
vim.api.nvim_create_autocmd('TextYankPost', {
|
vim.api.nvim_create_autocmd('TextYankPost', {
|
||||||
callback = function()
|
callback = function() vim.highlight.on_yank() end,
|
||||||
vim.highlight.on_yank()
|
|
||||||
end,
|
|
||||||
group = highlight_group,
|
group = highlight_group,
|
||||||
pattern = '*',
|
pattern = '*',
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,30 @@
|
||||||
-- Adds git related signs to the gutter, as well as utilities for managing changes
|
-- Alternatively, use `config = function() ... end` for full control over the configuration.
|
||||||
-- NOTE: gitsigns is already included in init.lua but contains only the base
|
-- If you prefer to call `setup` explicitly, use:
|
||||||
-- config. This will add also the recommended keymaps.
|
-- {
|
||||||
|
-- 'lewis6991/gitsigns.nvim',
|
||||||
---@module 'lazy'
|
-- config = function()
|
||||||
---@type LazySpec
|
-- require('gitsigns').setup({
|
||||||
|
-- -- Your gitsigns configuration here
|
||||||
|
-- })
|
||||||
|
-- end,
|
||||||
|
-- }
|
||||||
|
--
|
||||||
|
-- Here is a more advanced example where we pass configuration
|
||||||
|
-- options to `gitsigns.nvim`.
|
||||||
|
--
|
||||||
|
-- See `:help gitsigns` to understand what the configuration keys do
|
||||||
return {
|
return {
|
||||||
|
{ -- Adds git related signs to the gutter, as well as utilities for managing changes
|
||||||
'lewis6991/gitsigns.nvim',
|
'lewis6991/gitsigns.nvim',
|
||||||
---@module 'gitsigns'
|
|
||||||
---@type Gitsigns.Config
|
|
||||||
---@diagnostic disable-next-line: missing-fields
|
|
||||||
opts = {
|
opts = {
|
||||||
|
signs = {
|
||||||
|
add = { text = '+' },
|
||||||
|
change = { text = '~' },
|
||||||
|
delete = { text = '_' },
|
||||||
|
topdelete = { text = '‾' },
|
||||||
|
changedelete = { text = '~' },
|
||||||
|
},
|
||||||
|
current_line_blame = true,
|
||||||
on_attach = function(bufnr)
|
on_attach = function(bufnr)
|
||||||
local gitsigns = require 'gitsigns'
|
local gitsigns = require 'gitsigns'
|
||||||
|
|
||||||
|
|
@ -55,4 +70,6 @@ return {
|
||||||
map('n', '<leader>tD', gitsigns.preview_hunk_inline, { desc = '[T]oggle git show [D]eleted' })
|
map('n', '<leader>tD', gitsigns.preview_hunk_inline, { desc = '[T]oggle git show [D]eleted' })
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
-- vim: ts=2 sts=2 sw=2 et
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue