Compare commits

..

17 Commits

Author SHA1 Message Date
Martin Pander
93549cc312 Upgrade to NixOS-WSL 25.11 2026-03-11 09:45:47 +01:00
Martin Pander
433536db6a Move lsp setup into filetype autocommands 2026-03-11 09:31:56 +01:00
Martin Pander
98169a672b Update 2026-03-02 19:56:20 +01:00
Martin Pander
ad7c88a221 Fix tmux config on mac 2026-03-02 19:40:10 +01:00
Martin Pander
2253f44399 Fix dap 2026-02-27 15:29:53 +01:00
Martin Pander
e45151a774 Update packages 2026-02-24 19:26:38 +01:00
Martin Pander
f87d3eb2e4 Make room for window manager shortcuts 2026-02-19 16:26:44 +01:00
Martin Pander
c8e7799db2 Update opencode 2026-02-18 11:13:26 +01:00
Martin Pander
36bb532cc9 Update tasksquire 2026-02-17 21:34:25 +01:00
Martin Pander
2fbab2f267 Remove vim-tmux-navigator 2026-02-15 20:54:11 +01:00
Martin Pander
a6b3250434 Consolidate tmux and vim navigation 2026-02-15 20:23:16 +01:00
Martin Pander
4049d3981b Consolidate tmux window and pane switching 2026-02-15 20:18:30 +01:00
Martin Pander
0012b07304 Fix obsidian.nvim workspace 2026-02-13 21:33:50 +01:00
Martin Pander
f7d8e728ff Add opencode.nvim 2026-02-13 21:25:03 +01:00
Martin Pander
228fb04814 Add personal opencode config 2026-02-13 17:24:58 +01:00
Martin Pander
80fb31ffe1 Add opencode models 2026-02-12 12:56:18 +01:00
Martin Pander
240c838a7b Update opencode config 2026-02-11 22:00:44 +01:00
15 changed files with 341 additions and 239 deletions

51
TODO.md
View File

@@ -33,11 +33,9 @@ This file tracks remaining tasks and known issues for the NixOS configuration.
- [ ] Consider adding additional shell aliases - [ ] Consider adding additional shell aliases
- [ ] Review if any macOS-specific tools need Linux alternatives - [ ] Review if any macOS-specific tools need Linux alternatives
- [ ] Consider adding dircolors configuration
### Documentation ### Documentation
- [ ] Add screenshots of tmux setup
- [ ] Document custom Neovim configuration (lua files) - [ ] Document custom Neovim configuration (lua files)
- [ ] Create troubleshooting guide for common issues - [ ] Create troubleshooting guide for common issues
@@ -51,69 +49,20 @@ This file tracks remaining tasks and known issues for the NixOS configuration.
These were not in the original Home Manager config but might be useful on NixOS: These were not in the original Home Manager config but might be useful on NixOS:
- [ ] Desktop environment / Window manager
- [ ] Display manager (GDM, SDDM, LightDM)
- [ ] Sound configuration (PipeWire/PulseAudio)
- [ ] Printing support
- [ ] Bluetooth support
- [ ] Docker / Podman - [ ] Docker / Podman
- [ ] Virtualization (QEMU/KVM)
## Known Issues ## Known Issues
### Nvim Configuration Files
The nvim configuration references lua files from the parent directory:
```nix
initLua = builtins.concatStringsSep "\n" [
(lib.strings.fileContents ../../../nvim/base.lua)
(lib.strings.fileContents ../../../nvim/keymaps.lua)
(lib.strings.fileContents ../../../nvim/plugins.lua)
(lib.strings.fileContents ../../../nvim/filetype.lua)
];
```
**Status**: Should work if nvim/ directory exists at `/home/pan/dev/config/dot/nvim/`
**Action**: Verify these files exist or adjust paths
### Profile Loading
The shell configuration is now configurable via `dot.sh.sourceProfile`:
```nix
profileExtra = lib.mkIf cfg.sourceProfile ''
source $HOME/.profile
'';
```
**Status**: Disabled by default. Only enabled for work host.
**Action**: Verify `~/.profile` exists on hosts where `dot.sh.sourceProfile = true` is set.
## Testing Checklist ## Testing Checklist
Before considering this configuration complete: Before considering this configuration complete:
- [ ] System boots successfully
- [ ] User can login as `pan`
- [ ] Zsh loads with Prezto
- [ ] Tmux starts without errors
- [ ] Neovim opens and plugins load
- [ ] LSP servers work in Neovim - [ ] LSP servers work in Neovim
- [ ] Git commands work with correct identity
- [ ] Lazygit opens and works
- [ ] Jujutsu commands work
- [ ] Taskwarrior shows tasks
- [ ] Direnv loads `.envrc` files
- [ ] fzf keybindings work (Ctrl+R)
- [ ] zoxide navigation works
- [ ] All shell aliases work
## Future Enhancements ## Future Enhancements
- [ ] Add backup/restore scripts - [ ] Add backup/restore scripts
- [ ] Create CI/CD for testing configuration - [ ] Create CI/CD for testing configuration
- [ ] Add secrets management (agenix or sops-nix)
- [ ] Consider using flake-parts for better organization - [ ] Consider using flake-parts for better organization
- [ ] Add system monitoring tools - [ ] Add system monitoring tools
- [ ] Configure automatic updates - [ ] Configure automatic updates

