diff --git a/init.lua b/init.lua index 4a6e294..f8edabe 100644 --- a/init.lua +++ b/init.lua @@ -96,6 +96,7 @@ require('lazy').setup({ { -- Autocompletion + -- See Configure nvim-cmp at the end of this file 'hrsh7th/nvim-cmp', dependencies = { -- Snippet Engine & its associated nvim-cmp source @@ -105,6 +106,9 @@ require('lazy').setup({ -- Adds LSP completion capabilities 'hrsh7th/cmp-nvim-lsp', + -- Adds path completion capabilities + 'hrsh7th/cmp-path', + -- Adds a number of user-friendly snippets 'rafamadriz/friendly-snippets', }, @@ -277,7 +281,7 @@ vim.opt.foldlevel = 1 -- Set a python virtualenv as python3 provider. -- `vim.env.HOME` uses the neovim API to fetch the $HOME env. -vim.g.python3_host_prog = 'vim.env.HOME/.pyenv/versions/neovim3/bin/python' +vim.g.python3_host_prog = '/home/igor/.pyenv/versions/neovim3/bin/python' -- [[ Basic Keymaps ]] @@ -333,6 +337,7 @@ vim.keymap.set('n', 'sh', require('telescope.builtin').help_tags, { desc vim.keymap.set('n', 'sw', require('telescope.builtin').grep_string, { desc = '[S]earch current [W]ord' }) vim.keymap.set('n', 'sg', require('telescope.builtin').live_grep, { desc = '[S]earch by [G]rep' }) vim.keymap.set('n', 'sd', require('telescope.builtin').diagnostics, { desc = '[S]earch [D]iagnostics' }) +vim.keymap.set('n', 'sb', require('telescope.builtin').buffers, { desc = '[S]earch [B]uffers' }) -- [[ Configure Treesitter ]] -- See `:help nvim-treesitter` @@ -507,7 +512,14 @@ mason_lspconfig.setup_handlers { local cmp = require 'cmp' local luasnip = require 'luasnip' require('luasnip.loaders.from_vscode').lazy_load() -luasnip.config.setup {} +luasnip.config.setup { + -- Extend markdown snippets to pandoc filetype + -- https://github.com/L3MON4D3/LuaSnip/issues/132#issuecomment-1101710309 + snippets = { + markdown = {}, + }, + luasnip.filetype_extend("pandoc", {"markdown"}) +} cmp.setup { snippet = { @@ -547,6 +559,7 @@ cmp.setup { sources = { { name = 'nvim_lsp' }, { name = 'luasnip' }, + { name = 'path' }, }, } diff --git a/lua/custom/plugins/mkdnflow.lua b/lua/custom/plugins/mkdnflow.lua index dc5f678..e965d83 100644 --- a/lua/custom/plugins/mkdnflow.lua +++ b/lua/custom/plugins/mkdnflow.lua @@ -16,10 +16,37 @@ return { lazy = true, config = function () require('mkdnflow').setup({ + filetypes = { + md = true, + rmd = true, + markdown = true, + pandoc = true + }, links = { conceal = true, + }, + new_file_template = { + use_template = true, + template = [[ + --- + title: + date: {{ date }} + id: {{ id }} + tags: [] + --- +]], + placeholders = { + before = { + date = function () + return os.date("%Y-%m-%dT%H:%M:%S%z") + end, + id = function () + return os.date("%Y%m%d%H%M%S") + end + }, + } } - }) + }) end } } diff --git a/spell/de.utf-8.spl b/spell/de.utf-8.spl new file mode 100644 index 0000000..37cbbca Binary files /dev/null and b/spell/de.utf-8.spl differ diff --git a/spell/de.utf-8.sug b/spell/de.utf-8.sug new file mode 100644 index 0000000..13ff0a3 Binary files /dev/null and b/spell/de.utf-8.sug differ