-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: set ft early to trigger image.nvim/render-markdown.nvim... ci: remove stylua in flavour of editorconfig and lua_ls
- Loading branch information
Showing
12 changed files
with
155 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[*.lua] | ||
indent_style = space | ||
indent_size = 3 |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
local fzf = require "fzf-lua" | ||
local ui = require "feed.ui" | ||
local db = require "feed.db" | ||
local format = require "feed.ui.format" | ||
local builtin = require "fzf-lua.previewer.builtin" | ||
|
||
local MyPreviewer = builtin.base:extend() | ||
|
||
function MyPreviewer:new(o, opts, fzf_win) | ||
MyPreviewer.super.new(self, o, opts, fzf_win) | ||
setmetatable(self, MyPreviewer) | ||
return self | ||
end | ||
|
||
function MyPreviewer:populate_preview_buf(entry_str) | ||
local tmpbuf = self:get_tmp_buffer() | ||
self:set_preview_buf(tmpbuf) | ||
local id = entry_str:sub(-64, -1) | ||
ui.show_entry { buf = tmpbuf, id = id } | ||
vim.treesitter.start(tmpbuf, "markdown") | ||
self.win:update_scrollbar() | ||
end | ||
|
||
-- Disable line numbering and word wrap | ||
function MyPreviewer:gen_winopts() | ||
local new_winopts = { | ||
wrap = true, | ||
number = false, | ||
conceallevel = 3, | ||
} | ||
return vim.tbl_extend("force", self.winopts, new_winopts) | ||
end | ||
|
||
-- TODO: overide the default .. s | ||
-- TODO: grep | ||
|
||
local function feed_search() | ||
fzf.fzf_live(function(query) | ||
local on_display = ui.refresh { query = query, show = false } | ||
local ret = {} | ||
for i, id in ipairs(on_display) do | ||
ret[i] = format.entry(db[id]) .. (" "):rep(100) .. id | ||
end | ||
return ret | ||
end, { | ||
prompt = "> ", | ||
exec_empty_query = true, | ||
previewer = MyPreviewer, | ||
actions = { | ||
["ctrl-y"] = function(selected) | ||
local id = selected[1]:sub(-64, -1) | ||
ui.show_entry { id = id } | ||
end, | ||
}, | ||
}) | ||
end | ||
|
||
return { | ||
feed_search = feed_search, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.