143
flake.lock generated
View File

@@ -16,6 +16,24 @@
"type": "github" "type": "github"
} }
}, },
"flake-parts": {
"inputs": {
"nixpkgs-lib": "nixpkgs-lib"
},
"locked": {
"lastModified": 1769996383,
"narHash": "sha256-AnYjnFWgS49RlqX7LrC4uA+sCCDBj0Ry/WOJ5XWAsa0=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "57928607ea566b5db3ad13af0e57e921e6b12381",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"flake-utils": { "flake-utils": {
"inputs": { "inputs": {
"systems": "systems" "systems": "systems"
@@ -34,24 +52,6 @@
"type": "github" "type": "github"
} }
}, },
"flake-utils_2": {
"inputs": {
"systems": "systems_2"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"home-manager": { "home-manager": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@@ -59,11 +59,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1770260404, "lastModified": 1772985280,
"narHash": "sha256-3iVX1+7YUIt23hBx1WZsUllhbmP2EnXrV8tCRbLxHc8=", "narHash": "sha256-FdrNykOoY9VStevU4zjSUdvsL9SzJTcXt4omdEDZDLk=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "0d782ee42c86b196acff08acfbf41bb7d13eed5b", "rev": "8f736f007139d7f70752657dff6a401a585d6cbc",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -80,16 +80,16 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1763992789, "lastModified": 1772985280,
"narHash": "sha256-WHkdBlw6oyxXIra/vQPYLtqY+3G8dUVZM8bEXk0t8x4=", "narHash": "sha256-FdrNykOoY9VStevU4zjSUdvsL9SzJTcXt4omdEDZDLk=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "44831a7eaba4360fb81f2acc5ea6de5fde90aaa3", "rev": "8f736f007139d7f70752657dff6a401a585d6cbc",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nix-community", "owner": "nix-community",
"ref": "release-25.05", "ref": "release-25.11",
"repo": "home-manager", "repo": "home-manager",
"type": "github" "type": "github"
} }
@@ -101,11 +101,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1770184146, "lastModified": 1773000227,
"narHash": "sha256-DsqnN6LvXmohTRaal7tVZO/AKBuZ02kPBiZKSU4qa/k=", "narHash": "sha256-zm3ftUQw0MPumYi91HovoGhgyZBlM4o3Zy0LhPNwzXE=",
"owner": "LnL7", "owner": "LnL7",
"repo": "nix-darwin", "repo": "nix-darwin",
"rev": "0d7874ef7e3ba02d58bebb871e6e29da36fa1b37", "rev": "da529ac9e46f25ed5616fd634079a5f3c579135f",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -143,27 +143,27 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1768814715, "lastModified": 1772455238,
"narHash": "sha256-uTvoxG2KuWQsIaVbvzkEQB276IxVZYrV+UeALXnIyp8=", "narHash": "sha256-QE29mlgasni5gszxs9/qNLnp6wvXgicP2iSh0gybPfw=",
"owner": "nix-community", "owner": "nix-community",
"repo": "nixos-wsl", "repo": "nixos-wsl",
"rev": "a14126746cee49ba450b9c7e0dc024128e094009", "rev": "eabb9a917f546c0bb64654850dd5f57f7694d1a3",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nix-community", "owner": "nix-community",
"ref": "release-25.05", "ref": "release-25.11",
"repo": "nixos-wsl", "repo": "nixos-wsl",
"type": "github" "type": "github"
} }
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1770562336, "lastModified": 1772963539,
"narHash": "sha256-ub1gpAONMFsT/GU2hV6ZWJjur8rJ6kKxdm9IlCT0j84=", "narHash": "sha256-9jVDGZnvCckTGdYT53d/EfznygLskyLQXYwJLKMPsZs=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "d6c71932130818840fc8fe9509cf50be8c64634f", "rev": "9dcb002ca1690658be4a04645215baea8b95f31d",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -173,13 +173,28 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs-lib": {
"locked": {
"lastModified": 1769909678,
"narHash": "sha256-cBEymOf4/o3FD5AZnzC3J9hLbiZ+QDT/KDuyHXVJOpM=",
"owner": "nix-community",
"repo": "nixpkgs.lib",
"rev": "72716169fe93074c333e8d0173151350670b824c",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nixpkgs.lib",
"type": "github"
}
},
"nixpkgs-stable": { "nixpkgs-stable": {
"locked": { "locked": {
"lastModified": 1770617025, "lastModified": 1773068389,
"narHash": "sha256-1jZvgZoAagZZB6NwGRv2T2ezPy+X6EFDsJm+YSlsvEs=", "narHash": "sha256-vMrm7Pk2hjBRPnCSjhq1pH0bg350Z+pXhqZ9ICiqqCs=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "2db38e08fdadcc0ce3232f7279bab59a15b94482", "rev": "44bae273f9f82d480273bab26f5c50de3724f52f",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -191,33 +206,34 @@
}, },
"nixpkgs-wsl-stable": { "nixpkgs-wsl-stable": {
"locked": { "locked": {
"lastModified": 1767313136, "lastModified": 1773068389,
"narHash": "sha256-16KkgfdYqjaeRGBaYsNrhPRRENs0qzkQVUooNHtoy2w=", "narHash": "sha256-vMrm7Pk2hjBRPnCSjhq1pH0bg350Z+pXhqZ9ICiqqCs=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "ac62194c3917d5f474c1a844b6fd6da2db95077d", "rev": "44bae273f9f82d480273bab26f5c50de3724f52f",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nixos", "owner": "nixos",
"ref": "nixos-25.05", "ref": "nixos-25.11",
"repo": "nixpkgs", "repo": "nixpkgs",
"type": "github" "type": "github"
} }
}, },
"nixpkgs_2": { "nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1770197578, "lastModified": 1771369470,
"narHash": "sha256-AYqlWrX09+HvGs8zM6ebZ1pwUqjkfpnv8mewYwAo+iM=", "narHash": "sha256-0NBlEBKkN3lufyvFegY4TYv5mCNHbi5OmBDrzihbBMQ=",
"owner": "NixOS", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "00c21e4c93d963c50d4c0c89bfa84ed6e0694df2", "rev": "0182a361324364ae3f436a63005877674cf45efb",
"type": "github" "type": "github"
}, },
"original": { "original": {
"id": "nixpkgs", "owner": "nixos",
"ref": "nixos-unstable", "ref": "nixos-unstable",
"type": "indirect" "repo": "nixpkgs",
"type": "github"
} }
}, },
"root": { "root": {
@@ -241,11 +257,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1770683991, "lastModified": 1773096132,
"narHash": "sha256-xVfPvXDf9QN3Eh9dV+Lw6IkWG42KSuQ1u2260HKvpnc=", "narHash": "sha256-M3zEnq9OElB7zqc+mjgPlByPm1O5t2fbUrH3t/Hm5Ag=",
"owner": "Mic92", "owner": "Mic92",
"repo": "sops-nix", "repo": "sops-nix",
"rev": "8b89f44c2cc4581e402111d928869fe7ba9f7033", "rev": "d1ff3b1034d5bab5d7d8086a7803c5a5968cd784",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -269,32 +285,17 @@
"type": "github" "type": "github"
} }
}, },
"systems_2": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"tasksquire": { "tasksquire": {
"inputs": { "inputs": {
"flake-utils": "flake-utils_2", "flake-parts": "flake-parts",
"nixpkgs": "nixpkgs_2" "nixpkgs": "nixpkgs_2"
}, },
"locked": { "locked": {
"lastModified": 1770735271, "lastModified": 1771878653,
"narHash": "sha256-Vt1di5EUPq6ijBX0h8aaRVnSkCDpI5Myd2tXjQlK3Tw=", "narHash": "sha256-+OkJmYH+h5dgAbUtbGq8fZ90g5/rwiew5WPmbexD9kI=",
"ref": "dev", "ref": "dev",
"rev": "6e606985267d438f6d30a117863812347960694b", "rev": "6b1418fc71be513ba5ebb718da29e3190c3fda58",
"revCount": 48, "revCount": 52,
"type": "git", "type": "git",
"url": "ssh://git@git.pander.me/martin/tasksquire.git" "url": "ssh://git@git.pander.me/martin/tasksquire.git"
}, },

View File

@@ -7,10 +7,10 @@
nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-25.11"; nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-25.11";
nixpkgs-wsl-stable.url = "github:nixos/nixpkgs/nixos-25.05"; nixpkgs-wsl-stable.url = "github:nixos/nixpkgs/nixos-25.11";
nixos-wsl = { nixos-wsl = {
url = "github:nix-community/nixos-wsl/release-25.05"; url = "github:nix-community/nixos-wsl/release-25.11";
inputs.nixpkgs.follows = "nixpkgs-wsl-stable"; inputs.nixpkgs.follows = "nixpkgs-wsl-stable";
}; };
@@ -20,7 +20,7 @@
}; };
home-manager-wsl = { home-manager-wsl = {
url = "github:nix-community/home-manager/release-25.05"; url = "github:nix-community/home-manager/release-25.11";
inputs.nixpkgs.follows = "nixpkgs-wsl-stable"; inputs.nixpkgs.follows = "nixpkgs-wsl-stable";
}; };

