diff --git a/lua/custom/fzf_lua.lua b/lua/custom/fzf_lua.lua index 8314988..614c64f 100644 --- a/lua/custom/fzf_lua.lua +++ b/lua/custom/fzf_lua.lua @@ -105,7 +105,7 @@ end -- Function for getting filename and copy it to + buffer local function copy_filename() local filepath = vim.fn.expand('%:t') - local output = string.format("%s", filepath) + local output = string.format("[[%s]]", filepath) vim.fn.setreg("+", output) print("Copied: " .. output) end @@ -159,3 +159,17 @@ keymap("n", "fn", function() no_esc = true, }) end, { desc = "FZF: display TODO comments" }) + +keymap("n", "fap", function() + fzf_lua.grep_curbuf({ + prompt = 'Problems (file)❯ ', + search = '━ Problem', + }) +end, { desc = "FZF: find problems in current file" }) + +keymap("n", "faq", function() + fzf_lua.grep_curbuf({ + prompt = 'Questions (file)❯ ', + search = '━ Question', + }) +end, { desc = "FZF: find questions in current file" }) diff --git a/lua/custom/snippets/markdown.lua b/lua/custom/snippets/markdown.lua index f808dc0..5d71aea 100644 --- a/lua/custom/snippets/markdown.lua +++ b/lua/custom/snippets/markdown.lua @@ -13,6 +13,16 @@ local fmt = require("luasnip.extras.fmt").fmt ls.add_snippets( "markdown", { + s({ trig = "imh", dscr = "Insert markdown task heading" }, + fmt( + [==[ + → [[#{} ✗]] + ]==], + { + i(0), + } + ) + ), s("link", { t("["), i(1, "description"), t("]("), f(function() @@ -40,16 +50,63 @@ ls.add_snippets( s({ trig = "iq", dscr = "Insert question" }, fmt( [[ -┏━━━━━━━━━━ Question ━━━━━━━━━━━ -? - #Question {} +┏━━━━━━━━━━━━━━ Question ✗ ━━━━━━━━━━━━━━━ +**Question** +{} + **Answer**: -┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + ]], + { + i(0), + } + ) + ), + s({ trig = "ip", dscr = "Insert problem" }, + fmt( + [[ +┏━━━━━━━━━━━━━━ Problem ✗ ━━━━━━━━━━━━━━━ +**Problem**: +{} + +**Solution**: + +┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + ]], + { + i(0), + } + ) + ), + + s({ trig = "isn", dscr = "Insert side notes" }, + fmt( + [[ +┏━━━━━━━━━━ Замтеки на полях ━━━━━━━━━━━ +**Тема**: {} +{} +┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + ]], + { + i(1), + i(2), + } + ) + ), + s({ trig = "ip", dscr = "Insert side notes" }, + fmt( + [[ +┏━━━━━━━━━━━━━━ Проблема ━━━━━━━━━━━━━━━ +- [ ] **Решена** +{} +┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ]], { i(0), } ) ) + } ) diff --git a/lua/custom/telescope.lua b/lua/custom/telescope.lua index dc69dba..b998bc0 100644 --- a/lua/custom/telescope.lua +++ b/lua/custom/telescope.lua @@ -74,7 +74,7 @@ end -- Function for getting filename and copy it to + buffer local function copy_filename() local filepath = vim.fn.expand('%:t') - local output = string.format("%s", filepath) + local output = string.format("[[%s]]", filepath) vim.fn.setreg("+", output) print("Copied: " .. output) end