global: improve the configuration
- Adds the rainbow_csv plugin to improve CSV file support. - Sets mutliple filetypes for markdown plugins (`pandoc`, `markdown`). - `mkdnflow`. - `markdownpreview`. - `marksman` language server (but it doesn't work for pandoc filetype). - Sets folding level to 1 to fold from the level 2 headings. - Adds completion capabilities for paths. - Adds to the pandoc filetype the markdown snippets. - Adds a markdown template for new files created inside mkdnflow. - Adds all useful filetypes for mkdnflow. - Adds a keymap to fuzzy search open buffers (<leader>sb). - Updates the English dictionnaries. - Installs the German dictionnaires. - Fixes the concatenation of strings for the pyenv path. Co-Authored-by: iGor milhit <igor@milhit.ch>main
parent
bfbd5df274
commit
cc2ec20a73
30
init.lua
30
init.lua
|
@ -96,6 +96,7 @@ require('lazy').setup({
|
||||||
|
|
||||||
{
|
{
|
||||||
-- Autocompletion
|
-- Autocompletion
|
||||||
|
-- See Configure nvim-cmp at the end of this file
|
||||||
'hrsh7th/nvim-cmp',
|
'hrsh7th/nvim-cmp',
|
||||||
dependencies = {
|
dependencies = {
|
||||||
-- Snippet Engine & its associated nvim-cmp source
|
-- Snippet Engine & its associated nvim-cmp source
|
||||||
|
@ -105,6 +106,9 @@ require('lazy').setup({
|
||||||
-- Adds LSP completion capabilities
|
-- Adds LSP completion capabilities
|
||||||
'hrsh7th/cmp-nvim-lsp',
|
'hrsh7th/cmp-nvim-lsp',
|
||||||
|
|
||||||
|
-- Adds path completion capabilities
|
||||||
|
'hrsh7th/cmp-path',
|
||||||
|
|
||||||
-- Adds a number of user-friendly snippets
|
-- Adds a number of user-friendly snippets
|
||||||
'rafamadriz/friendly-snippets',
|
'rafamadriz/friendly-snippets',
|
||||||
},
|
},
|
||||||
|
@ -272,6 +276,14 @@ vim.o.termguicolors = true
|
||||||
-- Set the spelling for English, French and German.
|
-- Set the spelling for English, French and German.
|
||||||
vim.opt.spelllang = 'en,fr,de'
|
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 ]]
|
-- [[ Basic Keymaps ]]
|
||||||
|
|
||||||
-- Keymaps for better default experience
|
-- Keymaps for better default experience
|
||||||
|
@ -326,6 +338,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>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>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>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 ]]
|
-- [[ Configure Treesitter ]]
|
||||||
-- See `:help nvim-treesitter`
|
-- See `:help nvim-treesitter`
|
||||||
|
@ -456,6 +469,13 @@ local servers = {
|
||||||
-- rust_analyzer = {},
|
-- rust_analyzer = {},
|
||||||
-- tsserver = {},
|
-- tsserver = {},
|
||||||
|
|
||||||
|
marksman = {
|
||||||
|
ft = {
|
||||||
|
'markdown',
|
||||||
|
'pandoc'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
lua_ls = {
|
lua_ls = {
|
||||||
Lua = {
|
Lua = {
|
||||||
workspace = { checkThirdParty = false },
|
workspace = { checkThirdParty = false },
|
||||||
|
@ -493,7 +513,14 @@ mason_lspconfig.setup_handlers {
|
||||||
local cmp = require 'cmp'
|
local cmp = require 'cmp'
|
||||||
local luasnip = require 'luasnip'
|
local luasnip = require 'luasnip'
|
||||||
require('luasnip.loaders.from_vscode').lazy_load()
|
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 {
|
cmp.setup {
|
||||||
snippet = {
|
snippet = {
|
||||||
|
@ -533,6 +560,7 @@ cmp.setup {
|
||||||
sources = {
|
sources = {
|
||||||
{ name = 'nvim_lsp' },
|
{ name = 'nvim_lsp' },
|
||||||
{ name = 'luasnip' },
|
{ name = 'luasnip' },
|
||||||
|
{ name = 'path' },
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,10 @@ vim.cmd([[ let g:mkdp_theme = 'light' ]])
|
||||||
return {
|
return {
|
||||||
{
|
{
|
||||||
"iamcco/markdown-preview.nvim",
|
"iamcco/markdown-preview.nvim",
|
||||||
ft = "pandoc",
|
ft = {
|
||||||
|
'pandoc',
|
||||||
|
'markdown'
|
||||||
|
},
|
||||||
lazy = true,
|
lazy = true,
|
||||||
build = "cd app && yarn install",
|
build = "cd app && yarn install",
|
||||||
},
|
},
|
||||||
|
|
|
@ -9,10 +9,43 @@ vim.keymap.set({'n','x','v'}, '<leader>tf', '<cmd>MkdnTableFormat<CR>', {desc =
|
||||||
return {
|
return {
|
||||||
{
|
{
|
||||||
"jakewvincent/mkdnflow.nvim",
|
"jakewvincent/mkdnflow.nvim",
|
||||||
ft = 'pandoc',
|
ft = {
|
||||||
|
'pandoc',
|
||||||
|
'markdown'
|
||||||
|
},
|
||||||
lazy = true,
|
lazy = true,
|
||||||
config = function ()
|
config = function ()
|
||||||
require('mkdnflow').setup({
|
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
|
end
|
||||||
}
|
}
|
||||||
|
|
|
@ -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'
|
||||||
|
}
|
||||||
|
}
|
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,2 @@
|
||||||
|
AoU
|
||||||
|
Floriane
|
Binary file not shown.
Loading…
Reference in New Issue