View File

@@ -18,5 +18,7 @@
dot.llm = { dot.llm = {
enable = true; enable = true;
gemini-cli.enable = true; gemini-cli.enable = true;
opencode.enable = true;
opencode.enableConfig = true;
}; };
} }

View File

@@ -20,6 +20,7 @@
claude-code.enable = true; claude-code.enable = true;
opencode.enable = true; opencode.enable = true;
opencode.enableConfig = true; opencode.enableConfig = true;
opencode.workMode = true;
}; };
dot.tmux.workMode = true; dot.tmux.workMode = true;

View File

@@ -18,5 +18,11 @@
shell = pkgs.zsh; shell = pkgs.zsh;
}; };
fileSystems."/home/pan/pro" = {
device = "/dev/disk/by-uuid/9a37862c-85db-4434-b06a-ec8c2713ecc9";
fsType = "ext4"; # or xfs, etc.
options = [ "defaults" "nofail" "x-systemd.automount" ];
};
system.stateVersion = "25.05"; system.stateVersion = "25.05";
} }

View File

@@ -38,6 +38,7 @@ in
home.packages = with pkgs; [ home.packages = with pkgs; [
visidata visidata
codespelunker
]; ];
} }

View File

@@ -59,10 +59,12 @@ in
copilot-lua copilot-lua
copilot-cmp copilot-cmp
CopilotChat-nvim CopilotChat-nvim
# opencode-nvim
bullets-vim bullets-vim
nvim-dap nvim-dap
nvim-nio nvim-nio
nvim-dap-ui # nvim-dap-ui
nvim-dap-view
nvim-dap-virtual-text nvim-dap-virtual-text
nvim-dap-go nvim-dap-go
nvim-dap-python nvim-dap-python
@@ -81,7 +83,8 @@ in
extraLuaConfig = '' extraLuaConfig = ''
_G.is_work = ${if cfg.workMode then "true" else "false"} _G.is_work = ${if cfg.workMode then "true" else "false"}
_G.is_home = ${if pkgs.stdenv.isDarwin then "true" else "false"} _G.is_mac = ${if pkgs.stdenv.isDarwin then "true" else "false"}
_G.is_private_nixos = ${if !cfg.workMode && pkgs.stdenv.isLinux then "true" else "false"}
require('base') require('base')
require('keymaps') require('keymaps')

