Sync config for all systems

This commit is contained in:
Martin
2025-07-10 20:05:30 +02:00
parent 2d93535296
commit 606e5bed8e
2 changed files with 104 additions and 65 deletions

View File

@ -50,6 +50,12 @@
HISTCONTROL='erasedups:ignoreboth' HISTCONTROL='erasedups:ignoreboth'
HISTIGNORE='&:[ ]*:exit:ls:bg:fg:history:clear' HISTIGNORE='&:[ ]*:exit:ls:bg:fg:history:clear'
unsetopt beep unsetopt beep
if [[ "$(uname -s)" == "Darwin" ]]; then
export RUSTUP_HOME="$HOME/.rustup"
export CARGO_HOME="$HOME/.cargo"
[ -f "$CARGO_HOME/env" ] && . "$CARGO_HOME/env"
fi;
''; '';
}; };
@ -84,6 +90,7 @@
viddy viddy
duf duf
(python3.withPackages(ps: [ ps.llm ps.llm-gemini ])) (python3.withPackages(ps: [ ps.llm ps.llm-gemini ]))
#nerdfonts
]; ];
home.sessionVariables = lib.mkMerge [ { home.sessionVariables = lib.mkMerge [ {
@ -91,9 +98,15 @@
} }
]; ];
home.shellAliases = lib.mkMerge [ { home.shellAliases = lib.mkMerge [
open = "explorer.exe ."; {
lst = "lsd --tree"; lst = "lsd --tree";
} }
# This is the correct way to use lib.mkIf within lib.mkMerge
# (lib.mkIf pkgs.stdenv.targetPlatform.isWindows {
(lib.mkIf (lib.strings.hasSuffix "windows" pkgs.system) {
open = "explorer.exe .";
})
]; ];
} }

View File

@ -36,7 +36,7 @@ cmp.setup({
['<C-f>'] = cmp.mapping.scroll_docs(4), ['<C-f>'] = cmp.mapping.scroll_docs(4),
['<C-Space>'] = cmp.mapping.complete(), ['<C-Space>'] = cmp.mapping.complete(),
['<C-e>'] = cmp.mapping.abort(), ['<C-e>'] = cmp.mapping.abort(),
['<Tab>'] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. ['<Tab>'] = cmp.mapping.confirm({ select = false }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
}), }),
sources = cmp.config.sources({ sources = cmp.config.sources({
@ -101,6 +101,20 @@ local lspconfig = require("lspconfig")
-- lspconfig.flow.setup({ capabilities = capabilities }) -- lspconfig.flow.setup({ capabilities = capabilities })
-- lspconfig.nil_ls.setup({ capabilities = capabilities }) -- lspconfig.nil_ls.setup({ capabilities = capabilities })
capabilities.textDocument.foldingRange = {
dynamicRegistration = false,
lineFoldingOnly = true
}
local language_servers = vim.lsp.get_clients() -- or list servers manually like {'gopls', 'clangd'}
for _, ls in ipairs(language_servers) do
require('lspconfig')[ls].setup({
capabilities = capabilities
-- you can add other fields for setting up lsp server in this table
})
end
require('ufo').setup()
require("yanky").setup({ require("yanky").setup({
ring = { ring = {
history_length = 100, history_length = 100,
@ -261,71 +275,11 @@ require('gitsigns').setup {
}, },
} }
require("obsidian").setup({
workspaces = {
{
name = "work",
path = "/mnt/c/Users/marti/Documents/notes/Work",
},
},
templates = {
folder = "_templates",
date_format = "%Y-%m-%d, %a",
time_format = "%H:%M",
},
ui = {
checkboxes = {
[" "] = { char = "󰄱", hl_group = "ObsidianTodo" },
[">"] = { char = "", hl_group = "ObsidianRightArrow" },
["x"] = { char = "", hl_group = "ObsidianDone" },
["~"] = { char = "󰰱", hl_group = "ObsidianTilde" },
["!"] = { char = "", hl_group = "ObsidianImportant" },
["?"] = { char = "?", hl_group = "ObsidianImportant" },
},
},
disable_frontmatter = false,
note_frontmatter_func = function(note)
-- Add the title of the note as an alias.
if note.title then
note:add_alias(note.title)
end
local out = { id = note.id, tags = note.tags }
-- `note.metadata` contains any manually added fields in the frontmatter.
-- So here we just make sure those fields are kept in the frontmatter.
if note.metadata ~= nil and not vim.tbl_isempty(note.metadata) then
for k, v in pairs(note.metadata) do
out[k] = v
end
end
return out
end,
note_path_func = function(spec)
-- This is equivalent to the default behavior.
local path = spec.dir / spec.title
return path:with_suffix(".md")
end,
-- daily_notes = {
-- -- Optional, if you keep daily notes in a separate directory.
-- folder = "Journal",
-- -- Optional, if you want to change the date format for the ID of daily notes.
-- date_format = "%Y-%m-%d",
-- -- Optional, default tags to add to each new daily note created.
-- default_tags = { "journal" },
-- -- Optional, if you want to automatically insert a template from your template directory like 'daily.md'
-- template = "daily.md"
-- },
})
require("conform").setup({ require("conform").setup({
python = {"black"}, python = {"black"},
rust = {"rustfmt"}, rust = {"rustfmt"},
go = {"gofmt"}, go = {"gofmt"},
}) })
require("trouble").setup() require("trouble").setup()
require("todo-comments").setup() require("todo-comments").setup()
@ -345,3 +299,75 @@ end
dap.listeners.before.event_exited.dapui_config = function() dap.listeners.before.event_exited.dapui_config = function()
dapui.close() dapui.close()
end end
if vim.fn.has("mac") then
workspaces = {
{
name = "privat",
path = "~/Documents/notes/privat",
},
{
name = "joplin",
path = "~/Documents/notes/fromjoplin",
},
}
daily_notes = {
folder = "Journal",
date_format = "%Y-%m-%d",
default_tags = { "journal" },
template = "daily.md"
}
elseif vim.fn.has("win32") then
workspaces = {
{
name = "work",
path = "/mnt/c/Users/marti/Documents/notes/Work",
},
{
name = "privat",
path = "/mnt/c/Users/marti/Documents/notes/privat",
},
}
daily_notes = {}
end
require("obsidian").setup({
workspaces = workspaces,
templates = {
folder = "_templates",
date_format = "%Y-%m-%d %a",
time_format = "%H:%M",
},
ui = {
checkboxes = {
[" "] = { char = "󰄱", hl_group = "ObsidianTodo" },
[">"] = { char = "", hl_group = "ObsidianRightArrow" },
["x"] = { char = "", hl_group = "ObsidianDone" },
["~"] = { char = "󰰱", hl_group = "ObsidianTilde" },
["!"] = { char = "", hl_group = "ObsidianImportant" },
["?"] = { char = "?", hl_group = "ObsidianImportant" }
},
},
disable_frontmatter = false,
note_frontmatter_func = function(note)
-- Add the title of the note as an alias.
if note.title then
note:add_alias(note.title)
end
local out = { id = note.id, tags = note.tags }
if note.metadata ~= nil and not vim.tbl_isempty(note.metadata) then
for k, v in pairs(note.metadata) do
out[k] = v
end
end
return out
end,
note_path_func = function(spec)
local path = spec.dir / spec.title
return path:with_suffix(".md")
end,
daily_notes = daily_notes,
})