|
@@ -144,13 +144,6 @@ local telescope_previewers = require('telescope.previewers')
|
|
local telescope_putils = require('telescope.previewers.utils')
|
|
local telescope_putils = require('telescope.previewers.utils')
|
|
local telescope_conf = require('telescope.config').values
|
|
local telescope_conf = require('telescope.config').values
|
|
|
|
|
|
--- arbitrary git log picker
|
|
|
|
-vim.api.nvim_create_user_command('GLg', function(opts)
|
|
|
|
- local git_command = { "git", "log", "--pretty=oneline", "--abbrev-commit" }
|
|
|
|
- vim.list_extend(git_command, opts.fargs)
|
|
|
|
- telescope_builtin.git_commits({ git_command = git_command })
|
|
|
|
-end, { nargs = '*', complete = vim.fn['fugitive#LogComplete'] })
|
|
|
|
-
|
|
|
|
-- custom picker to fallback to files if no git
|
|
-- custom picker to fallback to files if no git
|
|
_G.project_files = function()
|
|
_G.project_files = function()
|
|
local ok = pcall(telescope_builtin.git_files, { show_untracked = true })
|
|
local ok = pcall(telescope_builtin.git_files, { show_untracked = true })
|
|
@@ -232,12 +225,17 @@ MiniDiff.setup({
|
|
}
|
|
}
|
|
})
|
|
})
|
|
|
|
|
|
|
|
+local function section_git(args)
|
|
|
|
+ if MiniStatusline.is_truncated(args.trunc_width) then return '' end
|
|
|
|
+ return vim.fn.FugitiveHead()
|
|
|
|
+end
|
|
|
|
+
|
|
require('mini.statusline').setup({
|
|
require('mini.statusline').setup({
|
|
content = {
|
|
content = {
|
|
-- copy-pasted from default, we just want to remove the icon
|
|
-- copy-pasted from default, we just want to remove the icon
|
|
active = function()
|
|
active = function()
|
|
local mode, mode_hl = MiniStatusline.section_mode({ trunc_width = 120 })
|
|
local mode, mode_hl = MiniStatusline.section_mode({ trunc_width = 120 })
|
|
- local git = MiniStatusline.section_git({ trunc_width = 75, icon = '' })
|
|
|
|
|
|
+ local git = section_git({ trunc_width = 75 })
|
|
local diagnostics = MiniStatusline.section_diagnostics({ trunc_width = 75, icon = '' })
|
|
local diagnostics = MiniStatusline.section_diagnostics({ trunc_width = 75, icon = '' })
|
|
local filename = MiniStatusline.section_filename({ trunc_width = 140 })
|
|
local filename = MiniStatusline.section_filename({ trunc_width = 140 })
|
|
local fileinfo = MiniStatusline.section_fileinfo({ trunc_width = 120 })
|
|
local fileinfo = MiniStatusline.section_fileinfo({ trunc_width = 120 })
|
|
@@ -374,6 +372,9 @@ require('treesitter-context').setup({
|
|
multiline_threshold = 5,
|
|
multiline_threshold = 5,
|
|
})
|
|
})
|
|
|
|
|
|
|
|
+-- Treesitter navigation
|
|
|
|
+require('treewalker').setup()
|
|
|
|
+
|
|
-- completion
|
|
-- completion
|
|
require('blink.cmp').setup({
|
|
require('blink.cmp').setup({
|
|
cmdline = {
|
|
cmdline = {
|
|
@@ -424,3 +425,8 @@ _G.toggle_end_char = function(char)
|
|
vim.api.nvim_buf_set_text(0, row, -1, row, -1, { char })
|
|
vim.api.nvim_buf_set_text(0, row, -1, row, -1, { char })
|
|
end
|
|
end
|
|
end
|
|
end
|
|
|
|
+
|
|
|
|
+-- prettier git log, relies on additional syntax highlights
|
|
|
|
+vim.api.nvim_create_user_command('GLg', function(opts)
|
|
|
|
+ vim.cmd("Git ++curwin log --abbrev-commit --graph --pretty='%h %d %s (%cr) <%an>' " .. opts.args)
|
|
|
|
+end, { nargs = '?', complete = vim.fn['fugitive#LogComplete'] })
|