From d033bab96ed59f4684ed1d5d6943d66b70745d1f Mon Sep 17 00:00:00 2001 From: Jeff LANCE Date: Sun, 24 Aug 2025 20:10:59 +0200 Subject: [PATCH] up --- lua/custom/autocommands/markdown.lua | 7 +------ lua/custom/keymaps/edit.lua | 27 +++++++++++++++++---------- lua/custom/keymaps/groups.lua | 5 ++++- lua/custom/keymaps/nop.lua | 5 ++++- lua/custom/keymaps/obsidian.lua | 6 +++--- lua/custom/keymaps/toggles.lua | 2 +- lua/custom/plugins/neotree-helper.lua | 4 ++-- lua/kickstart/plugins/markdown.lua | 2 +- lua/kickstart/plugins/obsidian.lua | 3 +++ lua/kickstart/plugins/treesitter.lua | 5 +++-- 10 files changed, 39 insertions(+), 27 deletions(-) diff --git a/lua/custom/autocommands/markdown.lua b/lua/custom/autocommands/markdown.lua index 28529fd..13c9a6e 100644 --- a/lua/custom/autocommands/markdown.lua +++ b/lua/custom/autocommands/markdown.lua @@ -1,11 +1,6 @@ --- Quarto autocommands file +-- Markdown autocommands file -- -local status_wk, wk = pcall(require, 'which-key') -if not status_wk then - return -end - vim.api.nvim_create_autocmd('FileType', { desc = '', pattern = 'markdown', diff --git a/lua/custom/keymaps/edit.lua b/lua/custom/keymaps/edit.lua index 441737c..59e1ca5 100644 --- a/lua/custom/keymaps/edit.lua +++ b/lua/custom/keymaps/edit.lua @@ -1,18 +1,25 @@ -- Edition mappings -- - -local status_wk, wk = pcall(require, 'which-key') -if not status_wk then +-- +local status_kh, kh = pcall(require, 'custom.plugins.keymaps-helper') +if not status_kh then return end -wk.add { - { - mode = { 'n', 'v', 'i' }, - -- mapping runs here as which-key intercepts ctrl-z signal before term - { '', 'undo', desc = 'Undo', silent = true, noremap = true, hidden = true }, - }, -} +kh.map({ 'n', 'v', 'i' }, '', 'undo', { silent = true, noremap = true, desc = 'Undo' }) + +-- local status_wk, wk = pcall(require, 'which-key') +-- if not status_wk then +-- return +-- end +-- +-- wk.add { +-- { +-- mode = { 'n', 'v', 'i' }, +-- -- mapping runs here as which-key intercepts ctrl-z signal before term +-- { '', 'undo', desc = 'Undo', silent = true, noremap = true, hidden = true }, +-- }, +-- } -- The line beneath this is called `modeline`. See `:help modeline` -- vim: ts=2 sts=2 sw=2 et diff --git a/lua/custom/keymaps/groups.lua b/lua/custom/keymaps/groups.lua index 99a9e8c..f4f98cc 100644 --- a/lua/custom/keymaps/groups.lua +++ b/lua/custom/keymaps/groups.lua @@ -1,7 +1,10 @@ -- Key mappings groups -- -local wk = require 'which-key' +local status_wk, wk = pcall(require, 'which-key') +if not status_wk then + return +end wk.add { { diff --git a/lua/custom/keymaps/nop.lua b/lua/custom/keymaps/nop.lua index 206aa38..11c292f 100644 --- a/lua/custom/keymaps/nop.lua +++ b/lua/custom/keymaps/nop.lua @@ -1,7 +1,10 @@ -- Deactivated key mappings -- -local wk = require 'which-key' +local status_wk, wk = pcall(require, 'which-key') +if not status_wk then + return +end wk.add { mode = { 'n', 'v', 'i' }, diff --git a/lua/custom/keymaps/obsidian.lua b/lua/custom/keymaps/obsidian.lua index fb374e1..481aada 100644 --- a/lua/custom/keymaps/obsidian.lua +++ b/lua/custom/keymaps/obsidian.lua @@ -1,4 +1,4 @@ --- Edition mappings +-- Obsidian mappings -- local status_wk, wk = pcall(require, 'which-key') @@ -9,8 +9,8 @@ end wk.add { { mode = { 'n', 'v', 'i' }, - { 'on', 'Obsidian new', desc = 'create new note', silent = true, noremap = true }, - { 'os', 'Obsidian search', desc = 'search note', silent = true, noremap = true }, + { 'on', 'Obsidian new', desc = 'create [n]ew note', silent = true, noremap = true }, + { 'os', 'Obsidian search', desc = '[s]earch note', silent = true, noremap = true }, }, } diff --git a/lua/custom/keymaps/toggles.lua b/lua/custom/keymaps/toggles.lua index dd58a4e..a57782d 100644 --- a/lua/custom/keymaps/toggles.lua +++ b/lua/custom/keymaps/toggles.lua @@ -9,7 +9,7 @@ wk.add { -- gitsigns { 'tb', gitsigns.toggle_current_line_blame, desc = 'toggle git show [b]lame line' }, { 'tD', gitsigns.preview_hunk_inline, desc = 'toggle git show [D]eleted' }, - { 'tm', 'RenderMarkdown buf_toggle', desc = 'toggle markdown rendering for current' }, + { 'tm', 'RenderMarkdown buf_toggle', desc = 'toggle [m]arkdown rendering for current' }, } -- The line beneath this is called `modeline`. See `:help modeline` diff --git a/lua/custom/plugins/neotree-helper.lua b/lua/custom/plugins/neotree-helper.lua index d712944..e8c4056 100644 --- a/lua/custom/plugins/neotree-helper.lua +++ b/lua/custom/plugins/neotree-helper.lua @@ -30,8 +30,8 @@ function M.smart_open() vim.cmd('Neotree toggle reveal=false position=float dir=' .. vim.fn.expand '~') -- Si c'est un fichier réel, révéler le fichier dans l'arborescence elseif is_real_file and bufname ~= '' then - vim.cmd('Neotree toggle position=left reveal=true dir=' .. vim.fn.expand '%:p:h') - -- vim.cmd 'Neotree position=left reveal=true' + -- vim.cmd('Neotree toggle position=left reveal_force_cwd=true dir=' .. vim.fn.expand '%:p:h') + vim.cmd 'Neotree position=left reveal_force_cwd=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()) diff --git a/lua/kickstart/plugins/markdown.lua b/lua/kickstart/plugins/markdown.lua index 13a3a3a..d675a17 100644 --- a/lua/kickstart/plugins/markdown.lua +++ b/lua/kickstart/plugins/markdown.lua @@ -11,7 +11,7 @@ return { ---@type render.md.UserConfig opts = { -- run on both Markdown and Quarto files - file_types = { 'markdown', 'quarto' }, + file_types = { 'markdown', 'quarto', 'vimwiki' }, -- 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' }, diff --git a/lua/kickstart/plugins/obsidian.lua b/lua/kickstart/plugins/obsidian.lua index 8668237..612924f 100644 --- a/lua/kickstart/plugins/obsidian.lua +++ b/lua/kickstart/plugins/obsidian.lua @@ -18,6 +18,9 @@ return { ---@module 'obsidian' ---@type obsidian.config opts = { + ui = { + enable = false, + }, legacy_commands = false, workspaces = { { diff --git a/lua/kickstart/plugins/treesitter.lua b/lua/kickstart/plugins/treesitter.lua index 71dbe5a..e2e1473 100644 --- a/lua/kickstart/plugins/treesitter.lua +++ b/lua/kickstart/plugins/treesitter.lua @@ -8,7 +8,7 @@ return { main = 'nvim-treesitter.configs', -- Sets main module to use for opts -- [[ Configure Treesitter ]] See `:help nvim-treesitter` opts = { - ensure_installed = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' }, + ensure_installed = { 'bash', 'c', 'diff', 'html', 'latex', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'r', 'vim', 'vimdoc' }, -- Autoinstall languages that are not installed auto_install = true, highlight = { @@ -27,4 +27,5 @@ return { -- - Show your current context: https://github.com/nvim-treesitter/nvim-treesitter-context -- - Treesitter + textobjects: https://github.com/nvim-treesitter/nvim-treesitter-textobjects }, -} \ No newline at end of file +} +