|
@@ -15,7 +15,7 @@ vim.filetype.add({
|
|
|
-- helpers
|
|
|
local function resolve_git_path(buf_id)
|
|
|
local bufname = vim.api.nvim_buf_get_name(buf_id)
|
|
|
- if not vim.startswith(bufname, "fugitive://") then
|
|
|
+ if not vim.startswith(bufname, 'fugitive://') then
|
|
|
return false
|
|
|
end
|
|
|
|
|
@@ -23,7 +23,7 @@ local function resolve_git_path(buf_id)
|
|
|
local resolved_path = parsed[1]
|
|
|
local repo = parsed[2]
|
|
|
|
|
|
- if resolved_path == "" then
|
|
|
+ if resolved_path == '' then
|
|
|
return false
|
|
|
end
|
|
|
|
|
@@ -88,23 +88,23 @@ require('telescope').setup({
|
|
|
|
|
|
vimgrep_arguments = {
|
|
|
-- defaults
|
|
|
- "rg",
|
|
|
- "--color=never",
|
|
|
- "--no-heading",
|
|
|
- "--with-filename",
|
|
|
- "--line-number",
|
|
|
- "--column",
|
|
|
- "--smart-case",
|
|
|
+ 'rg',
|
|
|
+ '--color=never',
|
|
|
+ '--no-heading',
|
|
|
+ '--with-filename',
|
|
|
+ '--line-number',
|
|
|
+ '--column',
|
|
|
+ '--smart-case',
|
|
|
-- search "hidden" files except git folder
|
|
|
- "--hidden",
|
|
|
- "--iglob=!.git"
|
|
|
+ '--hidden',
|
|
|
+ '--iglob=!.git'
|
|
|
},
|
|
|
|
|
|
-- ignore things we're likely not to edit
|
|
|
file_ignore_patterns = {
|
|
|
- "%.zip$",
|
|
|
- "%.yarn/releases/",
|
|
|
- "%.yarn/plugins/"
|
|
|
+ '%.zip$',
|
|
|
+ '%.yarn/releases/',
|
|
|
+ '%.yarn/plugins/'
|
|
|
},
|
|
|
|
|
|
-- picker history
|
|
@@ -123,7 +123,7 @@ require('telescope').setup({
|
|
|
},
|
|
|
},
|
|
|
find_files = {
|
|
|
- find_command = { "fd", "--type", "f", "--strip-cwd-prefix" }
|
|
|
+ find_command = { 'fd', '--type', 'f', '--strip-cwd-prefix' }
|
|
|
},
|
|
|
git_commits = {
|
|
|
mappings = commit_mappings,
|
|
@@ -154,16 +154,16 @@ end
|
|
|
_G.commit_files = function(opts)
|
|
|
local resolved = resolve_git_path(0)
|
|
|
if not resolved then
|
|
|
- vim.print("current file is not a fugitive path")
|
|
|
+ vim.print('current file is not a fugitive path')
|
|
|
return
|
|
|
end
|
|
|
|
|
|
opts = opts or {}
|
|
|
telescope_pickers.new(opts, {
|
|
|
prompt_title = resolved.commit,
|
|
|
- finder = telescope_finders.new_oneshot_job({ "git", "ls-tree", "--name-only", "-r", resolved.commit }, {
|
|
|
+ finder = telescope_finders.new_oneshot_job({ 'git', 'ls-tree', '--name-only', '-r', resolved.commit }, {
|
|
|
entry_maker = function(entry)
|
|
|
- local path = string.format("fugitive://%s//%s/%s", resolved.repo, resolved.commit, entry)
|
|
|
+ local path = string.format('fugitive://%s//%s/%s', resolved.repo, resolved.commit, entry)
|
|
|
return {
|
|
|
path = path,
|
|
|
value = entry,
|
|
@@ -210,14 +210,14 @@ MiniDiff.setup({
|
|
|
MiniDiff.gen_source.git(),
|
|
|
-- handle fugitive paths
|
|
|
{
|
|
|
- name = "fugitive",
|
|
|
+ name = 'fugitive',
|
|
|
attach = function(buf_id)
|
|
|
local resolved = resolve_git_path(buf_id)
|
|
|
- if not resolved or resolved.path == "" then
|
|
|
+ if not resolved or resolved.path == '' then
|
|
|
return false
|
|
|
end
|
|
|
|
|
|
- local source = vim.fn.FugitiveFind(string.format("%s~1:%s", resolved.commit, resolved.path))
|
|
|
+ local source = vim.fn.FugitiveFind(string.format('%s~1:%s', resolved.commit, resolved.path))
|
|
|
local text = vim.fn['fugitive#readfile'](source)
|
|
|
MiniDiff.set_ref_text(buf_id, text)
|
|
|
end
|
|
@@ -242,8 +242,8 @@ require('mini.statusline').setup({
|
|
|
local location = MiniStatusline.section_location({ trunc_width = 75 })
|
|
|
|
|
|
return MiniStatusline.combine_groups({
|
|
|
- { hl = mode_hl, strings = { mode } },
|
|
|
- { hl = 'MiniStatuslineDevinfo', strings = { git, diagnostics } },
|
|
|
+ { hl = mode_hl, strings = { mode } },
|
|
|
+ { hl = 'MiniStatuslineDevinfo', strings = { git, diagnostics } },
|
|
|
'%<', -- Mark general truncate point
|
|
|
{ hl = 'MiniStatuslineFilename', strings = { filename } },
|
|
|
'%=', -- End left alignment
|
|
@@ -341,9 +341,9 @@ require('nvim-treesitter.configs').setup({
|
|
|
incremental_selection = {
|
|
|
enable = true,
|
|
|
keymaps = {
|
|
|
- init_selection = "]t",
|
|
|
- node_incremental = "]t",
|
|
|
- node_decremental = "[t",
|
|
|
+ init_selection = ']t',
|
|
|
+ node_incremental = ']t',
|
|
|
+ node_decremental = '[t',
|
|
|
},
|
|
|
},
|
|
|
textobjects = {
|
|
@@ -398,8 +398,8 @@ require('blink.cmp').setup({
|
|
|
menu = {
|
|
|
draw = {
|
|
|
columns = {
|
|
|
- { "label", "label_description", gap = 1 },
|
|
|
- { "kind" },
|
|
|
+ { 'label', 'label_description', gap = 1 },
|
|
|
+ { 'kind' },
|
|
|
},
|
|
|
},
|
|
|
},
|