Compare commits
35 Commits
b38ae3f45e
...
40ff774acf
Author | SHA1 | Date |
---|---|---|
iGor milhit | 40ff774acf | |
iGor milhit | 9602fcf4d2 | |
iGor milhit | e884ce33b2 | |
iGor milhit | b5b9e7216c | |
iGor milhit | 279d078208 | |
iGor milhit | 327fbe7256 | |
iGor milhit | d2ebe0e57f | |
iGor milhit | e72b364cec | |
iGor milhit | 08b7169b54 | |
iGor milhit | 80dd338b4a | |
iGor milhit | 769278dff9 | |
iGor milhit | 1585f558ba | |
iGor milhit | 0f0b1ee56a | |
iGor milhit | 2ba65a9f5f | |
iGor milhit | 0fb6a4a7b4 | |
iGor milhit | 97c6ac262e | |
iGor milhit | c02afa6bbe | |
iGor milhit | 53f0665f05 | |
iGor milhit | 6e02172511 | |
iGor milhit | 049a6e7b14 | |
iGor milhit | 1f9d1c7657 | |
iGor milhit | b30b439e71 | |
iGor milhit | 980b84a0e0 | |
iGor milhit | c9af70e82e | |
iGor milhit | 402e5a9308 | |
iGor milhit | 376091e78d | |
iGor milhit | aa2f3c9615 | |
iGor milhit | fa8a07a7b8 | |
iGor milhit | 4ce0a81056 | |
iGor milhit | 8eafbbedd7 | |
iGor milhit | 6f316190e5 | |
iGor milhit | a6a823e0d3 | |
iGor milhit | 0485ae6ed5 | |
iGor milhit | 1b188ceafd | |
iGor milhit | 5c7726586f |
|
@ -7,3 +7,9 @@ autoload
|
|||
|
||||
# spell *.spl
|
||||
spell/fr.utf-8.add.spl
|
||||
|
||||
tags
|
||||
test.sh
|
||||
.luarc.json
|
||||
nvim
|
||||
lazy-lock.json
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
-- Specific settings for JSON files
|
||||
-- Use treesitter for folding
|
||||
-- Disable the color column
|
||||
|
||||
vim.opt.foldmethod="expr"
|
||||
vim.opt.foldexpr="nvim_treesitter#foldexpr()"
|
||||
vim.opt.foldlevel=3
|
||||
vim.opt.colorcolumn=""
|
128
init.lua
128
init.lua
|
@ -35,6 +35,7 @@ I hope you enjoy your Neovim journey,
|
|||
|
||||
P.S. You can delete this when you're done too. It's your config now :)
|
||||
--]]
|
||||
|
||||
-- Set <space> as the leader key
|
||||
-- See `:help mapleader`
|
||||
-- NOTE: Must happen before plugins are required (otherwise wrong leader will be used)
|
||||
|
@ -67,11 +68,13 @@ require('lazy').setup({
|
|||
|
||||
-- Git related plugins
|
||||
'tpope/vim-fugitive',
|
||||
'tpope/vim-rhubarb',
|
||||
|
||||
-- Detect tabstop and shiftwidth automatically
|
||||
'tpope/vim-sleuth',
|
||||
|
||||
-- Improve surroundings management
|
||||
'tpope/vim-surround',
|
||||
|
||||
-- NOTE: This is where your plugins related to LSP can be installed.
|
||||
-- The configuration is done below. Search for lspconfig to find it below.
|
||||
{
|
||||
|
@ -84,7 +87,7 @@ require('lazy').setup({
|
|||
|
||||
-- Useful status updates for LSP
|
||||
-- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})`
|
||||
{ 'j-hui/fidget.nvim', opts = {} },
|
||||
{ 'j-hui/fidget.nvim', tag = "legacy", opts = {} },
|
||||
|
||||
-- Additional lua configuration, makes nvim stuff amazing!
|
||||
'folke/neodev.nvim',
|
||||
|
@ -93,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
|
||||
|
@ -102,6 +106,12 @@ require('lazy').setup({
|
|||
-- Adds LSP completion capabilities
|
||||
'hrsh7th/cmp-nvim-lsp',
|
||||
|
||||
-- Adds completion capabilities for text in buffers
|
||||
'hrsh7th/cmp-buffer',
|
||||
|
||||
-- Adds path completion capabilities
|
||||
'hrsh7th/cmp-path',
|
||||
|
||||
-- Adds a number of user-friendly snippets
|
||||
'rafamadriz/friendly-snippets',
|
||||
},
|
||||
|
@ -130,11 +140,17 @@ require('lazy').setup({
|
|||
},
|
||||
|
||||
{
|
||||
-- Theme inspired by Atom
|
||||
'navarasu/onedark.nvim',
|
||||
-- Nordic Theme
|
||||
'andersevenrud/nordic.nvim',
|
||||
priority = 1000,
|
||||
config = function()
|
||||
vim.cmd.colorscheme 'onedark'
|
||||
require('nordic').colorscheme({
|
||||
underline_option = 'none',
|
||||
italic = true,
|
||||
italic_comments = false,
|
||||
minimal_mode = false,
|
||||
alternate_backgrounds = false
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
|
@ -145,9 +161,9 @@ require('lazy').setup({
|
|||
opts = {
|
||||
options = {
|
||||
icons_enabled = true,
|
||||
theme = 'onedark',
|
||||
theme = 'nord',
|
||||
component_separators = '|',
|
||||
section_separators = '/',
|
||||
section_separators = '',
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -182,6 +198,16 @@ require('lazy').setup({
|
|||
end,
|
||||
},
|
||||
|
||||
-- Extension to telescope to use Ag (or ripgrep) to filter results
|
||||
{
|
||||
'kelly-lin/telescope-ag'
|
||||
},
|
||||
|
||||
-- Allow to search for snippets
|
||||
{
|
||||
'benfowler/telescope-luasnip.nvim'
|
||||
},
|
||||
|
||||
{
|
||||
-- Highlight, edit, and navigate code
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
|
@ -205,16 +231,29 @@ require('lazy').setup({
|
|||
{ import = 'custom.plugins' },
|
||||
}, {})
|
||||
|
||||
-- Restore the site folder of .local/share/nvim/ in the runtime rewritten by
|
||||
-- lazy. See https://github.com/neovim/neovim/issues/23082#issuecomment-1510812311
|
||||
vim.opt.rtp:append (vim.fn.stdpath ('data') .. '/site')
|
||||
|
||||
-- [[ Setting options ]]
|
||||
-- See `:help vim.o`
|
||||
-- NOTE: You can change these options as you wish!
|
||||
|
||||
-- Set highlight on search
|
||||
vim.o.hlsearch = false
|
||||
vim.o.hlsearch = true
|
||||
|
||||
-- Preview changes when searching and substituing
|
||||
-- nosplit avoid to display the preview in a separate split
|
||||
vim.o.inccommand = "nosplit"
|
||||
|
||||
-- Make line numbers default
|
||||
vim.wo.number = true
|
||||
|
||||
-- Set the maximum width of a line
|
||||
vim.opt.textwidth = 79
|
||||
-- Display the cusor column at 79+1 column
|
||||
vim.opt.colorcolumn:append('+1')
|
||||
|
||||
-- Enable mouse mode
|
||||
vim.o.mouse = 'a'
|
||||
|
||||
|
@ -247,6 +286,17 @@ vim.o.completeopt = 'menuone,noselect'
|
|||
-- NOTE: You should make sure your terminal supports this
|
||||
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
|
||||
|
@ -283,6 +333,10 @@ require('telescope').setup {
|
|||
|
||||
-- Enable telescope fzf native, if installed
|
||||
pcall(require('telescope').load_extension, 'fzf')
|
||||
-- Enable telescope luasnip extension, if installed
|
||||
pcall(require('telescope').load_extension, 'luasnip')
|
||||
-- Enable telescope-ag extension, if installed
|
||||
pcall(require('telescope').load_extension, 'ag')
|
||||
|
||||
-- See `:help telescope.builtin`
|
||||
vim.keymap.set('n', '<leader>?', require('telescope.builtin').oldfiles, { desc = '[?] Find recently opened files' })
|
||||
|
@ -301,12 +355,14 @@ 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' })
|
||||
vim.keymap.set('n', '<leader>ss', require'telescope'.extensions.luasnip.luasnip , { desc = '[S]earch [S]nippets' })
|
||||
|
||||
-- [[ Configure Treesitter ]]
|
||||
-- See `:help nvim-treesitter`
|
||||
require('nvim-treesitter.configs').setup {
|
||||
-- Add languages to be installed here that you want installed for treesitter
|
||||
ensure_installed = { 'c', 'cpp', 'go', 'lua', 'python', 'rust', 'tsx', 'typescript', 'vimdoc', 'vim' },
|
||||
ensure_installed = { 'c', 'cpp', 'go', 'lua', 'python', 'rust', 'tsx', 'typescript', 'vimdoc', 'vim', 'json' },
|
||||
|
||||
-- Autoinstall languages that are not installed. Defaults to false (but you can change for yourself!)
|
||||
auto_install = false,
|
||||
|
@ -431,12 +487,40 @@ local servers = {
|
|||
-- rust_analyzer = {},
|
||||
-- tsserver = {},
|
||||
|
||||
marksman = {
|
||||
ft = {
|
||||
'markdown',
|
||||
'pandoc'
|
||||
}
|
||||
},
|
||||
|
||||
lua_ls = {
|
||||
Lua = {
|
||||
workspace = { checkThirdParty = false },
|
||||
telemetry = { enable = false },
|
||||
},
|
||||
},
|
||||
|
||||
texlab = {
|
||||
settings = {
|
||||
build = {
|
||||
executable = "tectonic",
|
||||
args = {
|
||||
"-X",
|
||||
"compile",
|
||||
"%f",
|
||||
"--syntex",
|
||||
"--keep-logs",
|
||||
"--keep-intermediates"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
-- Require vscode-langservers-extracted
|
||||
-- https://github.com/hrsh7th/vscode-langservers-extracted
|
||||
jsonls = {
|
||||
},
|
||||
}
|
||||
|
||||
-- Setup neovim lua configuration
|
||||
|
@ -463,12 +547,26 @@ mason_lspconfig.setup_handlers {
|
|||
end,
|
||||
}
|
||||
|
||||
-- [[ Configure nvim-cmp ]]
|
||||
-- [[ Configure nvim-cmp, and LuaSnip ]]
|
||||
-- See `:help cmp`
|
||||
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"}),
|
||||
}
|
||||
|
||||
-- Load snippets from ~/.config/nvim/LuaSnip/
|
||||
require("luasnip.loaders.from_lua").load({paths = "~/.config/nvim/my_snippets/"})
|
||||
|
||||
-- Keymap to reload snippets
|
||||
-- https://www.ejmastnak.com/tutorials/vim-latex/luasnip/#refreshing-snippets-from-a-separate-vim-instance
|
||||
vim.keymap.set('n', '<Leader>L', '<Cmd>lua require("luasnip.loaders.from_lua").load({paths = "~/.config/nvim/my_snippets/"})<CR>', { desc = 'Reload [L]uaSnippets' })
|
||||
|
||||
cmp.setup {
|
||||
snippet = {
|
||||
|
@ -507,7 +605,15 @@ cmp.setup {
|
|||
},
|
||||
sources = {
|
||||
{ name = 'nvim_lsp' },
|
||||
{
|
||||
name = 'buffer',
|
||||
option = {
|
||||
keyword_length = 4,
|
||||
keyword_pattern = [[\k\+]],
|
||||
},
|
||||
},
|
||||
{ name = 'luasnip' },
|
||||
{ name = 'path' },
|
||||
},
|
||||
}
|
||||
|
||||
|
|
|
@ -1,31 +0,0 @@
|
|||
{
|
||||
"Comment.nvim": { "branch": "master", "commit": "e1fe53117aab24c378d5e6deaad786789c360123" },
|
||||
"LuaSnip": { "branch": "master", "commit": "a83e4b1ba7edc6fecdad09e39753a7d5eee1d01c" },
|
||||
"cmp-nvim-lsp": { "branch": "main", "commit": "0e6b2ed705ddcff9738ec4ea838141654f12eeef" },
|
||||
"cmp_luasnip": { "branch": "master", "commit": "18095520391186d634a0045dacaa346291096566" },
|
||||
"fidget.nvim": { "branch": "main", "commit": "0ba1e16d07627532b6cae915cc992ecac249fb97" },
|
||||
"friendly-snippets": { "branch": "main", "commit": "8875cccf779160303bf2bed7d422717676f214fd" },
|
||||
"gitsigns.nvim": { "branch": "main", "commit": "f868d82a36f7f7f5e110eb0a9659993984f59875" },
|
||||
"indent-blankline.nvim": { "branch": "master", "commit": "ceaf730b13e332cd76600d9795722413c236c684" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "ebdd0499551765e6a7aba220cc8ae4e0cdb6be69" },
|
||||
"lualine.nvim": { "branch": "master", "commit": "05d78e9fd0cdfb4545974a5aa14b1be95a86e9c9" },
|
||||
"markdown-preview.nvim": { "branch": "master", "commit": "02cc3874738bc0f86e4b91f09b8a0ac88aef8e96" },
|
||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "f0ce33f4794a2364eb08d09d09380e8b04ec5e6a" },
|
||||
"mason.nvim": { "branch": "main", "commit": "08b2fd308e0107eab9f0b59d570b69089fd0b522" },
|
||||
"neo-tree.nvim": { "branch": "v2.x", "commit": "8c89efb93b8383666a6f989762c2f610f5f2c930" },
|
||||
"neodev.nvim": { "branch": "main", "commit": "da3e9e05c60250984f1bf069d517d9fca5315453" },
|
||||
"nui.nvim": { "branch": "main", "commit": "2b2732528e4a79eb8542568bd51d25f710395bd6" },
|
||||
"nvim-cmp": { "branch": "main", "commit": "b43bfaf3229d6b39d8baaa567b13c6be0623bf12" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "9166622781a39a829878d1fd24c174529d996838" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "e23d5493cf14401ef02ec2e4e99b65f199869966" },
|
||||
"nvim-treesitter-textobjects": { "branch": "master", "commit": "95b76b95eff25e1e64f363938cd853852355d70a" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "2a125024a137677930efcfdf720f205504c97268" },
|
||||
"onedark.nvim": { "branch": "master", "commit": "f6e82074761473d30a722f5d90c60282de1ac41d" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "52544825d6b8be677eb395983515ad5e30ae1f2e" },
|
||||
"telescope-fzf-native.nvim": { "branch": "main", "commit": "9bc8237565ded606e6c366a71c64c0af25cd7a50" },
|
||||
"telescope.nvim": { "branch": "0.1.x", "commit": "533c7fb1b3fb412a16e1c1c9cf6d2b1ac130f1b7" },
|
||||
"vim-fugitive": { "branch": "master", "commit": "5f0d280b517cacb16f59316659966c7ca5e2bea2" },
|
||||
"vim-rhubarb": { "branch": "master", "commit": "ee69335de176d9325267b0fd2597a22901d927b1" },
|
||||
"vim-sleuth": { "branch": "master", "commit": "1cc4557420f215d02c4d2645a748a816c220e99b" },
|
||||
"which-key.nvim": { "branch": "main", "commit": "e271c28118998c93a14d189af3395812a1aa646c" }
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
-- File: lua/custom/plugins/autopairs.lua
|
||||
|
||||
return {
|
||||
"windwp/nvim-autopairs",
|
||||
-- Optional dependency
|
||||
dependencies = { 'hrsh7th/nvim-cmp' },
|
||||
config = function()
|
||||
require("nvim-autopairs").setup {}
|
||||
-- If you want to automatically add `(` after selecting a function or method
|
||||
local cmp_autopairs = require('nvim-autopairs.completion.cmp')
|
||||
local cmp = require('cmp')
|
||||
cmp.event:on(
|
||||
'confirm_done',
|
||||
cmp_autopairs.on_confirm_done()
|
||||
)
|
||||
end,
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
-- Plugin to get Grammalecte checks in (neo)vim.
|
||||
|
||||
-- Set the path to the grammalecte-cli executable
|
||||
vim.cmd([[ let g:grammalecte_cli_py = "/usr/bin/grammalecte-cli" ]])
|
||||
|
||||
return {
|
||||
"dpelle/vim-Grammalecte",
|
||||
ft = {
|
||||
"pandoc",
|
||||
"markdown",
|
||||
"text",
|
||||
"gitcommit"
|
||||
}
|
||||
}
|
|
@ -4,8 +4,11 @@
|
|||
return {
|
||||
{
|
||||
"iamcco/markdown-preview.nvim",
|
||||
ft = "markdown",
|
||||
ft = {
|
||||
'pandoc',
|
||||
'markdown'
|
||||
},
|
||||
lazy = true,
|
||||
build = "cd app && npm install && git reset --hard",
|
||||
}
|
||||
},
|
||||
}
|
||||
|
|
|
@ -0,0 +1,56 @@
|
|||
-- Mkdownflow plugin.
|
||||
-- Allows to follow links, anchors, create links, and many more.
|
||||
-- https://github.com/jakewvincent/mkdnflow.nvim
|
||||
|
||||
-- Keymaps for mkdnflow.
|
||||
-- Table
|
||||
vim.keymap.set({'n','x','v'}, '<leader>tf', '<cmd>MkdnTableFormat<CR>', {desc = 'Format table under cursor'})
|
||||
|
||||
return {
|
||||
{
|
||||
"jakewvincent/mkdnflow.nvim",
|
||||
ft = {
|
||||
'pandoc',
|
||||
'markdown'
|
||||
},
|
||||
lazy = true,
|
||||
config = function ()
|
||||
require('mkdnflow').setup({
|
||||
filetypes = {
|
||||
md = true,
|
||||
rmd = true,
|
||||
markdown = true,
|
||||
pandoc = true
|
||||
},
|
||||
perspective = {
|
||||
-- Ensure that paths are relative to the current file
|
||||
priority = "current"
|
||||
},
|
||||
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
|
||||
}
|
||||
}
|
|
@ -1,4 +1,5 @@
|
|||
-- Trying to add a custom plugin for file tree
|
||||
-- Plugin for file tree: neo-tree
|
||||
-- Using the kickstart and the neo-tree documentations
|
||||
|
||||
-- Unless you are still migrating, remove the deprecated commands from v1.x
|
||||
vim.cmd([[ let g:neo_tree_remove_legacy_commands = 1 ]])
|
|
@ -0,0 +1,26 @@
|
|||
-- Pandoc plugins: vim-pandoc, vim-pandoc-syntax
|
||||
|
||||
-- Defines the filetypes that have to be recognize by vim-pandoc. Allows
|
||||
-- mardown-preview to be available with pandoc filetype.
|
||||
vim.cmd([[ let g:mkdp_filetypes = ['markdown', 'pandoc', 'pandoc.markdown'] ]])
|
||||
|
||||
-- Sets the pandoc formatting mode to hardwrap
|
||||
vim.cmd([[ let g:pandoc#formatting#mode="hA" ]])
|
||||
|
||||
-- Keymaps to switch to soft or hardwarp, or to toggle.
|
||||
vim.keymap.set('n', '<leader>sw', '<cmd>call pandoc#formatting#UseSoftWraps()<CR>', {desc = 'Switch to softwrap'})
|
||||
vim.keymap.set('n', '<leader>hw', '<cmd>call pandoc#formatting#UseHardWraps()<CR>', {desc = 'Switch to hardwrap'})
|
||||
vim.keymap.set('n', '<leader>tw', '<cmd>call pandoc#formatting#ToggleAutoformat()<CR>', {desc = 'Toggle autoformat, to deactivate it'})
|
||||
|
||||
return {
|
||||
{
|
||||
"vim-pandoc/vim-pandoc",
|
||||
ft = "pandoc",
|
||||
lazy = true,
|
||||
},
|
||||
{
|
||||
"vim-pandoc/vim-pandoc-syntax",
|
||||
ft = "pandoc",
|
||||
lazy = true,
|
||||
},
|
||||
}
|
|
@ -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'
|
||||
}
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
-- A neovim lua plugin to help easily manage multiple terminal windows
|
||||
-- https://github.com/akinsho/toggleterm.nvim
|
||||
|
||||
-- Set ZSH as shell to get it in a terminal buffer
|
||||
vim.opt.shell = "/usr/bin/zsh"
|
||||
|
||||
return {
|
||||
{
|
||||
'akinsho/toggleterm.nvim',
|
||||
version = "*",
|
||||
opts = {
|
||||
-- Avoid terminal to be darker than the Nord colorscheme
|
||||
shade_terminals = false
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
local api = vim.api
|
||||
|
||||
api.nvim_set_keymap("n", "<leader>zn", ":TZNarrow<CR>", {})
|
||||
api.nvim_set_keymap("v", "<leader>zn", ":'<,'>TZNarrow<CR>", {})
|
||||
api.nvim_set_keymap("n", "<leader>zf", ":TZFocus<CR>", {})
|
||||
api.nvim_set_keymap("n", "<leader>zm", ":TZMinimalist<CR>", {})
|
||||
api.nvim_set_keymap("n", "<leader>za", ":TZAtaraxis<CR>", {})
|
||||
|
||||
return {
|
||||
"Pocco81/true-zen.nvim",
|
||||
-- Twilight allows to dim text outside of the cursor line.
|
||||
dependencies = {
|
||||
"folke/twilight.nvim",
|
||||
opts = {
|
||||
-- Set the context to null in order to avoid highlighting to much
|
||||
-- paragraphs in markdown.
|
||||
context = 0,
|
||||
},
|
||||
},
|
||||
config = function ()
|
||||
require('true-zen').setup({
|
||||
modes = {
|
||||
ataraxis = {
|
||||
minimum_writing_area = {
|
||||
width = 100
|
||||
}
|
||||
}
|
||||
},
|
||||
integrations = {
|
||||
twilight = true,
|
||||
lualine = true
|
||||
}
|
||||
})
|
||||
end
|
||||
}
|
|
@ -0,0 +1,48 @@
|
|||
local ls = require("luasnip")
|
||||
local s = ls.snippet
|
||||
local t = ls.text_node
|
||||
local f = ls.function_node
|
||||
local fmt = require("luasnip.extras.fmt").fmt
|
||||
|
||||
-- Function to get the current date
|
||||
local get_date = function()
|
||||
return os.date("%Y-%m-%d")
|
||||
end
|
||||
|
||||
return {
|
||||
s(
|
||||
{
|
||||
trig = "hr",
|
||||
name = "Heures",
|
||||
dscr = "Insert a commit message for saving the worked hours."
|
||||
},
|
||||
{
|
||||
t("organisation: enregistre les heures")
|
||||
}
|
||||
),
|
||||
s(
|
||||
{
|
||||
trig = "ic",
|
||||
name = "Incremental note commit message",
|
||||
dscr = "Insert a commit message for my incremental notes commits."
|
||||
},
|
||||
fmt(
|
||||
[[
|
||||
Incrémente la note du {1}
|
||||
]],
|
||||
{
|
||||
f(get_date, {})
|
||||
}
|
||||
)
|
||||
),
|
||||
s(
|
||||
{
|
||||
trig = "aou",
|
||||
name = "AoU stats commit message",
|
||||
dscr = "Commit message for an increment of AoU validation statistics."
|
||||
},
|
||||
{
|
||||
t("r+e: incrémente les stats de validation de l'AoU")
|
||||
}
|
||||
)
|
||||
}
|
|
@ -0,0 +1,111 @@
|
|||
-- My HTML snippets
|
||||
-- Below, the duplicate of brackets, for instance in the CSS code, is for
|
||||
-- escaping delimiters.
|
||||
|
||||
-- Set the local variables (shortcuts)
|
||||
local ls = require("luasnip")
|
||||
local s = ls.snippet
|
||||
local i = ls.insert_node
|
||||
local fmt = require("luasnip.extras.fmt").fmt
|
||||
|
||||
return {
|
||||
-- A main snippet setting the outer structure, with the style tag.
|
||||
-- Should be completed with the nested article item below.
|
||||
s(
|
||||
{
|
||||
trig = "mcim",
|
||||
name = "Main article structure for MC portal",
|
||||
dscr = "Insert an HTML structure to add bibliographic description on the clinical medicine portal."
|
||||
},
|
||||
fmt(
|
||||
[[
|
||||
<article class="mc-{1}-main">
|
||||
{2}
|
||||
<style>
|
||||
.mc-{1}-item > ul > li {{
|
||||
padding: 0 !important;
|
||||
}}
|
||||
.mc-{1}-item li:not([class])::before,
|
||||
.mc-{1}-item li::before {{
|
||||
content: none;
|
||||
}}
|
||||
</style>
|
||||
</article>
|
||||
]],
|
||||
{
|
||||
i(1, "Class identifier"),
|
||||
i(0)
|
||||
},
|
||||
{
|
||||
repeat_duplicates = true
|
||||
}
|
||||
)
|
||||
),
|
||||
-- Snippet that inserts an article with bibliographic metatada, to be nested
|
||||
-- in the upper main structure.
|
||||
s(
|
||||
{
|
||||
trig = "mcii",
|
||||
name = "Item article structure for MC portal",
|
||||
dscr = "Insert an HTML structure to add an item bibliographic description on the clinical medicine portal."
|
||||
},
|
||||
fmt(
|
||||
[[
|
||||
<article class="mc-{1}-item">
|
||||
<ul>
|
||||
<li>Dorland W. Dorland’s illustrated medical dictionary. 4th ed.</li>
|
||||
<li>Philadelphia: Elsevier, 2020.</li>
|
||||
<li>Cote : W 13 ed 4</li>
|
||||
<li>
|
||||
<a lang="fr"
|
||||
dir="ltr"
|
||||
type="html/text"
|
||||
href="https://slsp-unige.primo.exlibrisgroup.com/articleermalink/41SLSP_UGE/l0hvjc/alma991008098789705502"
|
||||
hreflang="français"
|
||||
rel="nofollow"
|
||||
target="_blank">
|
||||
Le document dans le catalogue Swisscovery
|
||||
</a>.
|
||||
</li>
|
||||
</ul>
|
||||
<span placeholder="coins metadata"></span>
|
||||
</article>{2}
|
||||
]],
|
||||
{
|
||||
i(1, "Class identifier"),
|
||||
i(0)
|
||||
},
|
||||
{
|
||||
repeat_duplicates = true
|
||||
}
|
||||
)
|
||||
),
|
||||
-- Snippet that insert a list item with a link to an ebook online.
|
||||
s(
|
||||
{
|
||||
trig = "eli",
|
||||
name = "List item for an ebook link",
|
||||
dscr = "Insert a link for an ebook nested in a list item. Designed for the medicine portal HTML structure."
|
||||
},
|
||||
fmt(
|
||||
[[
|
||||
<li>
|
||||
<a dir="ltr"
|
||||
type="html/text"
|
||||
href="{1}"
|
||||
lang="{2}"
|
||||
hreflang="{3}"
|
||||
ref="nofollow"
|
||||
target="_blank">
|
||||
Livre électronique en ligne
|
||||
</a>.
|
||||
</li>
|
||||
]],
|
||||
{
|
||||
i(1, "Ebook URL"),
|
||||
i(2, "Language code (2 chars)"),
|
||||
i(3, "Language name")
|
||||
}
|
||||
)
|
||||
)
|
||||
}
|
|
@ -0,0 +1,172 @@
|
|||
local ls = require("luasnip")
|
||||
local s = ls.snippet
|
||||
local t = ls.text_node
|
||||
local i = ls.insert_node
|
||||
local f = ls.function_node
|
||||
local fmt = require("luasnip.extras.fmt").fmt
|
||||
|
||||
-- Function to get the datetime
|
||||
-- with daylight saving time
|
||||
-- according to the locale
|
||||
local get_datetime = function()
|
||||
return os.date("%Y-%m-%dT%H:%M:%S%z")
|
||||
end
|
||||
|
||||
-- Function to get the current date
|
||||
local get_date = function()
|
||||
return os.date("%Y-%m-%d")
|
||||
end
|
||||
|
||||
-- Function to get the current month
|
||||
local get_month = function()
|
||||
return os.date("%B")
|
||||
end
|
||||
|
||||
-- Function to get the current year
|
||||
local get_month_year = function()
|
||||
return os.date("%B-%Y")
|
||||
end
|
||||
|
||||
-- Function to get an id based on the datetime
|
||||
local get_id = function()
|
||||
return os.date("%Y%m%d%H%M%S")
|
||||
end
|
||||
|
||||
-- Function to get the number of the current day
|
||||
local get_day = function()
|
||||
return os.date("%d")
|
||||
end
|
||||
|
||||
return {
|
||||
s(
|
||||
{
|
||||
trig = "dt",
|
||||
name = "Datetime",
|
||||
dscr = "Insert the current datetime with locale daylight saving."
|
||||
},
|
||||
{
|
||||
f(get_datetime, {})
|
||||
}
|
||||
),
|
||||
s(
|
||||
{
|
||||
trig = "id",
|
||||
Name = "ID",
|
||||
dscr = "Insert an id based on the current datetime."
|
||||
},
|
||||
{
|
||||
f(get_id, {})
|
||||
}
|
||||
),
|
||||
s(
|
||||
{
|
||||
trig = "today",
|
||||
Name = "Today",
|
||||
dscr = "Insert the number of the current day."
|
||||
},
|
||||
{
|
||||
f(get_day, {})
|
||||
}
|
||||
),
|
||||
s(
|
||||
{
|
||||
trig = "ie",
|
||||
Name = "Inc entry",
|
||||
dscr = "Insert an Inc entry for today (heading level 2)."
|
||||
},
|
||||
fmt(
|
||||
[[
|
||||
## {}
|
||||
|
||||
|
||||
]],
|
||||
{
|
||||
f(get_day, {})
|
||||
}
|
||||
)
|
||||
),
|
||||
s(
|
||||
{
|
||||
trig = "fm",
|
||||
name = "YAML frontmatter",
|
||||
dscr = "Insert a YAML frontmatter for markdown files.\n\nIt has a datetime with the locale daylight saving time, and an ID based on the datetime.\nTab to jump to next text input."
|
||||
},
|
||||
fmt(
|
||||
[[
|
||||
---
|
||||
title: {1}
|
||||
date: {3}
|
||||
id: {4}
|
||||
tags: [{2}]
|
||||
---
|
||||
|
||||
]],
|
||||
{
|
||||
i(1, "title"),
|
||||
i(2, "tags"),
|
||||
f(get_datetime, {}),
|
||||
f(get_id, {})
|
||||
}
|
||||
)
|
||||
),
|
||||
s(
|
||||
{
|
||||
trig = "inc",
|
||||
name = "INC YAML frontmatter",
|
||||
dscr = "Insert a YAML frontmatter for INC notes.\n\nIt has a datetime with the locale daylight saving time, prefilled title, author, categories and tags.\nAdjust the title manually."
|
||||
},
|
||||
fmt(
|
||||
[[
|
||||
---
|
||||
title: {1}
|
||||
date: {2}
|
||||
id: {4}
|
||||
tags: [notes, quotidien, {3}]
|
||||
---
|
||||
|
||||
]],
|
||||
{
|
||||
f(get_month_year, {}),
|
||||
f(get_datetime, {}),
|
||||
f(get_month, {}),
|
||||
f(get_id, {})
|
||||
}
|
||||
)
|
||||
),
|
||||
s(
|
||||
{
|
||||
trig="reflink",
|
||||
name = "Reference link",
|
||||
dscr="Insert a link with reference syntax",
|
||||
docstring = "[Link text][Reference]\n\n[Reference]: Link Target \"Title\"\n\nTab to jump to next text input. \"Reference\" is automatically repeated."
|
||||
},
|
||||
fmt(
|
||||
[[
|
||||
[{1}][{2}]
|
||||
|
||||
[{2}]: {3}
|
||||
]],
|
||||
{
|
||||
i(1, "Link text"),
|
||||
i(2, "Reference"),
|
||||
i(3, "Link target")
|
||||
},
|
||||
{ repeat_duplicates = true }
|
||||
)
|
||||
),
|
||||
s(
|
||||
{
|
||||
trig = "tags",
|
||||
name = "Tags",
|
||||
dscr = "Insert a one-line tags array, in a text file (markdown)."
|
||||
},
|
||||
fmt(
|
||||
[[
|
||||
tags: [{}]
|
||||
]],
|
||||
{
|
||||
i(1, "tags")
|
||||
}
|
||||
)
|
||||
)
|
||||
}
|
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,15 @@
|
|||
AoU
|
||||
Floriane
|
||||
Séverine
|
||||
HEG
|
||||
neovim
|
||||
lua
|
||||
InfoBiblio
|
||||
Réaménagement
|
||||
biodiversité
|
||||
hyperindustrialisés
|
||||
lacto-fermentation
|
||||
d'engrain
|
||||
écorcheuse
|
||||
écopolitique
|
||||
Centralité
|
Binary file not shown.
Loading…
Reference in New Issue