global: add completion capabilites
- Add completion capabilities for paths. - Add to the pandoc filetype the markdown snippets. - Add a markdown template for new files created inside mkdnflow. - Add all useful filetypes for mkdnflow. - Add a keymap to fuzzy search open buffers (<leader>sb). - Removes the `vim.env.HOME` variable in the python3 provider, as it is not working properly. Co-Authored-by: iGor milhit <igor.milhit@unige.ch>
parent
c3b5f943f7
commit
29781fb96e
17
init.lua
17
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', '<leader>sh', require('telescope.builtin').help_tags, { desc
|
|||
vim.keymap.set('n', '<leader>sw', require('telescope.builtin').grep_string, { desc = '[S]earch current [W]ord' })
|
||||
vim.keymap.set('n', '<leader>sg', require('telescope.builtin').live_grep, { desc = '[S]earch by [G]rep' })
|
||||
vim.keymap.set('n', '<leader>sd', require('telescope.builtin').diagnostics, { desc = '[S]earch [D]iagnostics' })
|
||||
vim.keymap.set('n', '<leader>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' },
|
||||
},
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue