/ yazi / init.lua
init.lua
 1  -- proper display of filesize and mtime
 2  function Linemode:size_and_mtime()
 3    local time = math.floor(self._file.cha.mtime or 0)
 4    if time == 0 then
 5      time = ''
 6    elseif os.date('%Y', time) == os.date('%Y') then
 7      time = os.date('%b %d %H:%M', time)
 8    else
 9      time = os.date('%b %d  %Y', time)
10    end
11  
12    local size = self._file:size()
13    return string.format('%s %s', size and ya.readable_size(size) or '-', time)
14  end
15  
16  -- [Plugin] https://github.com/hankertrix/augment-command.yazi
17  require('augment-command'):setup({
18    prompt = true,
19    default_item_group_for_prompt = 'none',
20    open_file_after_creation = true,
21    enter_directory_after_creation = true,
22    extract_retries = 5,
23    encrypt_archives = true,
24    smooth_scrolling = true,
25    create_item_delay = 0.1,
26    wraparound_file_navigation = false,
27  })
28  
29  -- [Plugin] https://github.com/dedukun/relative-motions.yazi
30  require('relative-motions'):setup({
31    show_numbers = 'relative',
32    show_motion = true,
33    enter_mode = 'first',
34  })
35  
36  -- Configure the git plugin
37  ---@diagnostic disable-next-line: inject-field
38  th.git = th.git
39    or {
40  
41      -- Colours
42      modified = ui.Style():fg('#0096DB'),
43      added = ui.Style():fg('#239549'),
44      untracked = ui.Style():fg('#B0B0B0'),
45      ignored = ui.Style():fg('#B0B0B0'),
46      deleted = ui.Style():fg('#D32752'),
47  
48      -- Unmerged
49      updated = ui.Style():fg('#CD32C0'),
50  
51      -- Icons
52      modified_sign = '',
53      added_sign = '',
54      untracked_sign = '󱋽',
55      ignored_sign = '',
56      deleted_sign = '',
57  
58      -- Unmerged
59      updated_sign = '',
60    }
61  
62  -- Set up the git plugin
63  require('git'):setup()