signify keymaps
This commit is contained in:
@ -90,14 +90,6 @@ return {
|
||||
require("libp").setup()
|
||||
end,
|
||||
},
|
||||
{
|
||||
"mhinz/vim-signify",
|
||||
event = "VimEnter",
|
||||
keys = {
|
||||
{ "]d", "<plug>(signify-next-hunk)" },
|
||||
{ "[d", "<plug>(signify-prev-hunk)" },
|
||||
},
|
||||
},
|
||||
{
|
||||
"iamcco/markdown-preview.nvim",
|
||||
build = "cd app && npm install",
|
||||
|
@ -13,6 +13,10 @@ if not use_google() then
|
||||
return {}
|
||||
end
|
||||
return {
|
||||
{ url = "sso://user/fentanes/nvgoog" },
|
||||
-- Prevent long sessions from losing cwd
|
||||
-- Load google paths like //google/* with `gf`
|
||||
{ import = "nvgoog.google.misc" },
|
||||
{
|
||||
name = "maktaba",
|
||||
dir = "/usr/share/vim/google/maktaba",
|
||||
|
@ -61,23 +61,8 @@ return {
|
||||
|
||||
local capabilities =
|
||||
require("cmp_nvim_lsp").default_capabilities(vim.lsp.protocol.make_client_capabilities())
|
||||
capabilities["codeLens"] = { dynamicRegistration = false }
|
||||
capabilities.textDocument.publishDiagnostics = {
|
||||
relatedInformation = true,
|
||||
versionSupport = false,
|
||||
tagSupport = {
|
||||
valueSet = {
|
||||
1,
|
||||
2,
|
||||
},
|
||||
},
|
||||
codeDescriptionSupport = true,
|
||||
dataSupport = true,
|
||||
layeredDiagnostics = true,
|
||||
documentSymbol = true,
|
||||
}
|
||||
|
||||
capabilities = vim.tbl_extend("keep", capabilities or {}, lsp_status.capabilities)
|
||||
|
||||
local lspconfig = require("lspconfig")
|
||||
local configs = require("lspconfig.configs")
|
||||
require("config.lsp-google").setup(capabilities)
|
||||
|
@ -17,15 +17,22 @@ return {
|
||||
|
||||
require("lsp_lines").setup()
|
||||
|
||||
vim.diagnostic.config({ virtual_text = false })
|
||||
vim.diagnostic.config({ virtual_lines = { highlight_whole_line = false, only_current_line = false } })
|
||||
vim.schedule(function()
|
||||
vim.diagnostic.config({
|
||||
virtual_text = true,
|
||||
virtual_lines = { highlight_whole_line = false, only_current_line = true },
|
||||
})
|
||||
end)
|
||||
end,
|
||||
keys = {
|
||||
{
|
||||
"<leader>l",
|
||||
function()
|
||||
local new_value = not vim.diagnostic.config().virtual_lines.only_current_line
|
||||
vim.diagnostic.config({ virtual_lines = { only_current_line = new_value } })
|
||||
vim.diagnostic.config({
|
||||
virtual_text = not new_value,
|
||||
virtual_lines = { only_current_line = new_value },
|
||||
})
|
||||
return new_value
|
||||
end,
|
||||
desc = "Toggle LSP Lines",
|
||||
|
54
vim/.vim/lua/plugins/signify.lua
Normal file
54
vim/.vim/lua/plugins/signify.lua
Normal file
@ -0,0 +1,54 @@
|
||||
local use_google = require("utils").use_google
|
||||
|
||||
local function setup_mercurial(hg_cmd)
|
||||
local git_cmd = "git diff --no-color --no-ext-diff -U0 -- %f"
|
||||
local rcs_cmd = "rcsdiff -U0 %f 2>%n"
|
||||
local svn_cmd = "svn diff --diff-cmd %d -x -U0 -- %f"
|
||||
vim.cmd(string.format(
|
||||
[[
|
||||
let g:signify_vcs_cmds = {
|
||||
\ 'git': '%s',
|
||||
\ 'hg': '%s',
|
||||
\ 'rcs': '%s',
|
||||
\ 'svn': '%s',
|
||||
\ }
|
||||
]],
|
||||
git_cmd,
|
||||
hg_cmd,
|
||||
rcs_cmd,
|
||||
svn_cmd
|
||||
))
|
||||
end
|
||||
|
||||
_G.signify_dtup = function()
|
||||
setup_mercurial('hg diff -r ".^" %f')
|
||||
vim.cmd([[:SignifyRefresh]])
|
||||
end
|
||||
|
||||
_G.signify_dtp4 = function()
|
||||
setup_mercurial('hg diff -r "p4base" %f')
|
||||
vim.cmd([[:SignifyRefresh]])
|
||||
end
|
||||
|
||||
_G.signify_dtex = function()
|
||||
setup_mercurial('hg diff -r "exported(.)" %f')
|
||||
vim.cmd([[:SignifyRefresh]])
|
||||
end
|
||||
|
||||
return {
|
||||
"mhinz/vim-signify",
|
||||
event = "VimEnter",
|
||||
keys = {
|
||||
{ "]d", "<plug>(signify-next-hunk)" },
|
||||
{ "[d", "<plug>(signify-prev-hunk)" },
|
||||
{ "<leader>sd", ":SignifyDiff<CR>" },
|
||||
{ "<leader>sup", ":lua signify_dtup()<CR>" },
|
||||
{ "<leader>sex", ":lua signify_dtex()<CR>" },
|
||||
{ "<leader>sp4", ":lua signify_dtp4()<CR>" },
|
||||
},
|
||||
config = function()
|
||||
vim.g.signify_vcs_list = { "hg", "git" }
|
||||
-- vim.g.signify_sign_change = "*"
|
||||
vim.g.signify_sign_delete = "-"
|
||||
end,
|
||||
}
|
Reference in New Issue
Block a user