diff --git a/init.lua b/init.lua index 378d37c..e43be48 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', }, @@ -272,6 +276,14 @@ vim.o.termguicolors = true -- Set the spelling for English, French and German. vim.opt.spelllang = 'en,fr,de' +-- Set the folding level to 1, to allow level 2 headers to be seen. +vim.opt.foldlevel = 1 + +-- Set a python virtualenv as python3 provider. +-- `vim.env.HOME` uses the neovim API to fetch the $HOME env. +-- The `..` appends strings in lua. +vim.g.python3_host_prog = vim.env.HOME .. '/.pyenv/versions/neovim3/bin/python' + -- [[ Basic Keymaps ]] -- Keymaps for better default experience @@ -326,6 +338,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` @@ -455,6 +468,13 @@ local servers = { -- pyright = {}, -- rust_analyzer = {}, -- tsserver = {}, + + marksman = { + ft = { + 'markdown', + 'pandoc' + } + }, lua_ls = { Lua = { @@ -493,7 +513,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 = { @@ -533,6 +560,7 @@ cmp.setup { sources = { { name = 'nvim_lsp' }, { name = 'luasnip' }, + { name = 'path' }, }, } diff --git a/lua/custom/plugins/markdownpreview.lua b/lua/custom/plugins/markdownpreview.lua index 384fa10..c86b5d1 100644 --- a/lua/custom/plugins/markdownpreview.lua +++ b/lua/custom/plugins/markdownpreview.lua @@ -7,7 +7,10 @@ vim.cmd([[ let g:mkdp_theme = 'light' ]]) return { { "iamcco/markdown-preview.nvim", - ft = "pandoc", + ft = { + 'pandoc', + 'markdown' + }, lazy = true, build = "cd app && yarn install", }, diff --git a/lua/custom/plugins/mkdnflow.lua b/lua/custom/plugins/mkdnflow.lua index 1bc50e8..e965d83 100644 --- a/lua/custom/plugins/mkdnflow.lua +++ b/lua/custom/plugins/mkdnflow.lua @@ -9,11 +9,44 @@ vim.keymap.set({'n','x','v'}, 'tf', 'MkdnTableFormat', {desc = return { { "jakewvincent/mkdnflow.nvim", - ft = 'pandoc', + ft = { + 'pandoc', + 'markdown' + }, 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/lua/custom/plugins/rainbow-csv.lua b/lua/custom/plugins/rainbow-csv.lua new file mode 100644 index 0000000..e283dcf --- /dev/null +++ b/lua/custom/plugins/rainbow-csv.lua @@ -0,0 +1,21 @@ +-- In order to manage CSV files + +return { + 'cameron-wags/rainbow_csv.nvim', + config = true, + ft = { + 'csv', + 'tsv', + 'csv_semicolon', + 'csv_whitespace', + 'csv_pipe', + 'rfc_csv', + 'rfc_semicolon' + }, + cmd = { + 'RainbowDelim', + 'RainbowDelimSimple', + 'RainbowDelimQuoted', + 'RainbowMultiDelim' + } +} 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 diff --git a/spell/en.utf-8.add b/spell/en.utf-8.add new file mode 100644 index 0000000..f283b05 --- /dev/null +++ b/spell/en.utf-8.add @@ -0,0 +1,2 @@ +AoU +Floriane diff --git a/spell/en.utf-8.add.spl b/spell/en.utf-8.add.spl new file mode 100644 index 0000000..5405eba Binary files /dev/null and b/spell/en.utf-8.add.spl differ