mirror of
https://github.com/softinio/nix-config.git
synced 2025-10-18 11:06:41 -07:00
Compare commits
13 commits
f98fe01b0c
...
10ff286bc1
Author | SHA1 | Date | |
---|---|---|---|
![]() |
10ff286bc1 | ||
241a8ed039 | |||
61759f618a | |||
16ec312f86 | |||
b4a848af40 | |||
a73c53f5c9 | |||
43b2c9efb9 | |||
82aa68744f | |||
6b37f9ec83 | |||
13ada6b7bd | |||
8c247f2ca0 | |||
10e3123b7f | |||
7584b9ebfc |
33 changed files with 584 additions and 339 deletions
24
flake.lock
generated
24
flake.lock
generated
|
@ -67,11 +67,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1759536080,
|
"lastModified": 1759702766,
|
||||||
"narHash": "sha256-0aXlKPxm2M+F5oywX2TTbY0e6h+tQ+6OYyx7UZn3A4A=",
|
"narHash": "sha256-011pCUbIq/fhCiZ20AzqJYNjLzQ1oYkzYEgzcUYVTBg=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "home-manager",
|
"repo": "home-manager",
|
||||||
"rev": "edafd6da1936426708f1be0b1a4288007f16639a",
|
"rev": "5b45dcf4790bb94fec7e550d2915fc2540a3cdd6",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -130,11 +130,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1759417375,
|
"lastModified": 1759632233,
|
||||||
"narHash": "sha256-O7eHcgkQXJNygY6AypkF9tFhsoDQjpNEojw3eFs73Ow=",
|
"narHash": "sha256-krgZxGAIIIKFJS+UB0l8do3sYUDWJc75M72tepmVMzE=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "dc704e6102e76aad573f63b74c742cd96f8f1e6c",
|
"rev": "d7f52a7a640bc54c7bb414cca603835bf8dd4b10",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -170,11 +170,11 @@
|
||||||
"systems": "systems_2"
|
"systems": "systems_2"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1759527752,
|
"lastModified": 1759670959,
|
||||||
"narHash": "sha256-+sncyvy1dkwRBeq7vw/YpsKqB18UuaKuW2lKRRv6/EI=",
|
"narHash": "sha256-OjvEGJEZDkAri6m1oUV0DE+pRKqh6KEcVuCIlmLN7QU=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "nixvim",
|
"repo": "nixvim",
|
||||||
"rev": "42d87fd4d8f51ea8c591b0b72af76b0aba991f54",
|
"rev": "e45e9214dcc2ea770418fe407a43902b0438ce78",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -189,11 +189,11 @@
|
||||||
"nixpkgs": "nixpkgs_2"
|
"nixpkgs": "nixpkgs_2"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1759527694,
|
"lastModified": 1759696599,
|
||||||
"narHash": "sha256-fuQw+vP25GSQxPKTPAHZBUXuoFeN9dCTwfJxEv5sv0Y=",
|
"narHash": "sha256-GkGJdNkR9gnVQt9OXwhGrD72EpK185jNVT7qoCh/3q4=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "nur",
|
"repo": "nur",
|
||||||
"rev": "b2b1349ad22d5ba62a3e069e9a3745f40fbb9203",
|
"rev": "dce08ba6904fcaad93c17ab65cf6b3e5dfc2d301",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
2
home.nix
2
home.nix
|
@ -73,7 +73,7 @@
|
||||||
nix-index
|
nix-index
|
||||||
nixfmt-rfc-style
|
nixfmt-rfc-style
|
||||||
nix-prefetch-git
|
nix-prefetch-git
|
||||||
nodejs
|
nodejs-slim
|
||||||
noto-fonts
|
noto-fonts
|
||||||
noto-fonts-color-emoji
|
noto-fonts-color-emoji
|
||||||
ollama
|
ollama
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
# Main model:
|
# Main model:
|
||||||
|
|
||||||
## Specify the model to use for the main chat
|
## Specify the model to use for the main chat
|
||||||
model: anthropic/claude-sonnet-4-20250514
|
model: anthropic/claude-sonnet-4-5-20250929
|
||||||
|
|
||||||
########################
|
########################
|
||||||
# API Keys and settings:
|
# API Keys and settings:
|
||||||
|
|
|
@ -7,7 +7,6 @@
|
||||||
./jujutsu
|
./jujutsu
|
||||||
./nixvim
|
./nixvim
|
||||||
./tmux
|
./tmux
|
||||||
./wezterm
|
|
||||||
./vscode
|
./vscode
|
||||||
./zed
|
./zed
|
||||||
]
|
]
|
||||||
|
|
|
@ -54,7 +54,6 @@
|
||||||
|
|
||||||
set -xg TOOLCHAINS swift
|
set -xg TOOLCHAINS swift
|
||||||
|
|
||||||
set -xg DEVELOPER_DIR "/Library/Developer/CommandLineTools"
|
|
||||||
set -xg OPENAI_API_KEY (cat ~/.openai)
|
set -xg OPENAI_API_KEY (cat ~/.openai)
|
||||||
set -xg ANTHROPIC_API_KEY (cat ~/.anthropic)
|
set -xg ANTHROPIC_API_KEY (cat ~/.anthropic)
|
||||||
'';
|
'';
|
||||||
|
@ -80,12 +79,9 @@
|
||||||
ghauth = "gh auth login --with-token < ~/.ghauth";
|
ghauth = "gh auth login --with-token < ~/.ghauth";
|
||||||
gitpurgemain = ''git branch --merged | grep -v "\*" | grep -v "main" | xargs -n 1 git branch -d'';
|
gitpurgemain = ''git branch --merged | grep -v "\*" | grep -v "main" | xargs -n 1 git branch -d'';
|
||||||
gitpurgemaster = ''git branch --merged | grep -v "\*" | grep -v "master" | xargs -n 1 git branch -d'';
|
gitpurgemaster = ''git branch --merged | grep -v "\*" | grep -v "master" | xargs -n 1 git branch -d'';
|
||||||
giscala = "gitignore scala,vim,java,sbt > .gitignore";
|
|
||||||
gforksync = "git fetch upstream && git merge upstream/master && git push origin master";
|
gforksync = "git fetch upstream && git merge upstream/master && git push origin master";
|
||||||
grep = "grep --color=auto";
|
grep = "grep --color=auto";
|
||||||
hg = "kitten hyperlinked-grep";
|
|
||||||
lg = "lazygit";
|
lg = "lazygit";
|
||||||
new-sbt = "sbt new scala/scala-seed.g8";
|
|
||||||
nixc = "cd ~/.config/nixpkgs";
|
nixc = "cd ~/.config/nixpkgs";
|
||||||
nixre = "nix build && sudo ./result/activate";
|
nixre = "nix build && sudo ./result/activate";
|
||||||
nixinfo = "nix-shell -p nix-info --run \"nix-info -m\"";
|
nixinfo = "nix-shell -p nix-info --run \"nix-info -m\"";
|
||||||
|
@ -93,7 +89,6 @@
|
||||||
nixq = "nix-env -qa";
|
nixq = "nix-env -qa";
|
||||||
nixstorerepair = "nix-store --repair --verify --check-contents";
|
nixstorerepair = "nix-store --repair --verify --check-contents";
|
||||||
nixupgrade = "nix upgrade-nix";
|
nixupgrade = "nix upgrade-nix";
|
||||||
o = "echo (ollama run qwen2.5-coder \"Provide only the MacOS terminal command (without markdown) to: $argv\")";
|
|
||||||
rmxcodederived = "rm -fr ~/Library/Developer/Xcode/DerivedData";
|
rmxcodederived = "rm -fr ~/Library/Developer/Xcode/DerivedData";
|
||||||
v = "nvim";
|
v = "nvim";
|
||||||
sshhcloud1 = "ssh salar@hcloud1.softinio.net";
|
sshhcloud1 = "ssh salar@hcloud1.softinio.net";
|
||||||
|
|
|
@ -34,6 +34,7 @@ let
|
||||||
pull = {
|
pull = {
|
||||||
rebase = true;
|
rebase = true;
|
||||||
};
|
};
|
||||||
|
# Commented out as xcode had issues with it.
|
||||||
# url = {
|
# url = {
|
||||||
# "git@github.com:" = {
|
# "git@github.com:" = {
|
||||||
# insteadOf = "https://github.com/";
|
# insteadOf = "https://github.com/";
|
||||||
|
@ -62,8 +63,8 @@ let
|
||||||
"*.metals"
|
"*.metals"
|
||||||
"*.metals.sbt"
|
"*.metals.sbt"
|
||||||
"*metals.sbt"
|
"*metals.sbt"
|
||||||
"*.envrc" # there is lorri, nix-direnv & simple direnv; let people decide
|
"*.envrc"
|
||||||
"*hie.yaml" # ghcide files
|
"*hie.yaml"
|
||||||
"*.vscode"
|
"*.vscode"
|
||||||
"result"
|
"result"
|
||||||
];
|
];
|
||||||
|
|
|
@ -4,7 +4,16 @@ let
|
||||||
l = [
|
l = [
|
||||||
"log"
|
"log"
|
||||||
"-r"
|
"-r"
|
||||||
"(main@origin..@):: | (main@origin..@)-"
|
"ancestors(reachable(@, mutable()), 2)"
|
||||||
|
];
|
||||||
|
n = [ "new" ];
|
||||||
|
tug = [
|
||||||
|
"bookmark"
|
||||||
|
"move"
|
||||||
|
"--from"
|
||||||
|
"closest_bookmark(@-)"
|
||||||
|
"--to"
|
||||||
|
"@-"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
|
@ -13,11 +22,18 @@ in
|
||||||
enable = true;
|
enable = true;
|
||||||
settings = {
|
settings = {
|
||||||
aliases = MyAliases;
|
aliases = MyAliases;
|
||||||
|
gerrit.enabled = false;
|
||||||
|
git = {
|
||||||
|
subprocess = true;
|
||||||
|
};
|
||||||
signing = {
|
signing = {
|
||||||
key = "~/.ssh/id_ed25519.pub";
|
key = "~/.ssh/id_ed25519.pub";
|
||||||
};
|
};
|
||||||
|
templates = {
|
||||||
|
git_push_bookmark = "\"softinio/push-\" ++ change_id.short()";
|
||||||
|
};
|
||||||
ui = {
|
ui = {
|
||||||
default-command = "log";
|
default-command = "l";
|
||||||
diff-formatter = [
|
diff-formatter = [
|
||||||
"difft"
|
"difft"
|
||||||
"--color=always"
|
"--color=always"
|
||||||
|
|
163
programs/nixvim/README.md
Normal file
163
programs/nixvim/README.md
Normal file
|
@ -0,0 +1,163 @@
|
||||||
|
# Nixvim Configuration
|
||||||
|
|
||||||
|
This directory contains a modular Neovim configuration managed through [nixvim](https://github.com/nix-community/nixvim).
|
||||||
|
|
||||||
|
## Directory Structure
|
||||||
|
|
||||||
|
```
|
||||||
|
nixvim/
|
||||||
|
├── default.nix # Main entry point
|
||||||
|
├── options.nix # Core Neovim options (line numbers, tabs, etc.)
|
||||||
|
├── keymappings.nix # Global key mappings
|
||||||
|
├── autocommands.nix # Auto commands for various events
|
||||||
|
├── completion.nix # Completion configuration (nvim-cmp)
|
||||||
|
└── plugins/ # Plugin configurations
|
||||||
|
├── default.nix # Plugin imports
|
||||||
|
├── ui.nix # UI enhancements (colorscheme, icons, etc.)
|
||||||
|
├── git.nix # Git integration
|
||||||
|
├── editing.nix # Editing enhancements
|
||||||
|
├── utility.nix # Utility plugins
|
||||||
|
├── ai.nix # AI assistants (Copilot, Avante)
|
||||||
|
├── lsp/ # Language Server Protocol
|
||||||
|
│ ├── default.nix # LSP imports
|
||||||
|
│ ├── servers.nix # Language server configurations
|
||||||
|
│ ├── keymaps.nix # LSP-specific key mappings
|
||||||
|
│ └── formatting.nix # Auto-formatting settings
|
||||||
|
├── avante.nix # Avante AI configuration
|
||||||
|
├── conform.nix # Code formatting
|
||||||
|
├── floaterm.nix # Floating terminal
|
||||||
|
├── lualine.nix # Status line
|
||||||
|
├── neo-tree.nix # File explorer
|
||||||
|
├── telescope.nix # Fuzzy finder
|
||||||
|
└── treesitter.nix # Syntax highlighting
|
||||||
|
```
|
||||||
|
|
||||||
|
## Configuration Categories
|
||||||
|
|
||||||
|
### Core Settings (`options.nix`)
|
||||||
|
- Editor options (line numbers, indentation, etc.)
|
||||||
|
- Update time and performance settings
|
||||||
|
- Clipboard configuration
|
||||||
|
- Leader key mappings
|
||||||
|
|
||||||
|
### Key Mappings (`keymappings.nix`)
|
||||||
|
- Window navigation
|
||||||
|
- Buffer management
|
||||||
|
- Text manipulation
|
||||||
|
- Custom shortcuts
|
||||||
|
|
||||||
|
### Auto Commands (`autocommands.nix`)
|
||||||
|
- FileType-specific settings
|
||||||
|
- Auto-formatting rules
|
||||||
|
- UI behavior modifications
|
||||||
|
|
||||||
|
### Completion (`completion.nix`)
|
||||||
|
- nvim-cmp configuration
|
||||||
|
- Snippet support
|
||||||
|
- LSP integration
|
||||||
|
- Multiple completion sources
|
||||||
|
|
||||||
|
### Plugins
|
||||||
|
|
||||||
|
#### UI Enhancements (`ui.nix`)
|
||||||
|
- **Colorscheme**: Tokyo Night theme with custom background
|
||||||
|
- **Icons**: File type icons via web-devicons
|
||||||
|
- **Visual aids**: Indent guides, color highlighting, markdown preview
|
||||||
|
|
||||||
|
#### Git Integration (`git.nix`)
|
||||||
|
- **Gitsigns**: Shows git changes in the gutter
|
||||||
|
|
||||||
|
#### Editing (`editing.nix`)
|
||||||
|
- **Auto-pairs**: Automatic bracket/quote closing
|
||||||
|
- **Flash**: Enhanced jump/search
|
||||||
|
- **Trim**: Whitespace management
|
||||||
|
- **Image support**: Clipboard image pasting
|
||||||
|
|
||||||
|
#### Utilities (`utility.nix`)
|
||||||
|
- **Oil**: File manager
|
||||||
|
- **Todo-comments**: Highlight TODO/FIXME comments
|
||||||
|
- **Trouble**: Diagnostics list
|
||||||
|
- **Which-key**: Show available keybindings
|
||||||
|
|
||||||
|
#### AI Assistants (`ai.nix`)
|
||||||
|
- **Copilot**: GitHub Copilot integration
|
||||||
|
- **Avante**: Advanced AI assistant
|
||||||
|
|
||||||
|
#### LSP (`lsp/`)
|
||||||
|
- **Language Servers**: Support for 15+ languages
|
||||||
|
- **Key mappings**: Go-to-definition, references, hover docs
|
||||||
|
- **Auto-formatting**: Format on save for all supported languages
|
||||||
|
|
||||||
|
## Adding New Configurations
|
||||||
|
|
||||||
|
### Adding a New Plugin
|
||||||
|
|
||||||
|
1. Create a new file in `plugins/` or add to an existing category file
|
||||||
|
2. Add the import to `plugins/default.nix`
|
||||||
|
3. Configure the plugin following nixvim documentation
|
||||||
|
|
||||||
|
Example:
|
||||||
|
```nix
|
||||||
|
# plugins/my-plugin.nix
|
||||||
|
{ ... }:
|
||||||
|
{
|
||||||
|
programs.nixvim.plugins.my-plugin = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
# Plugin-specific settings
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Adding a New Language Server
|
||||||
|
|
||||||
|
Edit `plugins/lsp/servers.nix` and add your server configuration:
|
||||||
|
```nix
|
||||||
|
my_language_ls = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
# Server-specific settings
|
||||||
|
};
|
||||||
|
};
|
||||||
|
```
|
||||||
|
|
||||||
|
### Adding Key Mappings
|
||||||
|
|
||||||
|
- **Global mappings**: Add to `keymappings.nix`
|
||||||
|
- **LSP mappings**: Add to `plugins/lsp/keymaps.nix`
|
||||||
|
- **Plugin-specific**: Add to the plugin's configuration file
|
||||||
|
|
||||||
|
## Applying Changes
|
||||||
|
|
||||||
|
After making changes, rebuild your nix configuration:
|
||||||
|
```bash
|
||||||
|
nixre # Alias for darwin-rebuild switch --flake ~/.config/nixpkgs#salarm3max
|
||||||
|
```
|
||||||
|
|
||||||
|
## Performance Tuning
|
||||||
|
|
||||||
|
Key performance settings:
|
||||||
|
- `updatetime`: Controls LSP/diagnostic update speed (currently 100ms)
|
||||||
|
- `performance.debounce`: Completion debounce time (60ms)
|
||||||
|
- `performance.throttle`: Completion throttle time (30ms)
|
||||||
|
|
||||||
|
Adjust these in `options.nix` and `completion.nix` respectively.
|
||||||
|
|
||||||
|
## Troubleshooting
|
||||||
|
|
||||||
|
### LSP Not Working
|
||||||
|
1. Check if language server is installed: `:LspInfo`
|
||||||
|
2. Verify keymaps are loaded: `:map gd`
|
||||||
|
3. Check for errors: `:messages`
|
||||||
|
|
||||||
|
### Slow Performance
|
||||||
|
1. Increase `updatetime` in `options.nix`
|
||||||
|
2. Adjust completion performance settings in `completion.nix`
|
||||||
|
3. Disable unused language servers in `lsp/servers.nix`
|
||||||
|
|
||||||
|
## Resources
|
||||||
|
|
||||||
|
- [Nixvim Documentation](https://nix-community.github.io/nixvim/)
|
||||||
|
- [Neovim Documentation](https://neovim.io/doc/)
|
||||||
|
- [LSP Specification](https://microsoft.github.io/language-server-protocol/)
|
|
@ -1,105 +0,0 @@
|
||||||
{ ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
imports = [
|
|
||||||
./avante.nix
|
|
||||||
./conform.nix
|
|
||||||
./floaterm.nix
|
|
||||||
./lsp.nix
|
|
||||||
./lualine.nix
|
|
||||||
./neo-tree.nix
|
|
||||||
./telescope.nix
|
|
||||||
./treesitter.nix
|
|
||||||
];
|
|
||||||
|
|
||||||
# Global plugin configurations can go here
|
|
||||||
programs.nixvim = {
|
|
||||||
colorschemes.tokyonight = {
|
|
||||||
enable = true;
|
|
||||||
settings = {
|
|
||||||
style = "night";
|
|
||||||
on_colors.__raw = "function(colors) colors.bg = \"#000000\" end";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
plugins = {
|
|
||||||
# Lazy loading
|
|
||||||
lz-n.enable = true;
|
|
||||||
|
|
||||||
web-devicons.enable = true;
|
|
||||||
|
|
||||||
gitsigns = {
|
|
||||||
enable = true;
|
|
||||||
settings.signs = {
|
|
||||||
add.text = "+";
|
|
||||||
change.text = "~";
|
|
||||||
delete.text = "_";
|
|
||||||
topdelete.text = "‾";
|
|
||||||
changedelete.text = "~";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
nvim-autopairs.enable = true;
|
|
||||||
|
|
||||||
colorizer = {
|
|
||||||
enable = true;
|
|
||||||
settings.user_default_options.names = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
copilot-vim.enable = true;
|
|
||||||
|
|
||||||
fidget.enable = true;
|
|
||||||
|
|
||||||
flash.enable = true;
|
|
||||||
|
|
||||||
img-clip = {
|
|
||||||
enable = true;
|
|
||||||
settings = {
|
|
||||||
default = {
|
|
||||||
embed_image_as_base64 = false;
|
|
||||||
prompt_for_file_name = false;
|
|
||||||
drag_and_drop = {
|
|
||||||
insert_mode = true;
|
|
||||||
};
|
|
||||||
use_absolute_path = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
indent-blankline.enable = true;
|
|
||||||
|
|
||||||
markview.enable = true;
|
|
||||||
|
|
||||||
nui.enable = true;
|
|
||||||
|
|
||||||
oil = {
|
|
||||||
enable = true;
|
|
||||||
lazyLoad.settings.cmd = "Oil";
|
|
||||||
};
|
|
||||||
|
|
||||||
snacks.enable = true;
|
|
||||||
|
|
||||||
todo-comments = {
|
|
||||||
enable = true;
|
|
||||||
keymaps.todoTelescope.key = "<leader>t";
|
|
||||||
};
|
|
||||||
|
|
||||||
trim = {
|
|
||||||
enable = true;
|
|
||||||
settings = {
|
|
||||||
highlight = true;
|
|
||||||
ft_blocklist = [
|
|
||||||
"checkhealth"
|
|
||||||
"floaterm"
|
|
||||||
"lspinfo"
|
|
||||||
"neo-tree"
|
|
||||||
"TelescopePrompt"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
trouble.enable = true;
|
|
||||||
which-key.enable = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,61 +0,0 @@
|
||||||
{ lib, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
programs.nixvim = {
|
|
||||||
diagnostic.settings.virtual_text = true;
|
|
||||||
|
|
||||||
lsp = {
|
|
||||||
inlayHints.enable = true;
|
|
||||||
servers = {
|
|
||||||
bashls.enable = true;
|
|
||||||
html.enable = true;
|
|
||||||
jqls.enable = true;
|
|
||||||
jsonls.enable = true;
|
|
||||||
lua_ls = {
|
|
||||||
enable = true;
|
|
||||||
settings.settings.diagnostics.globals = [ "vim" ];
|
|
||||||
};
|
|
||||||
marksman.enable = true;
|
|
||||||
metals.enable = true;
|
|
||||||
nil_ls.enable = true;
|
|
||||||
nixd.enable = true;
|
|
||||||
pyrefly.enable = true;
|
|
||||||
rust_analyzer.enable = true;
|
|
||||||
sourcekit.enable = true;
|
|
||||||
ts_ls.enable = true;
|
|
||||||
yamlls.enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
keymaps =
|
|
||||||
lib.mapAttrsToList
|
|
||||||
(
|
|
||||||
key: props:
|
|
||||||
{
|
|
||||||
inherit key;
|
|
||||||
options.silent = true;
|
|
||||||
}
|
|
||||||
// props
|
|
||||||
)
|
|
||||||
{
|
|
||||||
"<leader>k".action.__raw = "function() vim.diagnostic.jump({ count=-1, float=true }) end";
|
|
||||||
"<leader>j".action.__raw = "function() vim.diagnostic.jump({ count=1, float=true }) end";
|
|
||||||
gd.lspBufAction = "definition";
|
|
||||||
gD.lspBufAction = "references";
|
|
||||||
gt.lspBufAction = "type_definition";
|
|
||||||
gi.lspBufAction = "implementation";
|
|
||||||
K.lspBufAction = "hover";
|
|
||||||
"<F2>".lspBufAction = "rename";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
plugins = {
|
|
||||||
lsp-format = {
|
|
||||||
enable = true;
|
|
||||||
lspServersToEnable = "all";
|
|
||||||
};
|
|
||||||
|
|
||||||
# Sane defaults for all servers
|
|
||||||
lspconfig.enable = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
34
programs/nixvim/autocommands.nix
Normal file
34
programs/nixvim/autocommands.nix
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
{ ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
programs.nixvim.autoCmd = [
|
||||||
|
# Vertically center document when entering insert mode
|
||||||
|
{
|
||||||
|
event = "InsertEnter";
|
||||||
|
command = "norm zz";
|
||||||
|
}
|
||||||
|
|
||||||
|
# Open help in a vertical split
|
||||||
|
{
|
||||||
|
event = "FileType";
|
||||||
|
pattern = "help";
|
||||||
|
command = "wincmd L";
|
||||||
|
}
|
||||||
|
|
||||||
|
# Enable spellcheck for some filetypes
|
||||||
|
{
|
||||||
|
event = "FileType";
|
||||||
|
pattern = [
|
||||||
|
"markdown"
|
||||||
|
];
|
||||||
|
command = "setlocal spell spelllang=en";
|
||||||
|
}
|
||||||
|
|
||||||
|
# Set indentation for specific filetypes
|
||||||
|
{
|
||||||
|
event = "FileType";
|
||||||
|
pattern = ["swift" "json" "lua" "nix"];
|
||||||
|
command = "setlocal shiftwidth=2 tabstop=2 softtabstop=2 expandtab";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
|
@ -11,6 +11,17 @@
|
||||||
plugins = {
|
plugins = {
|
||||||
luasnip.enable = true;
|
luasnip.enable = true;
|
||||||
|
|
||||||
|
cmp-buffer.enable = true;
|
||||||
|
cmp-cmdline.enable = true;
|
||||||
|
cmp-fish.enable = true;
|
||||||
|
cmp-git.enable = true;
|
||||||
|
cmp_luasnip.enable = true;
|
||||||
|
cmp-nvim-lsp.enable = true;
|
||||||
|
cmp-nvim-lsp-document-symbol.enable = true;
|
||||||
|
cmp-nvim-lsp-signature-help.enable = true;
|
||||||
|
cmp-nvim-lua.enable = true;
|
||||||
|
cmp-path.enable = true;
|
||||||
|
|
||||||
lspkind = {
|
lspkind = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
|
@ -19,11 +30,11 @@
|
||||||
enable = true;
|
enable = true;
|
||||||
menu = {
|
menu = {
|
||||||
nvim_lsp = "[LSP]";
|
nvim_lsp = "[LSP]";
|
||||||
nvim_lua = "[api]";
|
copilot-vim = "[copilot]";
|
||||||
path = "[path]";
|
|
||||||
luasnip = "[snip]";
|
luasnip = "[snip]";
|
||||||
buffer = "[buffer]";
|
buffer = "[buffer]";
|
||||||
cmp_tabby = "[Tabby]";
|
path = "[path]";
|
||||||
|
nvim_lua = "[api]";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -31,8 +42,14 @@
|
||||||
|
|
||||||
cmp = {
|
cmp = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
autoEnableSources = true;
|
||||||
settings = {
|
settings = {
|
||||||
|
performance = {
|
||||||
|
debounce = 60;
|
||||||
|
throttle = 30;
|
||||||
|
fetching_timeout = 200;
|
||||||
|
};
|
||||||
|
|
||||||
snippet.expand = ''
|
snippet.expand = ''
|
||||||
function(args)
|
function(args)
|
||||||
require('luasnip').lsp_expand(args.body)
|
require('luasnip').lsp_expand(args.body)
|
||||||
|
@ -50,13 +67,16 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
sources = [
|
sources = [
|
||||||
{ name = "path"; }
|
|
||||||
{ name = "nvim_lsp"; }
|
{ name = "nvim_lsp"; }
|
||||||
|
{ name = "copilot-vim"; }
|
||||||
{ name = "luasnip"; }
|
{ name = "luasnip"; }
|
||||||
{
|
{
|
||||||
name = "buffer";
|
name = "buffer";
|
||||||
option.get_bufnrs.__raw = "vim.api.nvim_list_bufs";
|
option.get_bufnrs.__raw = "vim.api.nvim_list_bufs";
|
||||||
}
|
}
|
||||||
|
{ name = "path"; }
|
||||||
|
{ name = "nvim_lua"; }
|
||||||
|
{ name = "cmp-nvim-lsp-signature-help"; }
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,11 +1,12 @@
|
||||||
{ pkgs, ... }:
|
{ ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./options.nix
|
./autocommands.nix
|
||||||
./keymappings.nix
|
|
||||||
./completion.nix
|
./completion.nix
|
||||||
./_plugins
|
./keymappings.nix
|
||||||
|
./options.nix
|
||||||
|
./plugins
|
||||||
];
|
];
|
||||||
|
|
||||||
programs.nixvim = {
|
programs.nixvim = {
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
tabstop = 2;
|
tabstop = 2;
|
||||||
termguicolors = true;
|
termguicolors = true;
|
||||||
undofile = true;
|
undofile = true;
|
||||||
updatetime = 250;
|
updatetime = 100;
|
||||||
wrap = false;
|
wrap = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
17
programs/nixvim/plugins/ai.nix
Normal file
17
programs/nixvim/plugins/ai.nix
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
{ pkgs, lib, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
programs.nixvim = {
|
||||||
|
plugins = {
|
||||||
|
# GitHub Copilot
|
||||||
|
copilot-vim.enable = true;
|
||||||
|
|
||||||
|
# Avante AI assistant (imported from separate file)
|
||||||
|
# avante config is in avante.nix
|
||||||
|
};
|
||||||
|
|
||||||
|
globals = {
|
||||||
|
copilot_node_command = lib.mkForce "${pkgs.nodejs-slim}/bin/node";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
24
programs/nixvim/plugins/default.nix
Normal file
24
programs/nixvim/plugins/default.nix
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
{ ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
# Core plugin categories
|
||||||
|
./ui.nix
|
||||||
|
./git.nix
|
||||||
|
./editing.nix
|
||||||
|
./utility.nix
|
||||||
|
./ai.nix
|
||||||
|
|
||||||
|
# LSP configuration
|
||||||
|
./lsp
|
||||||
|
|
||||||
|
# Individual plugin configurations
|
||||||
|
./avante.nix
|
||||||
|
./conform.nix
|
||||||
|
./floaterm.nix
|
||||||
|
./lualine.nix
|
||||||
|
./neo-tree.nix
|
||||||
|
./telescope.nix
|
||||||
|
./treesitter.nix
|
||||||
|
];
|
||||||
|
}
|
44
programs/nixvim/plugins/editing.nix
Normal file
44
programs/nixvim/plugins/editing.nix
Normal file
|
@ -0,0 +1,44 @@
|
||||||
|
{ ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
programs.nixvim.plugins = {
|
||||||
|
# Auto-close brackets and quotes
|
||||||
|
nvim-autopairs.enable = true;
|
||||||
|
|
||||||
|
# Flash jump/search enhancement
|
||||||
|
flash.enable = true;
|
||||||
|
|
||||||
|
# Image clipboard support
|
||||||
|
img-clip = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
default = {
|
||||||
|
embed_image_as_base64 = false;
|
||||||
|
prompt_for_file_name = false;
|
||||||
|
drag_and_drop = {
|
||||||
|
insert_mode = true;
|
||||||
|
};
|
||||||
|
use_absolute_path = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# Trim trailing whitespace
|
||||||
|
trim = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
highlight = true;
|
||||||
|
ft_blocklist = [
|
||||||
|
"checkhealth"
|
||||||
|
"floaterm"
|
||||||
|
"lspinfo"
|
||||||
|
"neo-tree"
|
||||||
|
"TelescopePrompt"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# Collection of small useful plugins
|
||||||
|
snacks.enable = true;
|
||||||
|
};
|
||||||
|
}
|
17
programs/nixvim/plugins/git.nix
Normal file
17
programs/nixvim/plugins/git.nix
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
{ ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
programs.nixvim.plugins = {
|
||||||
|
# Git signs in the gutter
|
||||||
|
gitsigns = {
|
||||||
|
enable = true;
|
||||||
|
settings.signs = {
|
||||||
|
add.text = "+";
|
||||||
|
change.text = "~";
|
||||||
|
delete.text = "_";
|
||||||
|
topdelete.text = "‾";
|
||||||
|
changedelete.text = "~";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
9
programs/nixvim/plugins/lsp/default.nix
Normal file
9
programs/nixvim/plugins/lsp/default.nix
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
{ ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./servers.nix
|
||||||
|
./keymaps.nix
|
||||||
|
./formatting.nix
|
||||||
|
];
|
||||||
|
}
|
19
programs/nixvim/plugins/lsp/formatting.nix
Normal file
19
programs/nixvim/plugins/lsp/formatting.nix
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
{ ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
programs.nixvim = {
|
||||||
|
# Diagnostics display
|
||||||
|
diagnostic.settings.virtual_text = true;
|
||||||
|
|
||||||
|
plugins = {
|
||||||
|
# Auto-format on save
|
||||||
|
lsp-format = {
|
||||||
|
enable = true;
|
||||||
|
lspServersToEnable = "all";
|
||||||
|
};
|
||||||
|
|
||||||
|
# Sane defaults for all servers
|
||||||
|
lspconfig.enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
43
programs/nixvim/plugins/lsp/keymaps.nix
Normal file
43
programs/nixvim/plugins/lsp/keymaps.nix
Normal file
|
@ -0,0 +1,43 @@
|
||||||
|
{ ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
programs.nixvim.lsp.keymaps = [
|
||||||
|
# Diagnostics navigation
|
||||||
|
{
|
||||||
|
key = "<leader>k";
|
||||||
|
action.__raw = "function() vim.diagnostic.jump({ count=-1, float=true }) end";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
key = "<leader>j";
|
||||||
|
action.__raw = "function() vim.diagnostic.jump({ count=1, float=true }) end";
|
||||||
|
}
|
||||||
|
|
||||||
|
# LSP navigation
|
||||||
|
{
|
||||||
|
key = "gd";
|
||||||
|
lspBufAction = "definition";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
key = "gD";
|
||||||
|
lspBufAction = "references";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
key = "gt";
|
||||||
|
lspBufAction = "type_definition";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
key = "gi";
|
||||||
|
lspBufAction = "implementation";
|
||||||
|
}
|
||||||
|
|
||||||
|
# Documentation and refactoring
|
||||||
|
{
|
||||||
|
key = "K";
|
||||||
|
lspBufAction = "hover";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
key = "<F2>";
|
||||||
|
lspBufAction = "rename";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
79
programs/nixvim/plugins/lsp/servers.nix
Normal file
79
programs/nixvim/plugins/lsp/servers.nix
Normal file
|
@ -0,0 +1,79 @@
|
||||||
|
{ ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
programs.nixvim.lsp = {
|
||||||
|
inlayHints.enable = true;
|
||||||
|
|
||||||
|
servers = {
|
||||||
|
# Python
|
||||||
|
basedpyright = {
|
||||||
|
enable = true;
|
||||||
|
settings.settings.basedpyright = {
|
||||||
|
analysis = {
|
||||||
|
autoImportCompletions = true;
|
||||||
|
autoSearchPaths = true;
|
||||||
|
inlayHints = {
|
||||||
|
callArgumentNames = true;
|
||||||
|
};
|
||||||
|
diagnosticMode = "openFilesOnly";
|
||||||
|
reportMissingImports = true;
|
||||||
|
reportMissingParameterType = true;
|
||||||
|
reportUnnecessaryComparison = true;
|
||||||
|
reportUnnecessaryContains = true;
|
||||||
|
reportUnusedClass = true;
|
||||||
|
reportUnusedFunction = true;
|
||||||
|
reportUnsedImports = true;
|
||||||
|
reportUnsusedVariables = true;
|
||||||
|
typeCheckingMode = "recommended";
|
||||||
|
useLibraryCodeForTypes = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# Shell scripting
|
||||||
|
bashls.enable = true;
|
||||||
|
|
||||||
|
# Web development
|
||||||
|
html.enable = true;
|
||||||
|
jsonls.enable = true;
|
||||||
|
yamlls.enable = true;
|
||||||
|
ts_ls.enable = true;
|
||||||
|
|
||||||
|
# Query languages
|
||||||
|
jqls.enable = true;
|
||||||
|
|
||||||
|
# Lua
|
||||||
|
lua_ls = {
|
||||||
|
enable = true;
|
||||||
|
settings.settings.diagnostics.globals = [ "vim" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
# Documentation
|
||||||
|
marksman.enable = true;
|
||||||
|
|
||||||
|
# Scala
|
||||||
|
metals.enable = true;
|
||||||
|
|
||||||
|
# Nix
|
||||||
|
nil_ls.enable = true;
|
||||||
|
nixd.enable = true;
|
||||||
|
|
||||||
|
# Rust
|
||||||
|
rust_analyzer.enable = true;
|
||||||
|
|
||||||
|
# Swift/iOS development
|
||||||
|
sourcekit = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
cmd = [
|
||||||
|
"xcrun"
|
||||||
|
"sourcekit-lsp"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# Typst
|
||||||
|
tinymist.enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
40
programs/nixvim/plugins/ui.nix
Normal file
40
programs/nixvim/plugins/ui.nix
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
{ ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
programs.nixvim = {
|
||||||
|
# Colorscheme
|
||||||
|
colorschemes.tokyonight = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
style = "night";
|
||||||
|
on_colors.__raw = "function(colors) colors.bg = \"#000000\" end";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
plugins = {
|
||||||
|
# Icons for file types
|
||||||
|
web-devicons.enable = true;
|
||||||
|
|
||||||
|
# Color highlighter (shows colors in code)
|
||||||
|
colorizer = {
|
||||||
|
enable = true;
|
||||||
|
settings.user_default_options.names = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
# Indentation guides
|
||||||
|
indent-blankline.enable = true;
|
||||||
|
|
||||||
|
# Markdown preview with live rendering
|
||||||
|
markview.enable = true;
|
||||||
|
|
||||||
|
# UI component library
|
||||||
|
nui.enable = true;
|
||||||
|
|
||||||
|
# Loading/progress indicators
|
||||||
|
fidget.enable = true;
|
||||||
|
|
||||||
|
# Status line (imported from separate file)
|
||||||
|
# lualine is in lualine.nix
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
29
programs/nixvim/plugins/utility.nix
Normal file
29
programs/nixvim/plugins/utility.nix
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
{ ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
programs.nixvim.plugins = {
|
||||||
|
# Lazy loading support
|
||||||
|
lz-n.enable = true;
|
||||||
|
|
||||||
|
# File manager
|
||||||
|
oil = {
|
||||||
|
enable = true;
|
||||||
|
lazyLoad.settings.cmd = "Oil";
|
||||||
|
};
|
||||||
|
|
||||||
|
# TODO comment highlighting
|
||||||
|
todo-comments = {
|
||||||
|
enable = true;
|
||||||
|
keymaps.todoTelescope.key = "<leader>t";
|
||||||
|
};
|
||||||
|
|
||||||
|
# Diagnostics list
|
||||||
|
trouble.enable = true;
|
||||||
|
|
||||||
|
# Typst language preview
|
||||||
|
typst-preview.enable = true;
|
||||||
|
|
||||||
|
# Key binding help
|
||||||
|
which-key.enable = true;
|
||||||
|
};
|
||||||
|
}
|
|
@ -1,11 +0,0 @@
|
||||||
{ ... }:
|
|
||||||
|
|
||||||
let
|
|
||||||
weztermConfig = builtins.readFile ./wezterm.lua;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
programs.wezterm = {
|
|
||||||
enable = true;
|
|
||||||
extraConfig = weztermConfig;
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,128 +0,0 @@
|
||||||
local wezterm = require 'wezterm'
|
|
||||||
local mux = wezterm.mux
|
|
||||||
local act = wezterm.action
|
|
||||||
|
|
||||||
wezterm.on('update-right-status', function(window, pane)
|
|
||||||
window:set_right_status(window:active_workspace())
|
|
||||||
end)
|
|
||||||
|
|
||||||
wezterm.on('gui-startup', function(cmd)
|
|
||||||
local tab, pane, window = mux.spawn_window(cmd or {})
|
|
||||||
window:gui_window():maximize()
|
|
||||||
pane:split { size = 0.2 }
|
|
||||||
end)
|
|
||||||
|
|
||||||
return {
|
|
||||||
adjust_window_size_when_changing_font_size = false,
|
|
||||||
check_for_updates = false,
|
|
||||||
color_scheme = 'Tango (terminal.sexy)',
|
|
||||||
default_gui_startup_args = { 'connect', 'unix' },
|
|
||||||
font = wezterm.font_with_fallback { 'JetBrains Mono', 'Noto Sans' },
|
|
||||||
font_size = 12.0,
|
|
||||||
freetype_load_flags = 'NO_HINTING',
|
|
||||||
dpi = 144,
|
|
||||||
scrollback_lines = 50000,
|
|
||||||
initial_cols = 400,
|
|
||||||
initial_rows = 80,
|
|
||||||
leader = { key = 'b', mods = 'SUPER', timeout_milliseconds = 1000 },
|
|
||||||
default_prog = { '/etc/profiles/per-user/salar/bin/fish' },
|
|
||||||
window_decorations = 'RESIZE',
|
|
||||||
ssh_domains = {
|
|
||||||
{
|
|
||||||
name = 'hcloud1',
|
|
||||||
remote_address = 'hcloud1.softinio.net',
|
|
||||||
username = 'salar',
|
|
||||||
remote_wezterm_path = '/run/current-system/sw/bin/wezterm',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
unix_domains = {
|
|
||||||
{
|
|
||||||
name = 'unix',
|
|
||||||
proxy_command = { 'nc', '-U', '/Users/salar/.local/share/wezterm/sock' },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
keys = {
|
|
||||||
{ key = '-', mods = 'LEADER', action = wezterm.action { SplitVertical = { domain = 'CurrentPaneDomain' } } },
|
|
||||||
{ key = "'", mods = 'LEADER', action = wezterm.action { SplitHorizontal = { domain = 'CurrentPaneDomain' } } },
|
|
||||||
{ key = 'k', mods = 'SUPER', action = act.TogglePaneZoomState },
|
|
||||||
{ key = 'h', mods = 'LEADER', action = wezterm.action { ActivatePaneDirection = 'Left' } },
|
|
||||||
{ key = 'j', mods = 'LEADER', action = wezterm.action { ActivatePaneDirection = 'Down' } },
|
|
||||||
{ key = 'k', mods = 'LEADER', action = wezterm.action { ActivatePaneDirection = 'Up' } },
|
|
||||||
{ key = 'l', mods = 'LEADER', action = wezterm.action { ActivatePaneDirection = 'Right' } },
|
|
||||||
{ key = 'H', mods = 'LEADER|SHIFT', action = wezterm.action { AdjustPaneSize = { 'Left', 5 } } },
|
|
||||||
{ key = 'J', mods = 'LEADER|SHIFT', action = wezterm.action { AdjustPaneSize = { 'Down', 5 } } },
|
|
||||||
{ key = 'K', mods = 'LEADER|SHIFT', action = wezterm.action { AdjustPaneSize = { 'Up', 5 } } },
|
|
||||||
{ key = 'L', mods = 'LEADER|SHIFT', action = wezterm.action { AdjustPaneSize = { 'Right', 5 } } },
|
|
||||||
{ key = '1', mods = 'LEADER', action = wezterm.action { ActivateTab = 0 } },
|
|
||||||
{ key = '2', mods = 'LEADER', action = wezterm.action { ActivateTab = 1 } },
|
|
||||||
{ key = '3', mods = 'LEADER', action = wezterm.action { ActivateTab = 2 } },
|
|
||||||
{ key = '4', mods = 'LEADER', action = wezterm.action { ActivateTab = 3 } },
|
|
||||||
{ key = '5', mods = 'LEADER', action = wezterm.action { ActivateTab = 4 } },
|
|
||||||
{ key = '6', mods = 'LEADER', action = wezterm.action { ActivateTab = 5 } },
|
|
||||||
{ key = '7', mods = 'LEADER', action = wezterm.action { ActivateTab = 6 } },
|
|
||||||
{ key = '8', mods = 'LEADER', action = wezterm.action { ActivateTab = 7 } },
|
|
||||||
{ key = '9', mods = 'LEADER', action = wezterm.action { ActivateTab = 8 } },
|
|
||||||
{ key = '&', mods = 'LEADER', action = wezterm.action { CloseCurrentTab = { confirm = true } } },
|
|
||||||
{ key = 'x', mods = 'LEADER', action = wezterm.action { CloseCurrentPane = { confirm = true } } },
|
|
||||||
{ key = 'Enter', mods = 'ALT', action = act.DisableDefaultAssignment },
|
|
||||||
{ key = 'c', mods = 'SUPER', action = act.CopyTo 'Clipboard' },
|
|
||||||
{ key = 'v', mods = 'SUPER', action = act.PasteFrom 'Clipboard' },
|
|
||||||
{ key = 'n', mods = 'SUPER', action = act.SpawnWindow },
|
|
||||||
{ key = 't', mods = 'SUPER', action = act.SpawnTab 'CurrentPaneDomain' },
|
|
||||||
{ key = 'h', mods = 'SUPER', action = act { SpawnCommandInNewTab = { cwd = wezterm.home_dir } } },
|
|
||||||
{ key = 'q', mods = 'SUPER', action = act.QuitApplication },
|
|
||||||
{ key = 'i', mods = 'CTRL|SHIFT', action = act.SwitchToWorkspace },
|
|
||||||
{
|
|
||||||
key = '8',
|
|
||||||
mods = 'ALT',
|
|
||||||
action = wezterm.action_callback(function(window, pane)
|
|
||||||
-- Here you can dynamically construct a longer list if needed
|
|
||||||
|
|
||||||
local home = wezterm.home_dir
|
|
||||||
local workspaces = {
|
|
||||||
{ id = home, label = 'Home' },
|
|
||||||
{ id = home .. '/Projects', label = 'My Projects' },
|
|
||||||
{ id = home .. '/OpenSource', label = 'Open Source Projects' },
|
|
||||||
{ id = home .. '/.config/nixpkgs', label = 'Nix Config' },
|
|
||||||
{ id = home .. '/Projects/scalanews', label = 'Scala News' },
|
|
||||||
}
|
|
||||||
|
|
||||||
window:perform_action(
|
|
||||||
act.InputSelector {
|
|
||||||
action = wezterm.action_callback(function(inner_window, inner_pane, id, label)
|
|
||||||
if not id and not label then
|
|
||||||
wezterm.log_info 'cancelled'
|
|
||||||
else
|
|
||||||
wezterm.log_info('id = ' .. id)
|
|
||||||
wezterm.log_info('label = ' .. label)
|
|
||||||
inner_window:perform_action(
|
|
||||||
act.SwitchToWorkspace {
|
|
||||||
name = label,
|
|
||||||
spawn = {
|
|
||||||
label = 'Workspace: ' .. label,
|
|
||||||
cwd = id,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
inner_pane
|
|
||||||
)
|
|
||||||
end
|
|
||||||
end),
|
|
||||||
title = 'Choose Workspace',
|
|
||||||
choices = workspaces,
|
|
||||||
fuzzy = true,
|
|
||||||
fuzzy_description = 'Fuzzy find and/or make a workspace',
|
|
||||||
},
|
|
||||||
pane
|
|
||||||
)
|
|
||||||
end),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key = '9',
|
|
||||||
mods = 'ALT',
|
|
||||||
action = act.ShowLauncherArgs {
|
|
||||||
flags = 'FUZZY|WORKSPACES',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{ key = 'Tab', mods = 'CTRL', action = wezterm.action.DisableDefaultAssignment },
|
|
||||||
},
|
|
||||||
}
|
|
Loading…
Add table
Add a link
Reference in a new issue