From 77f4a590b498322e5475a1dc20d60ef44a9e2a04 Mon Sep 17 00:00:00 2001 From: Robert Günzler Date: Fri, 11 Jun 2021 13:06:46 +0200 Subject: vim: update signify configuration --- .vim/lua/colors.lua | 14 +++++++------- .vim/lua/plugins/_lsp.lua | 16 ++++++++-------- .vim/lua/plugins/_signify.lua | 14 +++++++++----- 3 files changed, 24 insertions(+), 20 deletions(-) (limited to '.vim/lua') diff --git a/.vim/lua/colors.lua b/.vim/lua/colors.lua index de4a997..ac6109f 100644 --- a/.vim/lua/colors.lua +++ b/.vim/lua/colors.lua @@ -71,9 +71,9 @@ return lush(function() CursorColumn { ColorColumn }, -- Screen-column at the cursor, when 'cursorcolumn' is set. CursorLine { ColorColumn }, -- Screen-line at the cursor, when 'cursorline' is set. Low-priority if foreground (ctermfg OR guifg) is not set. -- Directory { }, -- directory names (and other special names in listings) - DiffAdd { fg = hsl(p.bright.green) }, -- diff mode: Added line |diff.txt| - DiffChange { fg = hsl(p.bright.cyan) }, -- diff mode: Changed line |diff.txt| - DiffDelete { fg = hsl(p.bright.red) }, -- diff mode: Deleted line |diff.txt| + DiffAdd { fg = hsl(p.bright.black), bg = hsl(p.bright.green) }, -- diff mode: Added line |diff.txt| + DiffChange { fg = hsl(p.bright.black), bg = hsl(p.bright.cyan) }, -- diff mode: Changed line |diff.txt| + DiffDelete { fg = hsl(p.bright.black), bg = hsl(p.bright.red) }, -- diff mode: Deleted line |diff.txt| DiffText { fg = hsl(p.normal.white) }, -- diff mode: Changed text within a changed line |diff.txt| EndOfBuffer { fg = hsl(p.bright.blue) }, -- filler lines (~) after the end of the buffer. By default, this is highlighted like |hl-NonText|. TermCursor { Cursor }, -- cursor in a focused terminal @@ -282,11 +282,11 @@ return lush(function() IndentGuidesEven { bg = hsl(p.dim.white).darken(40) }, SignifyLineChange { DiffChange }, - SignifySignChange { SignifyLineChange }, SignifyLineAdd { DiffAdd }, - SignifySignAdd { SignifyLineAdd }, SignifyLineDelete { DiffDelete }, - SignifySignDelete { SignifyLineDelete }, + SignifySignChange { fg = SignifyLineChange.bg }, + SignifySignAdd { fg = SignifyLineAdd.bg }, + SignifySignDelete { fg = SignifyLineDelete.bg }, -- git gitcommitSummary { Bold }, @@ -296,7 +296,7 @@ return lush(function() -- gitcommitUntrackedFile {}, -- gitcommitBranch {}, -- gitcommitDiscardedType {}, - gitcommitDiff { fg = hsl(p.dim.white) }, + gitcommitDiff { Comment }, diffFile { fg = hsl(p.bright.yellow) }, diffSubname { diffFile }, diffIndexLine { diffFile }, diff --git a/.vim/lua/plugins/_lsp.lua b/.vim/lua/plugins/_lsp.lua index 9c52998..39a10b9 100644 --- a/.vim/lua/plugins/_lsp.lua +++ b/.vim/lua/plugins/_lsp.lua @@ -32,9 +32,9 @@ local my_attach = function(client) u.augroup2 { lsp_user = { - {'BufWritePre', '*', 'lua vim.lsp.buf.formatting_sync(nil, 1000)'}, - {'BufWritePre', '*.go', 'lua vim.lsp.buf.code_action({ source = { organizeImports = true } })'}, - {'CursorHold', '*', 'lua vim.lsp.diagnostic.show_line_diagnostics()'}, + {'BufWritePre' , '*' , 'lua vim.lsp.buf.formatting_sync(nil, 1000)'}, + {'BufWritePre' , '*.go' , 'lua vim.lsp.buf.code_action({ source = { organizeImports = true } })'}, + -- {'CursorHold' , '*' , 'lua vim.lsp.diagnostic.show_line_diagnostics()'}, } } end @@ -43,10 +43,10 @@ end -- configure builtin diagnositcs vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with( -- {{{ vim.lsp.diagnostic.on_publish_diagnostics, { - virtual_text = false, - signs = true, - underline = true, - update_in_insert = true, + virtual_text = false, + signs = true, + underline = true, + update_in_insert = false, } ) -- }}} @@ -148,7 +148,7 @@ lsp.efm.setup{ on_attach = my_attach, root_dir = util.root_pattern('.git', '.editorconfig'), init_options = { documentFormatting = true }, - filetypes = { "sh" }, + -- filetypes = { "sh", "c" }, settings = { -- rootMarkers = {".git/"}, languages = { diff --git a/.vim/lua/plugins/_signify.lua b/.vim/lua/plugins/_signify.lua index a91ecb6..41ced80 100644 --- a/.vim/lua/plugins/_signify.lua +++ b/.vim/lua/plugins/_signify.lua @@ -1,6 +1,10 @@ +local def = require('utils').def +local nnoremap = require('astronauta.keymap').nnoremap + vim.g.signify_sign_change = '~' -require('utils').map('n', ']h', '(signify-next-hunk)', {silent=false}) -require('utils').map('n', '[h', '(signify-prev-hunk)') -vim.cmd('hi SignifySignChange guibg=NONE ctermbg=NONE') -vim.cmd('hi SignifySignAdd guibg=NONE ctermbg=NONE') -vim.cmd('hi SignifySignDelete guibg=NONE ctermbg=NONE') + +nnoremap { ']h', function() vim.fn['sy#jump#next_hunk'](1) end } +nnoremap { '[h', function() vim.fn['sy#jump#prev_hunk'](1) end } + +def("SignifyNextHunk", [[ call sy#jump#next_hunk(1) ]]) +def("SignifyPrevHunk", [[ call sy#jump#prev_hunk(1) ]]) -- cgit 1.4.1