View File

@@ -10,6 +10,8 @@ in
default = false; default = false;
description = "Enable managed OpenCode configuration"; description = "Enable managed OpenCode configuration";
}; };
workMode = lib.mkEnableOption "work-specific opencode configuration";
}; };
config = lib.mkIf cfg.enableConfig { config = lib.mkIf cfg.enableConfig {
@@ -20,9 +22,15 @@ in
# Create the OpenCode config.json template with secret substitution # Create the OpenCode config.json template with secret substitution
sops.templates."opencode/opencode.json" = { sops.templates."opencode/opencode.json" = {
content = builtins.toJSON { content = builtins.toJSON (let
baseConfig = {
"$schema" = "https://opencode.ai/config.json"; "$schema" = "https://opencode.ai/config.json";
model = "anthropic/claude-sonnet-4-5-20250929"; default_agent = "plan";
};
workConfig = {
enabled_providers = [ "anthropic" "langdock-openai" "ollama" ];
model = "anthropic/claude-opus-4-6-default";
small_model = "anthropic/claude-haiku-4-5-20251001"; small_model = "anthropic/claude-haiku-4-5-20251001";
provider = { provider = {
langdock-openai = { langdock-openai = {
@@ -34,7 +42,6 @@ in
}; };
models = { models = {
"gpt-5.2" = { name = "GPT-5.2"; }; "gpt-5.2" = { name = "GPT-5.2"; };
"gpt-4.1" = { name = "GPT-4.1"; };
"gpt-5-mini" = { name = "GPT-5 mini"; }; "gpt-5-mini" = { name = "GPT-5 mini"; };
}; };
}; };
@@ -45,7 +52,10 @@ in
}; };
models = { models = {
"claude-opus-4-6-default" = { name = "Opus 4.6"; }; "claude-opus-4-6-default" = { name = "Opus 4.6"; };
"claude-sonnet-4-6-default" = { name = "Sonnet 4.6"; };
"claude-haiku-4-5-20251001" = { name = "Haiku 4.5"; };
}; };
whitelist = [ "claude-opus-4-6-default" "claude-sonnet-4-6-default" "claude-haiku-4-5-20251001"];
}; };
ollama = { ollama = {
npm = "@ai-sdk/openai-compatible"; npm = "@ai-sdk/openai-compatible";
@@ -60,6 +70,17 @@ in
}; };
}; };
}; };
personalConfig = {
plugin = [ "opencode-gemini-auth@latest" ];
model = "google/gemini-3-pro-preview";
small_model = "google/gemini-3-flash-preview";
enabled_providers = [ "google" ];
};
in
# Merge base config with the selected mode config
baseConfig // (if cfg.workMode then workConfig else personalConfig)
);
}; };
# Link the generated config to the expected location # Link the generated config to the expected location

