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'
make distclean && make CC=gcc CMAKE_BUILD_TYPE=Release
doas rm -rf /usr/local/share/nvim/runtime/
make distclean && make CC=gcc CMAKE_BUILD_TYPE=Release && \
doas rm -rf /usr/local/share/nvim/runtime/ && \
doas make install
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
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
require('mini.files').setup({
mappings = {

View File

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

View File

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

View File

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

View File

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