This commit is contained in:
2025-08-24 19:39:28 +02:00
parent 57ec608fde
commit 643a7dfe04
19 changed files with 290 additions and 94 deletions

View File

@@ -101,5 +101,7 @@ require 'custom.autocommands'
require 'kickstart.core.keymaps'
require 'custom.keymaps'
vim.cmd [[colorscheme moonfly]]
-- The line beneath this is called `modeline`. See `:help modeline`
-- vim: ts=2 sts=2 sw=2 et

View File

@@ -6,6 +6,7 @@ if not status_wk then
return
end
local runner = require 'quarto.runner'
local group = vim.api.nvim_create_augroup('quarto_autocommands', { clear = true })
vim.api.nvim_create_autocmd('FileType', {
@@ -21,16 +22,26 @@ vim.api.nvim_create_autocmd('FileType', {
local deinit = function()
local quarto_cfg = require('quarto.config').config
quarto_cfg.codeRunner.default_method = 'slime'
vim.cmd [[MoltenStop]]
vim.cmd [[MoltenInterrupt]]
vim.cmd [[MoltenDeinit]]
end
wk.add {
{ mode = { 'n', 'v', 'i' } },
{ -- Runner
{ '<leader>r', group = '[r]un', buffer = true },
{ '<leader>rc', runner.run_cell, desc = 'run [c]ell', buffer = true },
{ '<leader>ra', runner.run_above, desc = 'run [a]bove', buffer = true },
{ '<leader>rA', runner.run_all, desc = 'run [A]ll', buffer = true },
{ '<leader>rl', runner.run_line, desc = 'run [l]ine', buffer = true },
{ '<leader>rr', runner.run_range, desc = 'run [r]ange', buffer = true },
{ '<c-CR>', runner.run_cell, desc = 'run [c]ell', buffer = true, hidden = true },
},
{ -- Quarto
{ '<leader>q', group = '[q]uarto', buffer = true },
{ '<leader>qp', '<CMD>QuartoPreview<CR>', desc = '[p]review Quarto', buffer = true },
{ '<leader>qs', '<CMD>QuartoSend<CR>', desc = '[s]end to Quarto', buffer = true },
{ '<leader>Q', group = '[Q]uarto', buffer = true },
{ '<leader>Qp', '<CMD>QuartoPreview<CR>', desc = '[p]review Quarto', buffer = true },
{ '<leader>Qs', '<CMD>QuartoSend<CR>', desc = '[s]end to Quarto', buffer = true },
},
{ -- Molten
@@ -38,7 +49,7 @@ vim.api.nvim_create_autocmd('FileType', {
{ '<leader>Mi', init, desc = '[i]nitialize Molten', buffer = true },
{ '<leader>Ms', deinit, desc = '[s]top Molten', buffer = true },
{ '<leader>Mp', '<CMD>MoltenPause<CR>', desc = '[p]ause Molten', buffer = true },
{ '<leader>Mr', '<CMD>MoltenReset<CR>', desc = '[r]eset Molten', buffer = true },
{ '<leader>Mr', '<CMD>MoltenRestart<CR>', desc = '[r]eset Molten', buffer = true },
},
{ -- Vim-slime
@@ -49,3 +60,9 @@ vim.api.nvim_create_autocmd('FileType', {
}
end,
})
vim.api.nvim_create_autocmd('VimResized', {
callback = function()
vim.g.molten_output_win_max_width = math.floor(vim.o.columns)
end,
})

View File

@@ -24,7 +24,7 @@ wk.add {
},
},
{
mode = { 'n', 'v', 'i' },
mode = { 'n', 'v' },
{ '<C-e>', nth.smart_open, desc = 'File explorer', silent = true, noremap = true, hidden = true },
},
}

View File

@@ -6,7 +6,7 @@ if not status_kh then
return
end
kh.map({ 'n', 'v', 'i' }, '<leader>Q', '<CMD>qall<CR>', { silent = true, noremap = true, desc = '[Q]uit all' })
kh.map({ 'n', 'v', 'i' }, '<leader>q', '<CMD>qall<CR>', { silent = true, noremap = true, desc = '[q]uit all' })
-- The line beneath this is called `modeline`. See `:help modeline`
-- vim: ts=2 sts=2 sw=2 et

View File

@@ -13,9 +13,10 @@ wk.add {
{
mode = { 'n', 'v' },
{ '<leader>e', group = '[e]xplore' },
{ '<leader>b', group = '[b]uffers' },
{ '<leader>e', group = '[e]xplore' },
{ '<leader>g', group = '[g]it hunk' },
{ '<leader>o', group = '[o]bsidian' },
},
},
{},

View File

@@ -9,6 +9,7 @@ require 'custom.keymaps.files'
require 'custom.keymaps.edit'
require 'custom.keymaps.search'
require 'custom.keymaps.toggles'
require 'custom.keymaps.obsidian'
-- The line beneath this is called `modeline`. See `:help modeline`
-- vim: ts=2 sts=2 sw=2 et

View File

@@ -0,0 +1,18 @@
-- Edition mappings
--
local status_wk, wk = pcall(require, 'which-key')
if not status_wk then
return
end
wk.add {
{
mode = { 'n', 'v', 'i' },
{ '<leader>on', '<CMD>Obsidian new<CR>', desc = 'create new note', silent = true, noremap = true },
{ '<leader>os', '<CMD>Obsidian search<CR>', desc = 'search note', silent = true, noremap = true },
},
}
-- The line beneath this is called `modeline`. See `:help modeline`
-- vim: ts=2 sts=2 sw=2 et

View File

@@ -9,6 +9,7 @@ wk.add {
-- gitsigns
{ '<leader>tb', gitsigns.toggle_current_line_blame, desc = 'toggle git show [b]lame line' },
{ '<leader>tD', gitsigns.preview_hunk_inline, desc = 'toggle git show [D]eleted' },
{ '<leader>tm', '<CMD>RenderMarkdown buf_toggle<CR>', desc = 'toggle markdown rendering for current' },
}
-- The line beneath this is called `modeline`. See `:help modeline`

View File

@@ -34,7 +34,8 @@ function M.smart_open()
-- vim.cmd 'Neotree position=left reveal=true'
-- Sinon, ouvrir dans le répertoire de travail courant
else
vim.cmd('Neotree toggle position=left reveal_force_cwd=true dir=' .. vim.fn.getcwd())
-- vim.cmd('Neotree toggle position=left reveal_force_cwd=true dir=' .. vim.fn.getcwd())
vim.cmd 'Neotree toggle position=left reveal_force_cwd=true'
end
end

View File

@@ -32,9 +32,10 @@ require('lazy').setup({
require 'kickstart.plugins.which-key',
require 'kickstart.plugins.quarto',
require 'kickstart.plugins.obsidian',
require 'kickstart.plugins.markdown',
-- Themes
require 'kickstart.themes.yorumi',
require 'kickstart.plugins.themes',
-- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua`
-- This is the easiest way to modularize your config.

View File

@@ -1,6 +1,15 @@
-- Autocompletion
return {
{
'saghen/blink.compat',
-- use v2.* for blink.cmp v1.*
version = '2.*',
-- lazy.nvim will automatically load the plugin when it's required by blink.cmp
lazy = true,
-- make sure to set opts so that lazy.nvim calls blink.compat's setup
opts = {},
},
{ -- Autocompletion
'saghen/blink.cmp',
event = 'VimEnter',
@@ -32,7 +41,13 @@ return {
},
opts = {},
},
'folke/lazydev.nvim',
-- R-cmp
{
'R-nvim/cmp-r',
},
{
'folke/lazydev.nvim',
},
},
--- @module 'blink.cmp'
--- @type blink.cmp.Config
@@ -78,9 +93,10 @@ return {
},
sources = {
default = { 'lsp', 'path', 'snippets', 'lazydev' },
default = { 'lsp', 'path', 'snippets', 'lazydev', 'cmp_r' },
providers = {
lazydev = { module = 'lazydev.integrations.blink', score_offset = 100 },
cmp_r = { module = 'blink.compat.source', score_offset = 3 },
},
},
@@ -99,4 +115,4 @@ return {
signature = { enabled = true },
},
},
}
}

View File

@@ -21,14 +21,14 @@ return {
-- Mason must be loaded before its dependents so we need to set it up here.
-- NOTE: `opts = {}` is the same as calling `require('mason').setup({})`
{ 'mason-org/mason.nvim', opts = {} },
'mason-org/mason-lspconfig.nvim',
'WhoIsSethDaniel/mason-tool-installer.nvim',
{ 'mason-org/mason-lspconfig.nvim' },
{ 'WhoIsSethDaniel/mason-tool-installer.nvim' },
-- Useful status updates for LSP.
{ 'j-hui/fidget.nvim', opts = {} },
-- Allows extra capabilities provided by blink.cmp
'saghen/blink.cmp',
{ 'saghen/blink.cmp' },
},
config = function()
-- Brief aside: **What is LSP?**

View File

@@ -0,0 +1,116 @@
-- Markdown
-- https://github.com/MeanderingProgrammer/render-markdown.nvim
return {
{
'MeanderingProgrammer/render-markdown.nvim',
-- dependencies = { 'nvim-treesitter/nvim-treesitter', 'echasnovski/mini.nvim' }, -- if you use the mini.nvim suite
-- dependencies = { 'nvim-treesitter/nvim-treesitter', 'echasnovski/mini.icons' }, -- if you use standalone mini plugins
dependencies = { 'nvim-treesitter/nvim-treesitter', 'nvim-tree/nvim-web-devicons' }, -- if you prefer nvim-web-devicons
---@module 'render-markdown'
---@type render.md.UserConfig
opts = {
-- run on both Markdown and Quarto files
file_types = { 'markdown', 'quarto' },
-- means that in normal, command, and terminal modes you'll get a rendered view,
-- and in other modes such as insert the marks added by the plugin will disappear.
-- render_modes = { 'n', 'c', 't' },
-- in all modes
render_modes = true,
completions = {
blink = { enabled = true },
lsp = { enabled = true },
},
-- checkbox = {
-- enabled = true,
-- render_modes = true,
-- bullet = true,
-- right_pad = 1,
-- unchecked = {
-- icon = '󰄱 ',
-- highlight = 'RenderMarkdownUnchecked',
-- scope_highlight = nil,
-- },
-- checked = {
-- icon = '󰱒 ',
-- highlight = 'RenderMarkdownChecked',
-- scope_highlight = nil,
-- },
-- custom = {
-- todo = {
-- raw = '[-]',
-- rendered = '󰥔 ',
-- highlight = 'RenderMarkdownTodo',
-- scope_highlight = nil,
-- },
-- important = {
-- raw = '[~]',
-- rendered = '󰓎 ',
-- highlight = 'DiagnosticWarn',
-- },
-- checked = {
-- scope_highlight = '@markup.strikethrough',
-- },
-- },
-- },
-- code = {
-- enabled = true,
-- render_modes = false,
-- sign = true,
-- conceal_delimiters = true,
-- language = true,
-- position = 'left',
-- language_icon = true,
-- language_name = true,
-- language_info = true,
-- language_pad = 0,
-- disable_background = { 'diff' },
-- width = 'full',
-- left_margin = 0,
-- left_pad = 0,
-- right_pad = 0,
-- min_width = 0,
-- border = 'hide',
-- language_border = '█',
-- language_left = '',
-- language_right = '',
-- above = '▄',
-- below = '▀',
-- inline = true,
-- inline_left = '',
-- inline_right = '',
-- inline_pad = 0,
-- highlight = 'RenderMarkdownCode',
-- highlight_info = 'RenderMarkdownCodeInfo',
-- highlight_language = nil,
-- highlight_border = 'RenderMarkdownCodeBorder',
-- highlight_fallback = 'RenderMarkdownCodeFallback',
-- highlight_inline = 'RenderMarkdownCodeInline',
-- style = 'full',
-- },
-- latex = {
-- enabled = true,
-- render_modes = false,
-- converter = 'latex2text',
-- highlight = 'RenderMarkdownMath',
-- position = 'above',
-- top_pad = 0,
-- bottom_pad = 0,
-- },
-- quote = {
-- enabled = true,
-- render_modes = false,
-- icon = '▋',
-- repeat_linebreak = false,
-- highlight = {
-- 'RenderMarkdownQuote1',
-- 'RenderMarkdownQuote2',
-- 'RenderMarkdownQuote3',
-- 'RenderMarkdownQuote4',
-- 'RenderMarkdownQuote5',
-- 'RenderMarkdownQuote6',
-- },
-- },
},
},
}

View File

@@ -53,7 +53,7 @@ return {
-- Optional, if you keep daily notes in a separate directory.
folder = 'journal/daily',
-- Optional, if you want to change the date format for the ID of daily notes.
date_format = '%Y-%m-%d',
date_format = '%Y%m%d',
-- Optional, if you want to change the date format of the default alias of daily notes.
alias_format = '%B %-d, %Y',
-- Optional, default tags to add to each new daily note created.

View File

@@ -4,6 +4,11 @@
-- molten: https://github.com/benlubas/molten-nvim
--
--local wh_status, wh = pcall(require, 'custom.plugins.window-helper')
--if not wh_status then
-- return
--end
return {
{
'quarto-dev/quarto-nvim',
@@ -17,10 +22,21 @@ return {
lspFeatures = {
enabled = true,
chunks = 'curly',
languages = { 'r', 'python', 'julia', 'bash', 'html' },
diagnostics = {
enabled = true,
triggers = { 'BufWritePost' },
},
completion = {
enabled = true,
},
},
codeRunner = {
enabled = true,
default_method = 'slime',
default_method = 'slime', -- "molten", "slime", "iron" or <function>
ft_runners = {}, -- filetype to runner, ie. `{ python = "molten" }`.
-- Takes precedence over `default_method`
never_run = { 'yaml' }, -- filetypes which are never sent to a code runner
},
},
},
@@ -37,16 +53,16 @@ return {
vim.cmd [[
let g:slime_dispatch_ipython_pause = 100
function SlimeOverride_EscapeText_quarto(text)
call v:lua.Quarto_is_in_python_chunk()
if exists('g:slime_python_ipython') && len(split(a:text,"\n")) > 1 && b:quarto_is_python_chunk && !(exists('b:quarto_is_r_mode') && b:quarto_is_r_mode)
return ["%cpaste -q\n", g:slime_dispatch_ipython_pause, a:text, "--", "\n"]
else
if exists('b:quarto_is_r_mode') && b:quarto_is_r_mode && b:quarto_is_python_chunk
return [a:text, "\n"]
else
return [a:text]
end
end
call v:lua.Quarto_is_in_python_chunk()
if exists('g:slime_python_ipython') && len(split(a:text,"\n")) > 1 && b:quarto_is_python_chunk && !(exists('b:quarto_is_r_mode') && b:quarto_is_r_mode)
return ["%cpaste -q\n", g:slime_dispatch_ipython_pause, a:text, "--", "\n"]
else
if exists('b:quarto_is_r_mode') && b:quarto_is_r_mode && b:quarto_is_python_chunk
return [a:text, "\n"]
else
return [a:text]
end
end
endfunction
]]
@@ -87,6 +103,12 @@ return {
vim.g.molten_auto_open_output = true
-- vim.g.molten_auto_open_html_in_browser = true
vim.g.molten_tick_rate = 200
vim.g.molten_output_win_col = math.floor((vim.o.columns - vim.o.columns * 0.9) / 2)
vim.g.molten_output_win_max_width = math.floor(vim.o.columns * 0.9)
vim.g.molten_output_win_border = { '', '', '', '', '', '', '', '' }
vim.g.molten_use_border_highlights = true
vim.g.molten_output_win_style = 'minimal' -- Style minimal pour la fenêtre
vim.g.molten_output_win_hide_on_leave = false -- Garder la fenêtre visible après avoir quitté
end,
config = function()
-- local init = function()
@@ -108,7 +130,7 @@ return {
end,
opts = {
auto_scroll = true,
jupyter_command = '/home/jeff/.asdf/shims/jupyter',
-- jupyter_command = '/home/jeff/.asdf/shims/jupyter',
},
},
{
@@ -124,7 +146,7 @@ return {
download_remote_images = true,
only_render_image_at_cursor = false,
only_render_image_at_cursor_mode = 'popup',
floating_windows = false, -- if true, images will be rendered in floating markdown windows
floating_windows = true, -- if true, images will be rendered in floating markdown windows
filetypes = { 'markdown', 'vimwiki', 'quarto' }, -- markdown extensions (ie. quarto) can go here
},
neorg = {
@@ -145,7 +167,7 @@ return {
max_width = nil,
max_height = nil,
max_width_window_percentage = nil,
max_height_window_percentage = 50,
max_height_window_percentage = 70,
window_overlap_clear_enabled = false, -- toggles images when windows are overlapped
window_overlap_clear_ft_ignore = { 'cmp_menu', 'cmp_docs', 'snacks_notif', 'scrollview', 'scrollview_sign' },
editor_only_render_when_focused = false, -- auto show/hide images when the editor gains/looses focus

View File

@@ -0,0 +1,63 @@
-- Themes
--
--
return {
-- You can easily change to a different colorscheme.
-- Change the name of the colorscheme plugin below, and then
-- change the command in the config to whatever the name of that colorscheme is.
--
-- If you want to see what colorschemes are already installed, you can use `:Telescope colorscheme`.
{
'bluz71/vim-moonfly-colors',
lazy = false,
priority = 1000,
config = function()
vim.cmd.syntax 'enable'
vim.g.moonflyCursorColor = true
vim.g.moonflyItalics = true
vim.g.moonflyNormalFloat = true
vim.g.moonflyTerminalColors = true
vim.g.moonflyUndercurls = true
vim.g.moonflyUnderlineMatchParen = true
vim.g.moonflyVirtualTextColor = true
vim.api.nvim_set_hl(0, 'MoltenOutputBorder', { link = 'Normal' })
vim.api.nvim_set_hl(0, 'MoltenOutputBorderFail', { link = 'MoonflyCrimson' })
vim.api.nvim_set_hl(0, 'MoltenOutputBorderSuccess', { link = 'MoonflyBlue' })
end,
},
{
-- Like many other themes, this one has different styles, and you could load
-- any other, such as 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'.
'folke/tokyonight.nvim',
priority = 1000, -- Make sure to load this before all the other start plugins.
config = function()
---@diagnostic disable-next-line: missing-fields
require('tokyonight').setup {
styles = {
comments = { italic = false }, -- Disable italics in comments
},
}
end,
},
{
'yorumicolors/yorumi.nvim',
priority = 1000, -- Make sure to load this before all the other start plugins.
config = function()
---@diagnostic disable-next-line: missing-fields
end,
},
{
'navarasu/onedark.nvim',
priority = 1000, -- make sure to load this before all the other start plugins
config = function()
require('onedark').setup {
style = 'darker',
}
-- require('onedark').load()
end,
},
}

View File

@@ -1,15 +0,0 @@
-- Themes
--
return {
{
'navarasu/onedark.nvim',
priority = 1000, -- make sure to load this before all the other start plugins
config = function()
require('onedark').setup {
style = 'darker',
}
require('onedark').load()
end,
},
}

View File

@@ -1,26 +0,0 @@
-- Tokyonight
-- https://github.com/folke/tokyonight.nvim
return {
{ -- You can easily change to a different colorscheme.
-- Change the name of the colorscheme plugin below, and then
-- change the command in the config to whatever the name of that colorscheme is.
--
-- If you want to see what colorschemes are already installed, you can use `:Telescope colorscheme`.
'folke/tokyonight.nvim',
priority = 1000, -- Make sure to load this before all the other start plugins.
config = function()
---@diagnostic disable-next-line: missing-fields
require('tokyonight').setup {
styles = {
comments = { italic = false }, -- Disable italics in comments
},
}
-- Load the colorscheme here.
-- Like many other themes, this one has different styles, and you could load
-- any other, such as 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'.
vim.cmd.colorscheme 'tokyonight-night'
end,
},
}

View File

@@ -1,22 +0,0 @@
-- Yorumi
-- https://github.com/yorumicolors/yorumi.nvim
return {
{ -- You can easily change to a different colorscheme.
-- Change the name of the colorscheme plugin below, and then
-- change the command in the config to whatever the name of that colorscheme is.
--
-- If you want to see what colorschemes are already installed, you can use `:Telescope colorscheme`.
'yorumicolors/yorumi.nvim',
priority = 1000, -- Make sure to load this before all the other start plugins.
config = function()
---@diagnostic disable-next-line: missing-fields
-- Load the colorscheme here.
-- Like many other themes, this one has different styles, and you could load
-- any other, such as 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'.
vim.cmd.colorscheme 'yorumi'
end,
},
}