View File

@@ -96,6 +96,7 @@ in
ripgrep-all ripgrep-all
viddy viddy
duf duf
lsof
]; ];
home.sessionVariables = { home.sessionVariables = {

View File

@@ -14,7 +14,7 @@ in
shortcut = "a"; shortcut = "a";
mouse = true; mouse = true;
keyMode = "vi"; keyMode = "vi";
escapeTime = 0; escapeTime = 10;
terminal = "screen-256color"; terminal = "screen-256color";
tmuxp.enable = true; tmuxp.enable = true;
extraConfig = '' extraConfig = ''
@@ -22,12 +22,15 @@ in
unbind S unbind S
bind S command-prompt "switch -t %1" bind S command-prompt "switch -t %1"
bind-key , command-prompt -p "rename-window:" "rename-window '%%'"
bind-key -n M-K switch-client -p # Check if we are in vim
bind-key -n M-J switch-client -n is_vim="ps -o state= -o comm= -t '#{pane_tty}' | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
bind-key -n M-L next-window bind-key -n C-M-h if-shell "$is_vim" { send-keys C-M-h } { if -F "#{pane_at_left}" "previous-window" "select-pane -L" }
bind-key -n M-H previous-window bind-key -n C-M-j if-shell "$is_vim" { send-keys C-M-j } { if -F "#{pane_at_bottom}" "switch-client -n" "select-pane -D" }
bind-key -n C-M-k if-shell "$is_vim" { send-keys C-M-k } { if -F "#{pane_at_top}" "switch-client -p" "select-pane -U" }
bind-key -n C-M-l if-shell "$is_vim" { send-keys C-M-l } { if -F "#{pane_at_right}" "next-window" "select-pane -R" }
bind '"' split-window -c "#{pane_current_path}" bind '"' split-window -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}" bind % split-window -h -c "#{pane_current_path}"

View File

@@ -36,7 +36,6 @@ vim.opt.foldopen = vim.opt.foldopen - 'block'
vim.opt.foldlevel = 99 vim.opt.foldlevel = 99
vim.opt.lazyredraw = true vim.opt.lazyredraw = true
vim.opt.listchars = 'eol:¬,tab:▸ ,trail:·' vim.opt.listchars = 'eol:¬,tab:▸ ,trail:·'
vim.opt.fillchars = 'vert:|,fold: '
vim.opt.list = true vim.opt.list = true
vim.opt.laststatus = 3 vim.opt.laststatus = 3
vim.opt.scrolloff = 8 vim.opt.scrolloff = 8

View File

@@ -3,62 +3,128 @@ local capabilities = require('cmp_nvim_lsp').default_capabilities()
vim.api.nvim_create_augroup('FileTypeConfigs', { clear = true }) vim.api.nvim_create_augroup('FileTypeConfigs', { clear = true })
vim.api.nvim_create_autocmd('FileType', { vim.api.nvim_create_autocmd('FileType', {
group = 'FileTypeConfigs', group = vim.api.nvim_create_augroup('FileTypeConfigs', { clear = true }),
pattern = 'python', pattern = 'python',
once = true,
callback = function() callback = function()
require('dap-python').setup() require('dap-python').setup()
-- lspconfig.pyright.setup({ capabilities = capabilities })
-- require("conform").setup({
-- python = {"black"},
-- })
end, end,
}) })
-- vim.api.nvim_create_autocmd('FileType', { vim.api.nvim_create_autocmd('FileType', {
-- group = 'FileTypeConfigs', group = vim.api.nvim_create_augroup('FileTypeConfigs', { clear = true }),
-- pattern = 'go', pattern = 'go',
-- callback = function() once = true,
-- require('dap-python').setup() callback = function()
-- require('dap-go').setup() vim.lsp.enable('ty')
vim.lsp.enable('gopls')
require('dap-go').setup()
end,
})
vim.api.nvim_create_autocmd('FileType', {
group = vim.api.nvim_create_augroup('FileTypeConfigs', { clear = true }),
pattern = 'proto',
once = true,
callback = function()
vim.lsp.config('buf_ls', {
cmd = { 'buf', 'lsp', 'serve' },
filetypes = { 'proto' },
root_markers = { 'buf.yaml', '.git' },
})
vim.lsp.enable('buf_ls')
end,
})
vim.api.nvim_create_autocmd('FileType', {
group = vim.api.nvim_create_augroup('FileTypeConfigs', { clear = true }),
pattern = 'markdown',
once = true,
callback = function()
vim.lsp.enable('marksman')
end,
})
vim.api.nvim_create_autocmd('FileType', {
group = vim.api.nvim_create_augroup('FileTypeConfigs', { clear = true }),
pattern = 'sql',
once = true,
callback = function()
vim.lsp.enable('sqls')
end,
})
vim.api.nvim_create_autocmd('FileType', {
group = vim.api.nvim_create_augroup('FileTypeConfigs', { clear = true }),
pattern = { 'dockerfile', 'yaml.docker-compose' },
once = true,
callback = function()
vim.lsp.enable('dockerls')
vim.lsp.enable('docker_compose_language_service')
end,
})
vim.api.nvim_create_autocmd('FileType', {
group = vim.api.nvim_create_augroup('FileTypeConfigs', { clear = true }),
pattern = 'rust',
once = true,
callback = function()
vim.lsp.enable('rust_analyzer')
end,
})
vim.api.nvim_create_autocmd('FileType', {
group = vim.api.nvim_create_augroup('FileTypeConfigs', { clear = true }),
pattern = { 'c', 'cpp' },
once = true,
callback = function()
vim.lsp.enable('clangd')
end,
})
vim.api.nvim_create_autocmd('FileType', {
group = vim.api.nvim_create_augroup('FileTypeConfigs', { clear = true }),
pattern = { 'zig' },
pattern = 'sql',
once = true,
callback = function()
vim.lsp.enable('zls')
end,
})
vim.api.nvim_create_autocmd('FileType', {
group = vim.api.nvim_create_augroup('FileTypeConfigs', { clear = true }),
pattern = { 'yaml' },
pattern = 'sql',
once = true,
callback = function()
vim.lsp.enable('yamlls')
end,
})
vim.api.nvim_create_autocmd('FileType', {
group = vim.api.nvim_create_augroup('FileTypeConfigs', { clear = true }),
pattern = { 'cs' },
pattern = 'sql',
once = true,
callback = function()
vim.lsp.enable('omnisharp')
end,
})
-- vim.lsp.enable('ruff')
-- vim.lsp.config('ty')
vim.lsp.enable('ty')
vim.lsp.enable('gopls')
vim.lsp.enable('marksman')
vim.lsp.enable('rust_analyzer')
vim.lsp.enable('dockerls')
vim.lsp.enable('docker_compose_language_service')
vim.lsp.enable('clangd')
vim.lsp.enable('sqls')
vim.lsp.enable('zls')
vim.lsp.enable('omnisharp')
vim.lsp.enable('yamlls')
-- lspconfig.gopls.setup({ capabilities = capabilities })
-- lspconfig.marksman.setup({ capabilities = capabilities })
-- lspconfig.rust_analyzer.setup({
-- capabilities = capabilities,
-- settings = {
-- ["rust-analyzer"] = {
-- checkOnSave = {
-- command = "clippy",
-- },
-- },
-- },
-- })
-- lspconfig.dockerls.setup({ capabilities = capabilities })
-- lspconfig.docker_compose_language_service.setup({ capabilities = capabilities })
-- lspconfig.clangd.setup({ capabilities = capabilities })
-- lspconfig.sqls.setup({ capabilities = capabilities })
-- lspconfig.zls.setup({ capabilities = capabilities })
-- lspconfig.omnisharp.setup({ capabilities = capabilities })
-- lspconfig.yamlls.setup({ capabilities = capabilities })
require("conform").setup({ require("conform").setup({
go = {"gofmt"}, go = {"gofmt"},
python = {"black"}, python = {"black"},
rust = {"rustfmt"}, rust = {"rustfmt"},
format_on_save = {
timeout_ms = 500,
lsp_fallback = true,
},
}) })
-- end, -- end,
-- }) -- })

