Compare commits

...

5 commits

7 changed files with 35 additions and 83 deletions

View file

@ -1,5 +1,5 @@
function vb --description 'Build helper for neovim' function vb --description 'Build helper for neovim'
make distclean && make CC=gcc CMAKE_BUILD_TYPE=Release make distclean && make CC=gcc CMAKE_BUILD_TYPE=Release && \
doas rm -rf /usr/local/share/nvim/runtime/ doas rm -rf /usr/local/share/nvim/runtime/ && \
doas make install doas make install
end end

View file

@ -1,66 +0,0 @@
require('gitsigns').setup {
status_formatter = nil,
sign_priority = 6,
update_debounce = 100,
max_file_length = 10000,
signcolumn = true,
numhl = false,
linehl = false,
word_diff = false,
attach_to_untracked = false,
current_line_blame = false,
watch_gitdir = {
follow_files = true
},
preview_config = {
-- Options passed to nvim_open_win
border = 'single',
style = 'minimal',
relative = 'cursor',
row = 0,
col = 1
},
yadm = {
enable = false
},
signs = {
add = { text = '+' },
change = { text = '' },
delete = { text = '-' },
topdelete = { text = '' },
changedelete = { text = '~' },
},
on_attach = function(bufnr)
local gs = package.loaded.gitsigns
local function map(mode, l, r, opts)
opts = opts or {}
opts.buffer = bufnr
vim.keymap.set(mode, l, r, opts)
end
map('n', ']c', function()
if vim.wo.diff then return ']c' end
vim.schedule(function() gs.next_hunk() end)
return '<Ignore>'
end, {expr=true})
map('n', '[c', function()
if vim.wo.diff then return '[c' end
vim.schedule(function() gs.prev_hunk() end)
return '<Ignore>'
end, {expr=true})
map('n', '<Leader>hp', gs.preview_hunk)
map('n', '<Leader>hP', gs.preview_hunk_inline)
map('n', '<Leader>hl', gs.setloclist)
map('n', '<Leader>hq', gs.setqflist)
map('n', '<Leader>hQ', function() gs.setqflist('attached') end)
map('n', '<Leader>ht', gs.toggle_signs)
map('n', '<Leader>hu', gs.undo_stage_hunk)
map({'n', 'v'}, '<Leader>hs', ':Gitsigns stage_hunk<CR>')
map({'n', 'v'}, '<Leader>hr', ':Gitsigns reset_hunk<CR>')
map({'o', 'x'}, 'ih', ':<C-U>Gitsigns select_hunk<CR>')
end
}

View file

@ -3,6 +3,22 @@ local opts = { noremap=true, silent=true, unique=true }
-- Comment lines -- Comment lines
require('mini.comment').setup() require('mini.comment').setup()
-- Diff hunks
require('mini.diff').setup({
view = {
style = 'sign',
signs = { add = '+', change = '~', delete = '-' },
},
mappings = {
textobject = 'gh',
goto_prev = '[c',
goto_next = ']c',
goto_first = '<Leader>hf',
goto_last = '<Leader>hl',
apply = '<Leader>hs',
reset = '<Leader>hr',
},
})
-- File System -- File System
require('mini.files').setup({ require('mini.files').setup({
mappings = { mappings = {

View file

@ -136,19 +136,18 @@ M.get_git_branch = function(self)
end end
M.get_git_status = function(self) M.get_git_status = function(self)
local signs = vim.b.gitsigns_status_dict local is_git = fn.FugitiveHead() ~= ""
or { head = "", added = 0, changed = 0, removed = 0 } local signs = vim.b.minidiff_summary or { add = 0, change = 0, delete = 0 }
local is_head_empty = signs.head ~= ""
return is_head_empty return is_git
and string.format( and string.format(
" %s+%s %s~%s %s-%s", " %s+%s %s~%s %s-%s",
"%#DiffAdded#", "%#DiffAdded#",
signs.added or 0, signs.add,
"%#DiffChanged#", "%#DiffChanged#",
signs.changed or 0, signs.change,
"%#DiffRemoved#", "%#DiffRemoved#",
signs.removed or 0 signs.delete
) )
or "" or ""
end end
@ -204,8 +203,10 @@ M.progress = function()
end end
M.git_ahead_behind_status = function() M.git_ahead_behind_status = function()
local is_git = fn.FugitiveHead() ~= ""
return return
vim.b.gitsigns_status_dict is_git
and and
string.format(" %s%s%d%s%d", '%#GitStatus#', '', gstatus.behind, '', gstatus.ahead) string.format(" %s%s%d%s%d", '%#GitStatus#', '', gstatus.behind, '', gstatus.ahead)
or "" or ""

View file

@ -187,15 +187,16 @@ function M.hls_config()
cmd = { 'haskell-language-server-wrapper', '--lsp' }, cmd = { 'haskell-language-server-wrapper', '--lsp' },
capabilities = default_capabilities, capabilities = default_capabilities,
root_dir = root_directory, root_dir = root_directory,
filetypes = { 'haskell' }, filetypes = { 'cabal', 'haskell' },
single_file_support = true, single_file_support = true,
settings = { settings = {
haskell = { haskell = {
checkParents = 'CheckOnSave', checkParents = 'CheckOnSave',
checkProject = false, checkProject = false,
formattingProvider = 'ormolu', cabalFormattingProvider = 'cabalfmt',
maxCompletions = 20, formattingProvider = 'ormolu',
plugin = { stan = { globalOn = false } } maxCompletions = 20,
plugin = { stan = { globalOn = false } }
} }
}, },
} }

View file

@ -10,7 +10,6 @@ require "paq" {
'dcampos/nvim-snippy' , 'dcampos/nvim-snippy' ,
'honza/vim-snippets' , 'honza/vim-snippets' ,
-- Git -- Git
'lewis6991/gitsigns.nvim' ,
'tpope/vim-fugitive' , 'tpope/vim-fugitive' ,
'SanchayanMaity/gitlinker.nvim' , 'SanchayanMaity/gitlinker.nvim' ,
-- Quickfix -- Quickfix

View file

@ -15,3 +15,4 @@
--glob=!test/ --glob=!test/
--glob=!testHarness/ --glob=!testHarness/
--glob=!*/gst-integration-testsuites/* --glob=!*/gst-integration-testsuites/*
--glob=!NEWS