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>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><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 -- Slightly advanced example of overriding default behavior and theme
vim.keymap.set('n', '<leader>/', function() vim.keymap.set('n', '<leader>/', function()
-- You can pass additional configuration to Telescope to change the theme, layout, etc. -- You can pass additional configuration to Telescope to change the theme, layout, etc.
@ -697,16 +699,19 @@ require('lazy').setup({
end end
return 'make install_jsregexp' return 'make install_jsregexp'
end)(), end)(),
config = function()
require 'snippets'
end,
dependencies = { dependencies = {
-- `friendly-snippets` contains a variety of premade snippets. -- `friendly-snippets` contains a variety of premade snippets.
-- See the README about individual language/framework/plugin snippets: -- See the README about individual language/framework/plugin snippets:
-- https://github.com/rafamadriz/friendly-snippets -- https://github.com/rafamadriz/friendly-snippets
-- { {
-- 'rafamadriz/friendly-snippets', 'rafamadriz/friendly-snippets',
-- config = function() config = function()
-- require('luasnip.loaders.from_vscode').lazy_load() require('luasnip.loaders.from_vscode').lazy_load()
-- end, end,
-- }, },
}, },
}, },
'saadparwaiz1/cmp_luasnip', '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: -- OPTIONAL:
-- `nvim-notify` is only needed, if you want to use the notification view. -- `nvim-notify` is only needed, if you want to use the notification view.
-- If not available, we use `mini` as the fallback -- 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, group_empty = true,
}, },
filters = { filters = {
dotfiles = true, dotfiles = false,
}, },
} }
end, 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,9 +1,7 @@
return { return {
{ -- Add indentation guides even on blank lines {
'lukas-reineke/indent-blankline.nvim', 'lukas-reineke/indent-blankline.nvim',
-- Enable `lukas-reineke/indent-blankline.nvim` main = 'ibl',
-- See `:help ibl` opts = {},
main = 'ibl', },
opts = {},
},
} }

View File

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