View File

@@ -4,14 +4,14 @@ vim.g.mapleader = " "
vim.keymap.set({'n', 'v'}, 'j', 'gj', {}) vim.keymap.set({'n', 'v'}, 'j', 'gj', {})
vim.keymap.set({'n', 'v'}, 'k', 'gk', {}) vim.keymap.set({'n', 'v'}, 'k', 'gk', {})
vim.keymap.set('n', '<C-M-h>', '<C-w>h', {}) -- vim.keymap.set('n', '<C-M-h>', '<C-w>h', {})
vim.keymap.set('n', '<C-M-j>', '<C-w>j', {}) -- vim.keymap.set('n', '<C-M-j>', '<C-w>j', {})
vim.keymap.set('n', '<C-M-k>', '<C-w>k', {}) -- vim.keymap.set('n', '<C-M-k>', '<C-w>k', {})
vim.keymap.set('n', '<C-M-l>', '<C-w>l', {}) -- vim.keymap.set('n', '<C-M-l>', '<C-w>l', {})
vim.keymap.set('t', '<C-M-h>', '<C-\\><C-n><C-w>h', {}) -- vim.keymap.set('t', '<C-M-h>', '<C-\\><C-n><C-w>h', {})
vim.keymap.set('t', '<C-M-j>', '<C-\\><C-n><C-w>j', {}) -- vim.keymap.set('t', '<C-M-j>', '<C-\\><C-n><C-w>j', {})
vim.keymap.set('t', '<C-M-k>', '<C-\\><C-n><C-w>k', {}) -- vim.keymap.set('t', '<C-M-k>', '<C-\\><C-n><C-w>k', {})
vim.keymap.set('t', '<C-M-l>', '<C-\\><C-n><C-w>l', {}) -- vim.keymap.set('t', '<C-M-l>', '<C-\\><C-n><C-w>l', {})
vim.keymap.set('n', '<leader>zm', '<C-W>_<C-W>|', { noremap = true, silent = true }) vim.keymap.set('n', '<leader>zm', '<C-W>_<C-W>|', { noremap = true, silent = true })
vim.keymap.set('n', '<C-M-Y>', '<C-w>5<', {}) vim.keymap.set('n', '<C-M-Y>', '<C-w>5<', {})
vim.keymap.set('n', '<C-M-U>', '<C-w>5+', {}) vim.keymap.set('n', '<C-M-U>', '<C-w>5+', {})
@@ -123,9 +123,48 @@ vim.keymap.set('n', "<leader>dr", function() require("dap").repl.toggle() end)
vim.keymap.set('n', "<leader>ds", function() require("dap").session() end) vim.keymap.set('n', "<leader>ds", function() require("dap").session() end)
vim.keymap.set('n', "<leader>dt", function() require("dap").terminate() end) vim.keymap.set('n', "<leader>dt", function() require("dap").terminate() end)
vim.keymap.set('n', "<leader>dw", function() require("dap.ui.widgets").hover() end) vim.keymap.set('n', "<leader>dw", function() require("dap.ui.widgets").hover() end)
vim.keymap.set('n', "<leader>dv", function() require("dap-view").toggle() end)
vim.keymap.set('n', "<F5>", function() require("dap").continue() end) vim.keymap.set('n', "<F5>", function() require("dap").continue() end)
vim.keymap.set('n', "<F11>", function() require("dap").step_into() end) vim.keymap.set('n', "<F2>", function() require("dap").step_into() end)
vim.keymap.set('n', "<F10>", function() require("dap").step_over() end) vim.keymap.set('n', "<F1>", function() require("dap").step_over() end)
vim.keymap.set('n', "<F12>", function() require("dap").step_out() end) vim.keymap.set('n', "<F3>", function() require("dap").step_out() end)
-- Tmux Navigator
vim.g.tmux_navigator_no_mappings = 1
local function tmux_navigate(direction)
local old_win = vim.api.nvim_get_current_win()
vim.cmd('wincmd ' .. direction)
local new_win = vim.api.nvim_get_current_win()
if old_win == new_win then
-- We are at the edge, let tmux handle it
-- This requires the tmux config to be set up to handle these keys when not in vim,
-- BUT since we are IN vim, we need to explicitly trigger the tmux action.
-- However, simply sending the key to tmux might just send it back to vim if we aren't careful,
-- or we can just run the tmux command directly.
local tmux_cmd = ""
if direction == 'h' then
tmux_cmd = 'if -F "#{pane_at_left}" "previous-window" "select-pane -L"'
elseif direction == 'j' then
tmux_cmd = 'if -F "#{pane_at_bottom}" "switch-client -n" "select-pane -D"'
elseif direction == 'k' then
tmux_cmd = 'if -F "#{pane_at_top}" "switch-client -p" "select-pane -U"'
elseif direction == 'l' then
tmux_cmd = 'if -F "#{pane_at_right}" "next-window" "select-pane -R"'
end
-- We use vim.fn.system to execute the tmux command
-- We need to wrap the command in 'tmux' call
vim.fn.system('tmux ' .. tmux_cmd)
end
end
vim.keymap.set('n', '<C-M-h>', function() tmux_navigate('h') end)
vim.keymap.set('n', '<C-M-j>', function() tmux_navigate('j') end)
vim.keymap.set('n', '<C-M-k>', function() tmux_navigate('k') end)
vim.keymap.set('n', '<C-M-l>', function() tmux_navigate('l') end)

