diff --git a/init.lua b/init.lua index 49334c2..64317a5 100644 --- a/init.lua +++ b/init.lua @@ -392,6 +392,8 @@ require('lazy').setup({ vim.keymap.set('n', 's.', builtin.oldfiles, { desc = '[S]earch Recent Files ("." for repeat)' }) vim.keymap.set('n', '', builtin.buffers, { desc = '[ ] Find existing buffers' }) + vim.keymap.set('n', 'sl', ':Telescope luasnip', { desc = '[S]earch [L]uasnip' }) + -- Slightly advanced example of overriding default behavior and theme vim.keymap.set('n', '/', 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', diff --git a/lua/custom/plugins/markdown-preview.lua b/lua/custom/plugins/markdown-preview.lua new file mode 100644 index 0000000..b1591c3 --- /dev/null +++ b/lua/custom/plugins/markdown-preview.lua @@ -0,0 +1,8 @@ +return { + 'iamcco/markdown-preview.nvim', + cmd = { 'MarkdownPreviewToggle', 'MarkdownPreview', 'MarkdownPreviewStop' }, + ft = { 'markdown' }, + build = function() + vim.fn['mkdp#util#install']() + end, +} diff --git a/lua/custom/plugins/markdown.lua b/lua/custom/plugins/markdown.lua new file mode 100644 index 0000000..5b51511 --- /dev/null +++ b/lua/custom/plugins/markdown.lua @@ -0,0 +1,5 @@ +return { + 'MeanderingProgrammer/render-markdown.nvim', + opts = {}, + dependencies = { 'nvim-treesitter/nvim-treesitter' }, +} diff --git a/lua/custom/plugins/mini-align.lua b/lua/custom/plugins/mini-align.lua new file mode 100644 index 0000000..5b65978 --- /dev/null +++ b/lua/custom/plugins/mini-align.lua @@ -0,0 +1,7 @@ +return { + 'echasnovski/mini.align', + version = false, + config = function() + require('mini.align').setup() + end, +} diff --git a/lua/custom/plugins/noice.lua b/lua/custom/plugins/noice.lua index 6278aba..13277ad 100644 --- a/lua/custom/plugins/noice.lua +++ b/lua/custom/plugins/noice.lua @@ -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', }, }, } diff --git a/lua/custom/plugins/nvimtree.lua b/lua/custom/plugins/nvimtree.lua index 5f37179..cdc0ab4 100644 --- a/lua/custom/plugins/nvimtree.lua +++ b/lua/custom/plugins/nvimtree.lua @@ -13,7 +13,7 @@ return { group_empty = true, }, filters = { - dotfiles = true, + dotfiles = false, }, } end, diff --git a/lua/custom/plugins/surround.lua b/lua/custom/plugins/surround.lua new file mode 100644 index 0000000..e32286c --- /dev/null +++ b/lua/custom/plugins/surround.lua @@ -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, +} diff --git a/lua/custom/plugins/telescope-luasnip.lua b/lua/custom/plugins/telescope-luasnip.lua new file mode 100644 index 0000000..5d82b54 --- /dev/null +++ b/lua/custom/plugins/telescope-luasnip.lua @@ -0,0 +1,3 @@ +return { + 'benfowler/telescope-luasnip.nvim', +} diff --git a/lua/kickstart/plugins/indent_line.lua b/lua/kickstart/plugins/indent_line.lua index ed7f269..f41b600 100644 --- a/lua/kickstart/plugins/indent_line.lua +++ b/lua/kickstart/plugins/indent_line.lua @@ -1,9 +1,7 @@ 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 = {}, - }, + { + 'lukas-reineke/indent-blankline.nvim', + main = 'ibl', + opts = {}, + }, } diff --git a/lua/kickstart/plugins/lint.lua b/lua/kickstart/plugins/lint.lua index ca9bc23..557407d 100644 --- a/lua/kickstart/plugins/lint.lua +++ b/lua/kickstart/plugins/lint.lua @@ -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, diff --git a/lua/snippets.lua b/lua/snippets.lua new file mode 100644 index 0000000..b8eae9a --- /dev/null +++ b/lua/snippets.lua @@ -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), + }), + }, +})