| 1 |
-- lualine extension for assistant.nvim |
| 2 |
|
| 3 |
local ok, assistant = pcall(require, 'assistant') |
| 4 |
|
| 5 |
if not ok then |
| 6 |
return nil |
| 7 |
end |
| 8 |
|
| 9 |
local M = {} |
| 10 |
|
| 11 |
M.sections = { |
| 12 |
lualine_a = { |
| 13 |
function() |
| 14 |
return 'Assistant' |
| 15 |
end, |
| 16 |
}, |
| 17 |
lualine_b = { |
| 18 |
function() |
| 19 |
return vim.bo.filetype:match('%w+.(%w+)') |
| 20 |
end, |
| 21 |
}, |
| 22 |
lualine_c = { |
| 23 |
function() |
| 24 |
return assistant.status()[vim.bo.filetype:match('%w+.(%w+)')] or '' |
| 25 |
end, |
| 26 |
}, |
| 27 |
} |
| 28 |
|
| 29 |
M.filetypes = { |
| 30 |
'assistant-panel', |
| 31 |
'assistant-previewer', |
| 32 |
'assistant-picker', |
| 33 |
'assistant-dialog', |
| 34 |
'assistant-patcher', |
| 35 |
} |
| 36 |
|
| 37 |
return M |