added a whole bunch of plugins and a custom Zola snippet :D

This commit is contained in:
Joost Agterhoek 2024-09-11 16:55:49 +02:00
parent 47696240f3
commit b42073a951
11 changed files with 89 additions and 16 deletions

View File

@ -392,6 +392,8 @@ require('lazy').setup({
vim.keymap.set('n', '<leader>s.', builtin.oldfiles, { desc = '[S]earch Recent Files ("." for repeat)' })
vim.keymap.set('n', '<leader><leader>', builtin.buffers, { desc = '[ ] Find existing buffers' })
vim.keymap.set('n', '<leader>sl', ':Telescope luasnip<CR>', { desc = '[S]earch [L]uasnip' })
-- Slightly advanced example of overriding default behavior and theme
vim.keymap.set('n', '<leader>/', function()
-- You can pass additional configuration to Telescope to change the theme, layout, etc.
@ -697,16 +699,19 @@ require('lazy').setup({
end
return 'make install_jsregexp'
end)(),
config = function()
require 'snippets'
end,
dependencies = {
-- `friendly-snippets` contains a variety of premade snippets.
-- See the README about individual language/framework/plugin snippets:
-- https://github.com/rafamadriz/friendly-snippets
-- {
-- 'rafamadriz/friendly-snippets',
-- config = function()
-- require('luasnip.loaders.from_vscode').lazy_load()
-- end,
-- },
{
'rafamadriz/friendly-snippets',
config = function()
require('luasnip.loaders.from_vscode').lazy_load()
end,
},
},
},
'saadparwaiz1/cmp_luasnip',

View File

@ -0,0 +1,8 @@
return {
'iamcco/markdown-preview.nvim',
cmd = { 'MarkdownPreviewToggle', 'MarkdownPreview', 'MarkdownPreviewStop' },
ft = { 'markdown' },
build = function()
vim.fn['mkdp#util#install']()
end,
}

View File

@ -0,0 +1,5 @@
return {
'MeanderingProgrammer/render-markdown.nvim',
opts = {},
dependencies = { 'nvim-treesitter/nvim-treesitter' },
}

View File

@ -0,0 +1,7 @@
return {
'echasnovski/mini.align',
version = false,
config = function()
require('mini.align').setup()
end,
}

View File

@ -11,7 +11,7 @@ return {
-- OPTIONAL:
-- `nvim-notify` is only needed, if you want to use the notification view.
-- If not available, we use `mini` as the fallback
'rcarriga/nvim-notify',
-- 'rcarriga/nvim-notify',
},
},
}

View File

@ -13,7 +13,7 @@ return {
group_empty = true,
},
filters = {
dotfiles = true,
dotfiles = false,
},
}
end,

View File

@ -0,0 +1,10 @@
return {
'kylechui/nvim-surround',
version = '*', -- Use for stability; omit to use `main` branch for the latest features
event = 'VeryLazy',
config = function()
require('nvim-surround').setup {
-- Configuration here, or leave empty to use defaults
}
end,
}

View File

@ -0,0 +1,3 @@
return {
'benfowler/telescope-luasnip.nvim',
}

View File

@ -1,8 +1,6 @@
return {
{ -- Add indentation guides even on blank lines
{
'lukas-reineke/indent-blankline.nvim',
-- Enable `lukas-reineke/indent-blankline.nvim`
-- See `:help ibl`
main = 'ibl',
opts = {},
},

View File

@ -6,7 +6,7 @@ return {
config = function()
local lint = require 'lint'
lint.linters_by_ft = {
markdown = { 'markdownlint' },
-- markdown = { 'markdownlint' },
}
-- To allow other plugins to add linters to require('lint').linters_by_ft,

37
lua/snippets.lua Normal file
View File

@ -0,0 +1,37 @@
local ls = require 'luasnip'
-- some shorthands...
local snip = ls.snippet
local node = ls.snippet_node
local text = ls.text_node
local insert = ls.insert_node
local func = ls.function_node
local choice = ls.choice_node
local dynamicn = ls.dynamic_node
local date = function()
return { os.date '%Y-%m-%d' }
end
ls.add_snippets(nil, {
markdown = {
snip({
trig = 'blogpost',
namr = 'Zola blogpost Frontmatter',
dscr = 'Frontmatter metadata for Zola markdown blogpost',
}, {
text { '---', 'title = ' },
insert(1, 'note_title'),
text { '', 'author = Joost Agterhoek' },
text { '', 'date = ' },
func(date, {}),
text { '', 'updated = ' },
func(date, {}),
text { '', '[taxonomies]' },
text { '', "tags = ['" },
insert(2, ''),
text { "']" },
text { '', '---', '', '' },
insert(0),
}),
},
})