This commit is contained in:
2025-08-15 19:33:16 +02:00
parent be77967e94
commit 6c3434aceb
21 changed files with 280 additions and 97 deletions

View File

@@ -7,14 +7,14 @@ return {
event = { 'BufWritePre' },
cmd = { 'ConformInfo' },
keys = {
{
'<leader>bf',
function()
require('conform').format { async = true, lsp_format = 'fallback' }
end,
mode = '',
desc = '[F]ormat [B]uffer',
},
-- {
-- '<leader>bf',
-- function()
-- require('conform').format { async = true, lsp_format = 'fallback' }
-- end,
-- mode = '',
-- desc = '[F]ormat [B]uffer',
-- },
},
opts = {
notify_on_error = false,
@@ -35,7 +35,7 @@ return {
formatters_by_ft = {
lua = { 'stylua' },
-- Conform can also run multiple formatters sequentially
-- python = { "isort", "black" },
python = { 'isort', 'black' },
--
-- You can use 'stop_after_first' to run the first available formatter from the list
-- javascript = { "prettierd", "prettier", stop_after_first = true },
@@ -43,4 +43,3 @@ return {
},
},
}

View File

@@ -36,27 +36,28 @@ return {
-- Actions
-- visual mode
map('v', '<leader>hs', function()
map('v', '<leader>gs', function()
gitsigns.stage_hunk { vim.fn.line '.', vim.fn.line 'v' }
end, { desc = 'git [s]tage hunk' })
map('v', '<leader>hr', function()
map('v', '<leader>gr', function()
gitsigns.reset_hunk { vim.fn.line '.', vim.fn.line 'v' }
end, { desc = 'git [r]eset hunk' })
-- normal mode
map('n', '<leader>hs', gitsigns.stage_hunk, { desc = 'git [s]tage hunk' })
map('n', '<leader>hr', gitsigns.reset_hunk, { desc = 'git [r]eset hunk' })
map('n', '<leader>hS', gitsigns.stage_buffer, { desc = 'git [S]tage buffer' })
map('n', '<leader>hu', gitsigns.stage_hunk, { desc = 'git [u]ndo stage hunk' })
map('n', '<leader>hR', gitsigns.reset_buffer, { desc = 'git [R]eset buffer' })
map('n', '<leader>hp', gitsigns.preview_hunk, { desc = 'git [p]review hunk' })
map('n', '<leader>hb', gitsigns.blame_line, { desc = 'git [b]lame line' })
map('n', '<leader>hd', gitsigns.diffthis, { desc = 'git [d]iff against index' })
map('n', '<leader>hD', function()
map('n', '<leader>gs', gitsigns.stage_hunk, { desc = 'git [s]tage hunk' })
map('n', '<leader>gr', gitsigns.reset_hunk, { desc = 'git [r]eset hunk' })
map('n', '<leader>gS', gitsigns.stage_buffer, { desc = 'git [S]tage buffer' })
map('n', '<leader>gu', gitsigns.stage_hunk, { desc = 'git [u]ndo stage hunk' })
map('n', '<leader>gR', gitsigns.reset_buffer, { desc = 'git [R]eset buffer' })
map('n', '<leader>gp', gitsigns.preview_hunk, { desc = 'git [p]review hunk' })
map('n', '<leader>gb', gitsigns.blame_line, { desc = 'git [b]lame line' })
map('n', '<leader>gd', gitsigns.diffthis, { desc = 'git [d]iff against index' })
map('n', '<leader>gD', function()
gitsigns.diffthis '@'
end, { desc = 'git [D]iff against last commit' })
-- Toggles
map('n', '<leader>tb', gitsigns.toggle_current_line_blame, { desc = '[T]oggle git show [b]lame line' })
map('n', '<leader>tD', gitsigns.preview_hunk_inline, { desc = '[T]oggle git show [D]eleted' })
-- Following moved to custom mappings
-- -- Toggles
-- map('n', '<leader>tb', gitsigns.toggle_current_line_blame, { desc = 'toggle git show [b]lame line' })
-- map('n', '<leader>tD', gitsigns.preview_hunk_inline, { desc = 'toggle git show [D]eleted' })
end,
signs = {
add = { text = '+' },

View File

@@ -159,7 +159,7 @@ return {
if client and client_supports_method(client, vim.lsp.protocol.Methods.textDocument_inlayHint, event.buf) then
map('<leader>th', function()
vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled { bufnr = event.buf })
end, '[T]oggle Inlay [H]ints')
end, 'toggle Inlay [h]ints')
end
end,
})
@@ -274,4 +274,3 @@ return {
end,
},
}

View File

@@ -0,0 +1,68 @@
-- obsidian
-- https://github.com/obsidian-nvim/obsidian.nvim
--
return {
'obsidian-nvim/obsidian.nvim',
version = '*', -- recommended, use latest release instead of latest commit
lazy = true,
ft = 'markdown',
-- Replace the above line with this if you only want to load obsidian.nvim for markdown files in your vault:
-- event = {
-- -- If you want to use the home shortcut '~' here you need to call 'vim.fn.expand'.
-- -- E.g. "BufReadPre " .. vim.fn.expand "~" .. "/my-vault/*.md"
-- -- refer to `:h file-pattern` for more examples
-- "BufReadPre path/to/my-vault/*.md",
-- "BufNewFile path/to/my-vault/*.md",
-- },
---@module 'obsidian'
---@type obsidian.config
opts = {
legacy_commands = false,
workspaces = {
{
name = 'dane',
path = '~/Notes/dane',
strict = true,
},
{
name = 'travail',
path = '~/Notes/travail',
strict = true,
},
{
name = 'no-vault',
path = function()
-- alternatively use the CWD:
-- return assert(vim.fn.getcwd())
return assert(vim.fs.dirname(vim.api.nvim_buf_get_name(0)))
end,
overrides = {
notes_subdir = vim.NIL, -- have to use 'vim.NIL' instead of 'nil'
new_notes_location = 'current_dir',
templates = {
folder = vim.NIL,
},
disable_frontmatter = true,
},
},
},
daily_notes = {
-- 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',
-- 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.
default_tags = { 'daily-notes' },
-- Optional, if you want to automatically insert a template from your template directory like 'daily.md'
template = nil,
-- Optional, if you want `Obsidian yesterday` to return the last work day or `Obsidian tomorrow` to return the next work day.
workdays_only = true,
},
-- see below for full list of options 👇
},
}

View File

@@ -85,7 +85,7 @@ return {
vim.g.molten_image_provider = 'image.nvim'
-- vim.g.molten_output_win_max_height = 20
vim.g.molten_auto_open_output = true
vim.g.molten_auto_open_html_in_browser = true
-- vim.g.molten_auto_open_html_in_browser = true
vim.g.molten_tick_rate = 200
end,
config = function()
@@ -108,6 +108,7 @@ return {
end,
opts = {
auto_scroll = true,
jupyter_command = '/home/jeff/.asdf/shims/jupyter',
},
},
{

View File

@@ -68,41 +68,43 @@ return {
pcall(require('telescope').load_extension, 'fzf')
pcall(require('telescope').load_extension, 'ui-select')
-- See `:help telescope.builtin`
local builtin = require 'telescope.builtin'
vim.keymap.set('n', '<leader>sh', builtin.help_tags, { desc = '[S]earch [H]elp' })
vim.keymap.set('n', '<leader>sk', builtin.keymaps, { desc = '[S]earch [K]eymaps' })
vim.keymap.set('n', '<leader>sf', builtin.find_files, { desc = '[S]earch [F]iles' })
vim.keymap.set('n', '<leader>ss', builtin.builtin, { desc = '[S]earch [S]elect Telescope' })
vim.keymap.set('n', '<leader>sw', builtin.grep_string, { desc = '[S]earch current [W]ord' })
vim.keymap.set('n', '<leader>sg', builtin.live_grep, { desc = '[S]earch by [G]rep' })
vim.keymap.set('n', '<leader>sd', builtin.diagnostics, { desc = '[S]earch [D]iagnostics' })
vim.keymap.set('n', '<leader>sr', builtin.resume, { desc = '[S]earch [R]esume' })
vim.keymap.set('n', '<leader>s.', builtin.oldfiles, { desc = '[S]earch Recent Files ("." for repeat)' })
vim.keymap.set('n', '<leader><leader>', builtin.buffers, { desc = '[ ] Find existing buffers' })
-- Slightly advanced example of overriding default behavior and theme
vim.keymap.set('n', '<leader>/', function()
-- You can pass additional configuration to Telescope to change the theme, layout, etc.
builtin.current_buffer_fuzzy_find(require('telescope.themes').get_dropdown {
winblend = 10,
previewer = false,
})
end, { desc = '[/] Fuzzily search in current buffer' })
-- It's also possible to pass additional configuration options.
-- See `:help telescope.builtin.live_grep()` for information about particular keys
vim.keymap.set('n', '<leader>s/', function()
builtin.live_grep {
grep_open_files = true,
prompt_title = 'Live Grep in Open Files',
}
end, { desc = '[S]earch [/] in Open Files' })
-- Shortcut for searching your Neovim configuration files
vim.keymap.set('n', '<leader>sn', function()
builtin.find_files { cwd = vim.fn.stdpath 'config' }
end, { desc = '[S]earch [N]eovim files' })
-- Following mappings has been moved into my custom keymapping directory tree
-- -- See `:help telescope.builtin`
-- local builtin = require 'telescope.builtin'
-- vim.keymap.set('n', '<leader>sh', builtin.help_tags, { desc = '[S]earch [H]elp' })
-- vim.keymap.set('n', '<leader>sk', builtin.keymaps, { desc = '[S]earch [K]eymaps' })
-- vim.keymap.set('n', '<leader>sf', builtin.find_files, { desc = '[S]earch [F]iles' })
-- vim.keymap.set('n', '<leader>ss', builtin.builtin, { desc = '[S]earch [S]elect Telescope' })
-- vim.keymap.set('n', '<leader>sw', builtin.grep_string, { desc = '[S]earch current [W]ord' })
-- vim.keymap.set('n', '<leader>sg', builtin.live_grep, { desc = '[S]earch by [G]rep' })
-- vim.keymap.set('n', '<leader>sd', builtin.diagnostics, { desc = '[S]earch [D]iagnostics' })
-- vim.keymap.set('n', '<leader>sr', builtin.resume, { desc = '[S]earch [R]esume' })
-- vim.keymap.set('n', '<leader>s.', builtin.oldfiles, { desc = '[S]earch Recent Files ("." for repeat)' })
-- vim.keymap.set('n', '<leader><leader>', builtin.buffers, { desc = '[ ] Find existing buffers' })
--
-- -- Slightly advanced example of overriding default behavior and theme
-- vim.keymap.set('n', '<leader>/', function()
-- -- You can pass additional configuration to Telescope to change the theme, layout, etc.
-- builtin.current_buffer_fuzzy_find(require('telescope.themes').get_dropdown {
-- winblend = 10,
-- previewer = false,
-- })
-- end, { desc = '[/] Fuzzily search in current buffer' })
--
-- -- It's also possible to pass additional configuration options.
-- -- See `:help telescope.builtin.live_grep()` for information about particular keys
-- vim.keymap.set('n', '<leader>s/', function()
-- builtin.live_grep {
-- grep_open_files = true,
-- prompt_title = 'Live Grep in Open Files',
-- }
-- end, { desc = '[S]earch [/] in Open Files' })
--
-- -- Shortcut for searching your Neovim configuration files
-- vim.keymap.set('n', '<leader>sn', function()
-- builtin.find_files { cwd = vim.fn.stdpath 'config' }
-- end, { desc = '[S]earch [N]eovim files' })
end,
},
}
}

View File

@@ -45,13 +45,6 @@ return {
F12 = '<F12>',
},
},
-- Document existing key chains
spec = {
{ '<leader>s', group = '[S]earch' },
{ '<leader>t', group = '[T]oggle' },
{ '<leader>h', group = 'Git [H]unk', mode = { 'n', 'v' } },
},
},
},
}
}