View File

@@ -337,10 +337,10 @@ require('lint').linters_by_ft = {
require("trouble").setup() require("trouble").setup()
require("todo-comments").setup() require("todo-comments").setup()
require("dapui").setup() require("dap-view").setup()
require("nvim-dap-virtual-text").setup() require("nvim-dap-virtual-text").setup()
local dap, dapui = require("dap"), require("dapui") local dap, dapui = require("dap"), require("dap-view")
dap.listeners.before.attach.dapui_config = function() dap.listeners.before.attach.dapui_config = function()
dapui.open() dapui.open()
end end
@@ -363,21 +363,21 @@ dap.adapters.codelldb = {
} }
} }
dap.configurations.zig = { -- dap.configurations.zig = {
{ -- {
name = "Launch Zig Program", -- name = "Launch Zig Program",
type = "codelldb", -- type = "codelldb",
request = "launch", -- request = "launch",
program = function() -- program = function()
-- Prompts for the executable path when you start debugging -- -- Prompts for the executable path when you start debugging
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/zig-out/bin/', 'file') -- return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/zig-out/bin/', 'file')
end, -- end,
cwd = "${workspaceFolder}", -- cwd = "${workspaceFolder}",
stopOnEntry = false, -- stopOnEntry = false,
}, -- },
} -- }
if _G.is_home then if _G.is_mac then
workspaces = { workspaces = {
{ {
name = "privat", name = "privat",
@@ -410,6 +410,16 @@ if _G.is_work then
daily_notes = {} daily_notes = {}
end end
if _G.is_private_nixos then
workspaces = {
{
name = "tech",
path = "~/notes",
},
}
daily_notes = {}
end
require("obsidian").setup({ require("obsidian").setup({
workspaces = workspaces, workspaces = workspaces,
templates = { templates = {