Compare commits

...

125 commits

Author SHA1 Message Date
Salar Rahmanian 5c8bf490c2 add zed editor 2024-11-10 20:50:48 -08:00
Salar Rahmanian 4aaca19c8c remove unused imports 2024-11-10 11:32:54 -08:00
Salar Rahmanian ed6a9a88bf move broot to its own file 2024-11-10 11:28:58 -08:00
Salar Rahmanian cbeb9fd9ea move fish settings to own file and add broot 2024-11-10 10:31:55 -08:00
Salar Rahmanian 52ae41a79b cleanup git aliases and switch to delta for diffs 2024-11-09 21:15:31 -08:00
Salar Rahmanian a5bbdd636c nvim and flake update 2024-11-09 10:52:51 -08:00
Salar Rahmanian a5317e85f0 cleanup shell init 2024-11-04 10:36:49 -08:00
Salar Rahmanian b55cec1458 wezterm update to use workspaces better 2024-11-04 09:42:06 -08:00
Salar Rahmanian 772fb5cd4e flake update and wezterm config update 2024-11-01 19:22:00 -07:00
Salar Rahmanian fb2e770b02 update flake 2024-10-30 20:16:29 -07:00
Salar Rahmanian ff121dd391 add marp 2024-10-26 14:38:40 -07:00
Salar Rahmanian 7a85853e80 flake update 2024-10-26 10:56:17 -07:00
Salar Rahmanian 43e4be1512 neovim and flake update 2024-10-21 17:16:04 -07:00
Salar Rahmanian f5b32b7288 flake and nvim updates 2024-10-20 20:36:27 -07:00
Salar Rahmanian 81c1cd6d7e flake and nvim updates 2024-10-07 19:28:00 -07:00
Salar Rahmanian 97dd1d4633 flake update 2024-10-05 12:02:29 -07:00
Salar Rahmanian e2beeae636 nvim and flake update 2024-09-27 17:40:55 -07:00
Salar Rahmanian 07b27ef004 flake and nvim config update 2024-09-22 23:21:39 -07:00
Salar Rahmanian e52a604ee0 flake update 2024-09-21 09:10:32 -07:00
Salar Rahmanian 6853208de5 flake update and use home manager java 2024-09-16 21:23:51 -07:00
Salar Rahmanian 100290a11c neovim update (no more mason) 2024-09-07 11:14:51 -07:00
Salar Rahmanian a92c0d905e wezterm config update 2024-09-07 11:11:09 -07:00
Salar Rahmanian 6f95ac5bc3 flake update 2024-09-07 11:10:24 -07:00
Salar Rahmanian 0ddb939e61 add lsp servers 2024-09-07 11:10:17 -07:00
Salar Rahmanian ab36ee0f4c flake and neovim config update 2024-09-03 00:54:13 -07:00
Salar Rahmanian b9ce9b9ee1 flake update & enable fish for starship 2024-08-30 22:20:27 -07:00
Salar Rahmanian d1685c92d3 update nvim and add vscode swift extension 2024-08-25 21:31:18 -07:00
Salar Rahmanian f923ddf7c4 neovim update 2024-08-18 10:45:22 -07:00
Salar Rahmanian a770ede405 update nvim config and cleanup vscode settings 2024-08-16 19:21:56 -07:00
Salar Rahmanian 57baa8ac77 flake update and vscode improvements 2024-08-10 22:41:29 -07:00
Salar Rahmanian e4a817cce6 vscode tweaks 2024-08-08 01:03:24 -07:00
Salar Rahmanian d601fe01d0 flake updates and vscode setup improvements 2024-08-07 09:24:30 -07:00
Salar Rahmanian df302e8540 flake updates 2024-07-20 22:07:11 -07:00
Salar Rahmanian b8b4d3edd6 flake update 2024-07-15 21:59:15 -07:00
Salar Rahmanian 074156d2d6 flake related updates 2024-07-07 19:22:52 -07:00
Salar Rahmanian 219b7e3ec2 flake update 2024-06-08 08:45:04 -07:00
Salar Rahmanian 4a87a28464 neovim update 2024-06-07 23:26:11 -07:00
Salar Rahmanian 5cf0dc6f6b flake update and replace ncdu with dua-cli 2024-06-07 22:58:32 -07:00
Salar Rahmanian f141d7d804 nix version update to 24.05 and flake update 2024-06-02 14:05:08 -07:00
Salar Rahmanian 780cd784c7 update nvim 2024-06-02 14:00:27 -07:00
Salar Rahmanian c6ec29ca13 home.nix cleanup 2024-05-19 22:53:50 -07:00
Salar Rahmanian 5742f7e8ba add skim and neovim update 2024-05-19 17:15:05 -07:00
Salar Rahmanian 07ad385a40 nvim update 2024-05-18 22:08:46 -07:00
Salar Rahmanian 276ceac3d5 run nixfmt on repo 2024-05-18 11:31:35 -07:00
Salar Rahmanian 29c4ce7acd flake update and added packages oterm and slumber 2024-05-18 11:01:47 -07:00
Salar Rahmanian 7ca9501e87 flake update 2024-05-12 14:32:59 -07:00
Salar Rahmanian bea7f4b411 nix versions unstable removal correction 2024-05-12 14:32:51 -07:00
Salar Rahmanian 6896222f3a remove fre1 alias and updates 2024-04-29 09:03:19 -07:00
Salar Rahmanian 850b39c9b6 updates and added devenv as a package 2024-04-26 12:20:53 -07:00
Salar Rahmanian cc54218e6c Merge pull request 'updates and cleanup' (#5) from updates-20240323 into main
Reviewed-on: #5
2024-03-23 10:16:03 -07:00
Salar Rahmanian 832bc57208 updates and cleanup 2024-03-23 10:14:43 -07:00
Salar Rahmanian 446f158cd1 Merge pull request 'flake update and neovim update' (#4) from updates-20240309 into main
Reviewed-on: #4
2024-03-09 10:22:47 -08:00
Salar Rahmanian ca6336a7fc flake update and neovim update 2024-03-09 10:22:17 -08:00
Salar Rahmanian 6d34841a45 Merge pull request 'add jupyter and flake update' (#3) from updates-20240219 into main
Reviewed-on: #3
2024-02-19 22:40:28 -08:00
Salar Rahmanian d393f2c62d add jupyter and flake update 2024-02-19 22:39:38 -08:00
Salar Rahmanian 25dfde6d0c Merge pull request 'add new packages and flake update' (#2) from updates-20240218 into main
Reviewed-on: #2
2024-02-18 21:30:17 -08:00
Salar Rahmanian db1c0a7c24 add new packages and flake update 2024-02-18 21:29:00 -08:00
Salar Rahmanian 02bb10e6ea Merge pull request 'flake update, nvim update and add pngpaste' (#1) from updates into main
Reviewed-on: #1
2024-02-17 15:59:53 -08:00
Salar Rahmanian 1636b6eb8a flake update, nvim update and add pngpaste 2024-02-17 15:58:59 -08:00
Salar Rahmanian 5c6caa88a9 flake update and added lazygit 2024-01-23 20:31:55 -08:00
Salar Rahmanian b02dc5d2ed flake and neovim related updates 2023-12-17 15:32:00 -08:00
Salar Rahmanian 482c68d6df flake update 2023-12-09 16:01:42 -08:00
Salar Rahmanian 17166fd00f flake update and add darcs 2023-12-06 23:03:53 -08:00
Salar Rahmanian bd57d53565 updates to migrate to apple silicon / apple m3 processor 2023-12-03 22:32:43 -08:00
Salar Rahmanian 1c0cb47c5b neovim and vscode update 2023-11-11 18:23:43 -08:00
Salar Rahmanian 559b8684b0 nvim update for adding obsiidian plugin 2023-11-05 15:02:17 -08:00
Salar Rahmanian 55468c89f6 flake and nvim updates 2023-10-21 08:38:48 -07:00
Salar Rahmanian 8e5335ee33 flake update and general improvements 2023-10-14 09:49:58 -07:00
Salar Rahmanian e64fcefc8c add gh-dash 2023-09-23 15:30:58 -07:00
Salar Rahmanian f34346c313 remove pijul and comment out python 2023-09-23 10:11:48 -07:00
Salar Rahmanian c70d6cbe79 eza update, add emacs, update wezterm config and flake/nix updates 2023-09-22 20:37:08 -07:00
Salar Rahmanian 8238a99555 flake update, replace exa with eza and comment out broken packages from update for now 2023-09-16 12:25:19 -07:00
Salar Rahmanian 5abb42c8b6 flake updates 2023-08-12 14:13:38 -07:00
Salar Rahmanian e0c67d29ed latest flake update 2023-07-15 16:42:50 -07:00
Salar Rahmanian 595e21ea92 nix update and comment out forcing git protocol for git config 2023-06-11 14:09:46 -07:00
Salar Rahmanian 5819915e4e add helix and change kitty leader key 2023-04-30 11:44:34 -07:00
Salar Rahmanian cdc210994a latest updates and comment out wezterm for now due to bug 2023-04-29 23:28:16 -07:00
Salar Rahmanian 22ce600524 flake update and wezterm ssh config 2023-04-08 16:32:46 -07:00
Salar Rahmanian 985b139a3b wezterm updates 2023-03-08 20:56:34 -08:00
Salar Rahmanian 24d20d1391 wezterm updates 2023-03-08 19:31:49 -08:00
Salar Rahmanian 5d8cfd9250 neovim update 2023-03-07 07:57:11 -08:00
Salar Rahmanian 63a1ab0a2f add alias for adding ssh key on mac 2023-03-01 22:06:10 -08:00
Salar Rahmanian 487f3988c6 update neovim 2023-03-01 22:02:48 -08:00
Salar Rahmanian f55b00efc0 update neovim config 2023-02-28 19:03:28 -08:00
Salar Rahmanian 5dd55a91df latest neovim and wezterm config updates 2023-02-28 18:38:05 -08:00
Salar Rahmanian e9e81fb6fb neovim updates 2023-02-24 19:14:05 -08:00
Salar Rahmanian 2a94b52e76 markdown improvements 2023-02-24 18:19:14 -08:00
Salar Rahmanian 095b211b79 flake and neovim updates 2023-02-23 18:44:46 -08:00
Salar Rahmanian 595a70a753 update nvim 2023-02-21 18:12:34 -08:00
Salar Rahmanian 307d569fcc wezterm: add keybindings for workspaces and change leader key 2023-02-16 00:26:32 -08:00
Salar Rahmanian 7c8834990d improvements to wez keybind and chose theme for kitty 2023-02-14 22:15:53 -08:00
Salar Rahmanian 99ce453270 update fish plugins 2023-02-11 21:35:00 -08:00
Salar Rahmanian 03412261b5 add wezterm 2023-02-11 21:04:42 -08:00
Salar Rahmanian 2e60e6925f updates plus decoupling of neovim config to a separate repo 2023-02-11 14:52:08 -08:00
Salar Rahmanian ebcc413c4f Merge pull request 'Cleanup' (#15) from cleanup-01042023 into main
Reviewed-on: https://git.softinio.com/softinio/nix-config/pulls/15
2023-01-05 02:15:42 +00:00
Salar Rahmanian 45a9afa230 Cleanup 2023-01-04 18:12:50 -08:00
Salar Rahmanian 3ffa53af7a Merge pull request 'December updates - part one' (#14) from december-2022-1 into main
Reviewed-on: https://git.softinio.com/softinio/nix-config/pulls/14
2022-12-10 19:51:22 +00:00
Salar Rahmanian 2f79b4b975 December updates 2022-12-10 11:46:19 -08:00
Salar Rahmanian 7cf74a25ef Merge pull request 'Neovim config updates' (#13) from nvim-updates-10162022b into main
Reviewed-on: https://git.softinio.com/softinio/nix-config/pulls/13
2022-10-16 21:31:30 +00:00
Salar Rahmanian b1b673de42 Neovim config updates 2022-10-16 14:30:16 -07:00
Salar Rahmanian bc892f2efd Merge pull request 'Neovim config updates' (#12) from nvim-updates-10162022 into main
Reviewed-on: https://git.softinio.com/softinio/nix-config/pulls/12
2022-10-16 18:09:12 +00:00
Salar Rahmanian bb6fe35f54 Neovim config updates 2022-10-16 11:06:11 -07:00
Salar Rahmanian 15a386c2cb Merge pull request 'Update Nix to get Neovim 0.8' (#11) from update-nix-neovim-oct-8-2022 into main
Reviewed-on: https://git.softinio.com/softinio/nix-config/pulls/11
2022-10-08 18:55:28 +00:00
Salar Rahmanian aec63889ec Update Nix to get Neovim 0.8 2022-10-08 11:48:26 -07:00
Salar Rahmanian 44d9115424 Merge pull request 'Update to use nvim for mergetool & battery config update' (#10) from move-diff-tool-to-nvim into main
Reviewed-on: https://git.softinio.com/softinio/nix-config/pulls/10
2022-09-22 03:15:04 +00:00
Salar Rahmanian 285f132d14 Update to use nvim for mergetool & battery config update 2022-09-21 20:13:17 -07:00
Salar Rahmanian 90571fac9e Merge pull request 'Add Latex Support & Some updates' (#9) from add-latex-support into main
Reviewed-on: https://git.softinio.com/softinio/nix-config/pulls/9
2022-09-18 23:59:54 +00:00
Salar Rahmanian 7135dddd9a Update fre2 port 2022-09-18 16:56:21 -07:00
Salar Rahmanian 679bd8f95a Added Latex support 2022-09-18 15:10:19 -07:00
Salar Rahmanian b80945bb18 Merge pull request 'Add battery.nvim plugin' (#8) from add-battery-nvim into main
Reviewed-on: https://git.softinio.com/softinio/nix-config/pulls/8
2022-08-21 19:15:00 +00:00
Salar Rahmanian f55bf1e412 Add battery.nvim plugin 2022-08-21 11:53:55 -07:00
Salar Rahmanian c07ed6c150 Merge pull request 'Metals config update for neovim' (#7) from neovim-metals-upgrades into main
Reviewed-on: https://git.softinio.com/softinio/nix-config/pulls/7
2022-08-14 02:45:05 +00:00
Salar Rahmanian 5157a786f7 Metals config update for neovim 2022-08-13 19:43:58 -07:00
Salar Rahmanian 62d5238255 Merge pull request 'replaced nvim-compe with nvim-cmp' (#6) from nvim-cmp-upgrade into main
Reviewed-on: https://git.softinio.com/softinio/nix-config/pulls/6
2022-08-13 23:59:29 +00:00
Salar Rahmanian 1182588dbf replaced nvim-compe with nvim-cmp 2022-08-13 16:56:45 -07:00
Salar Rahmanian 71a18a763b Merge pull request 'Post Flakes Cleanup and Neovim updates' (#5) from neovim-updates-flakes-cleanup into main
Reviewed-on: https://git.softinio.com/softinio/nix-config/pulls/5
2022-08-13 19:03:43 +00:00
Salar Rahmanian 143f887872 Merge branch 'main' into neovim-updates-flakes-cleanup 2022-08-13 19:03:01 +00:00
Salar Rahmanian d89ca3c8aa post flakes cleanup and neovim updates 2022-08-13 12:00:34 -07:00
Salar Rahmanian a7fc11fcde temp remove treesitter from nvim 2022-08-13 11:16:38 -07:00
Salar Rahmanian 3739000e7e
Merge pull request #5 from softinio/upgrade-to-flakes
Upgrade to flakes
2022-08-13 10:48:29 -07:00
Salar Rahmanian 48421bb10e Merge pull request 'Upgrade to use Nix Flakes' (#4) from upgrade-to-flakes into main
Reviewed-on: https://git.softinio.com/softinio/nix-config/pulls/4
2022-08-13 17:47:18 +00:00
Salar Rahmanian fd191d0dd9 Added support for unfree to home file 2022-08-08 00:37:22 -07:00
Salar Rahmanian dac860df2d Resolve conflict related to user directory 2022-08-07 22:54:32 -07:00
Salar Rahmanian cc0fd60226 initial changes to upgrade to flakes 2022-08-07 22:50:23 -07:00
Salar Rahmanian 7194bbdb83
Merge pull request #4 from softinio/add-scaladex
Add scaladex.nvim to neovim configuration
2021-11-13 10:55:45 -08:00
16 changed files with 797 additions and 1077 deletions

View file

@ -1,4 +1 @@
{
allowUnfree = true;
}
{ allowUnfree = true; }

85
flake.lock Normal file
View file

@ -0,0 +1,85 @@
{
"nodes": {
"home-manager": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1730837930,
"narHash": "sha256-0kZL4m+bKBJUBQse0HanewWO0g8hDdCvBhudzxgehqc=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "2f607e07f3ac7e53541120536708e824acccfaa8",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "home-manager",
"type": "github"
}
},
"nix-darwin": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1731153869,
"narHash": "sha256-3Ftf9oqOypcEyyrWJ0baVkRpvQqroK/SVBFLvU3nPuc=",
"owner": "LnL7",
"repo": "nix-darwin",
"rev": "5c74ab862c8070cbf6400128a1b56abb213656da",
"type": "github"
},
"original": {
"owner": "LnL7",
"repo": "nix-darwin",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1730785428,
"narHash": "sha256-Zwl8YgTVJTEum+L+0zVAWvXAGbWAuXHax3KzuejaDyo=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "4aa36568d413aca0ea84a1684d2d46f55dbabad7",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nur": {
"locked": {
"lastModified": 1731177199,
"narHash": "sha256-C99JI1nnLGEG6TWDlHTyxcuPTNNPakIcvUjlkFJA7rk=",
"owner": "nix-community",
"repo": "nur",
"rev": "3f335d1febbcea794cf5104725b4944d0d4b2066",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nur",
"type": "github"
}
},
"root": {
"inputs": {
"home-manager": "home-manager",
"nix-darwin": "nix-darwin",
"nixpkgs": "nixpkgs",
"nur": "nur"
}
}
},
"root": "root",
"version": 7
}

101
flake.nix Normal file
View file

@ -0,0 +1,101 @@
{
description = "Nix and home-manager configurations for Softinio's macbook";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
nix-darwin = {
url = "github:LnL7/nix-darwin";
inputs.nixpkgs.follows = "nixpkgs";
};
nur.url = "github:nix-community/nur";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
{
self,
nix-darwin,
home-manager,
nur,
nixpkgs,
...
}:
let
homeManagerConfFor =
config:
{ ... }:
{
nixpkgs.overlays = [ nur.overlay ];
imports = [
config
];
};
m3maxConfiguration =
{ pkgs, ... }:
{
environment.systemPackages = with pkgs; [ home-manager ];
fonts = {
packages = with pkgs; [ fira-code ];
};
services.nix-daemon.enable = true;
nix = {
nixPath = nixpkgs.lib.mkForce [ "nixpkgs=${nixpkgs}" ];
package = pkgs.nixVersions.stable;
settings = {
experimental-features = "nix-command flakes";
extra-platforms = [
"x86_64-darwin"
"aarch64-darwin"
];
trusted-users = [
"root"
"salar"
];
};
distributedBuilds = false;
};
programs.fish.enable = true;
system.configurationRevision = self.rev or self.dirtyRev or null;
system.stateVersion = 4;
nixpkgs.hostPlatform = "aarch64-darwin";
users = {
users.salar = {
home = /Users/salar;
};
};
};
in
{
darwinConfigurations.salarm3max = nix-darwin.lib.darwinSystem {
system = "aarc64-darwin";
modules = [
m3maxConfiguration
home-manager.darwinModules.home-manager
{
home-manager.useUserPackages = true;
home-manager.users.salar = homeManagerConfFor ./home.nix;
}
];
specialArgs = {
inherit nixpkgs;
};
};
darwinPackages = self.darwinConfigurations.salarm3max.pkgs;
defaultPackage.aarch64-darwin = self.darwinConfigurations.salarm3max.system;
};
}

390
home.nix
View file

@ -1,4 +1,8 @@
{ config, lib, pkgs, ... }:
{
lib,
pkgs,
...
}:
{
# Let Home Manager install and manage itself.
@ -6,33 +10,140 @@
imports = (import ./programs);
nixpkgs.overlays = [
(import ./overlays/sumneko-lua-language-server)
(import (builtins.fetchTarball {
url = https://github.com/nix-community/neovim-nightly-overlay/archive/master.tar.gz;
}))
];
nixpkgs.config.allowUnfreePredicate =
pkg:
builtins.elem (lib.getName pkg) [
"discord"
"slack"
"vscode"
"vscode-extension-github-copilot"
"vscode-extension-github-copilot-chat"
"vscode-extension-MS-python-vscode-pylance"
"zoom"
];
home = {
username = "salar";
homeDirectory = "/Users/salar";
stateVersion = "21.11";
stateVersion = "24.05";
sessionVariables = {
EDITOR = "nvim";
VISUAL = "$EDITOR";
};
packages = with pkgs; [
any-nix-shell
aspell
basedpyright
bash-language-server
cachix
cmake
coursier
curlFull
delta
deno
devenv
discord
dua
fd
ffmpeg
font-awesome
gnupg
go
graphviz
jq-lsp
luajit
lua-language-server
marksman
marp-cli
maven
metals
multimarkdown
mypy
neofetch
neovim
nil
niv
nixd
nix-index
nixfmt-rfc-style
nix-prefetch-git
nodejs
ollama
openssl
pandoc
patchelf
pngpaste
prettyping
python3Packages.huggingface-hub
python3Packages.jupyterlab
rclone
readline
ripgrep
ripgrep-all
rustup
sbt
scala-cli
shellcheck
skimpdf
slack
slides
slumber
sqlite
stylua
swift-format
tealdeer
tectonic
texlab
tig
tokei
tree
tree-sitter
typescript
typescript-language-server
wget
vscode-langservers-extracted
xz
yaml-language-server
yq
zoom-us
];
};
programs.bat = {
enable = true;
enable = true;
};
programs.btop = {
enable = true;
};
programs.darcs = {
enable = true;
author = [ "Salar Rahmanian <code@softinio.com>" ];
boring = [
"^.idea$"
"^.direnv$"
"^.envrc$"
"^.vscode$"
];
};
programs.direnv = {
enable = true;
enableFishIntegration = true;
nix-direnv.enable = true;
};
programs.eza = {
enable = true;
enableFishIntegration = true;
git = true;
icons = "auto";
extraOptions = [
"--group-directories-first"
"--long"
"--header"
"--all"
];
};
programs.fzf = {
enable = true;
enableFishIntegration = true;
@ -43,6 +154,22 @@
settings = {
editor = "nvim";
git_protocol = "ssh";
prompt = "enabled";
aliases = {
co = "pr checkout";
pv = "pr view";
};
};
};
programs.gh-dash = {
enable = true;
};
programs.helix = {
enable = true;
settings = {
theme = "tokyonight";
};
};
@ -50,26 +177,26 @@
enable = true;
};
programs.java = {
enable = true;
};
programs.jq = {
enable = true;
};
programs.kitty = {
programs.lazygit = {
enable = true;
font = {
name = "FiraCode Nerd Font Mono Retina";
size = 16;
};
settings = {
copy_on_select = true;
enabled_layouts = "*";
macos_quit_when_last_window_closed = true;
scrollback_lines = 10000;
};
};
programs.nix-index = {
enable = true;
enableFishIntegration = true;
};
programs.starship = {
enable = true;
enableFishIntegration = true;
settings = {
command_timeout = 1000;
character = {
@ -79,218 +206,9 @@
};
};
programs.vscode = {
enable = true;
extensions = [
pkgs.vscode-extensions.scalameta.metals
pkgs.vscode-extensions.usernamehw.errorlens
pkgs.vscode-extensions.redhat.java
pkgs.vscode-extensions.xyz.local-history
pkgs.vscode-extensions.yzhang.markdown-all-in-one
pkgs.vscode-extensions.svsool.markdown-memo
pkgs.vscode-extensions.github.vscode-pull-request-github
pkgs.vscode-extensions.github.github-vscode-theme
pkgs.vscode-extensions.jnoortheen.nix-ide
pkgs.vscode-extensions.timonwong.shellcheck
pkgs.vscode-extensions.skyapps.fish-vscode
pkgs.vscode-extensions.baccata.scaladex-search
pkgs.vscode-extensions.davidanson.vscode-markdownlint
];
userSettings = {
editor.fontFamily = "FiraCode Nerd Font Mono Retina";
editor.fontSize = 16;
telemetry.enableTelemetry = false;
workbench.colorTheme = "Solarized Light";
workbench.iconTheme = "vscode-icons";
};
};
programs.fish = {
enable = true;
functions = {
gitignore = "curl -sL https://www.gitignore.io/api/$argv";
};
plugins = [
{
name = "bass";
src = pkgs.fetchFromGitHub {
owner = "edc";
repo = "bass";
rev = "50eba266b0d8a952c7230fca1114cbc9fbbdfbd4";
sha256 = "0ppmajynpb9l58xbrcnbp41b66g7p0c9l2nlsvyjwk6d16g4p4gy";
};
}
{
name = "foreign-env";
src = pkgs.fetchFromGitHub {
owner = "oh-my-fish";
repo = "plugin-foreign-env";
rev = "dddd9213272a0ab848d474d0cbde12ad034e65bc";
sha256 = "00xqlyl3lffc5l0viin1nyp819wf81fncqyz87jx8ljjdhilmgbs";
};
}
{
name = "bobthefish";
src = pkgs.fetchFromGitHub {
owner = "oh-my-fish";
repo = "theme-bobthefish";
rev = "a2ad38aa051aaed25ae3bd6129986e7f27d42d7b";
sha256 = "1fssb5bqd2d7856gsylf93d28n3rw4rlqkhbg120j5ng27c7v7lq";
};
}
];
loginShellInit = ''
set -xg TERM xterm-256color
if test -e /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
fenv source /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
end
if test -e /nix/var/nix/profiles/default/etc/profile.d/nix.sh
fenv source /nix/var/nix/profiles/default/etc/profile.d/nix.sh
end
if test -e $HOME/.nix-profile/etc/profile.d/hm-session-vars.sh
fenv source $HOME/.nix-profile/etc/profile.d/hm-session-vars.sh
end
set -xg PATH $HOME/bin $HOME/.cargo/bin $PATH
set -xg PATH /Users/salar/.luarocks/bin:/nix/store/95wpywsjf5iiw77f6n9rw347lk1sly15-luarocks-3.2.1/bin:/Users/salar/bin:/Users/salar/.nix-profile/bin:/nix/var/nix/profiles/default/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/nix/store/3qp71mhrpxxg080yc82k51nx7b5hkajr-kitty-0.21.2/Applications/kitty.app/Contents/MacOS $PATH
set -xg JAVA_HOME /Users/salar/.nix-profile
set -xg JDTLS_CONFIG /Users/salar/.config/jdt-language-server/config_mac
set -xg JAR /Users/salar/.config/jdt-language-server/plugins/org.eclipse.equinox.launcher_1.6.200.v20210416-2027.jar
set -xg WORKSPACE /Users/salar/Projects
set -xg NIX_PATH $HOME/.nix-defexpr/channels $NIX_PATH
set -xg FZF_DEFAULT_OPTS "--preview='bat {} --color=always'" \n
set -xg TOOLCHAINS swift
set -xg XDG_CONFIG_HOME $HOME/.config
set -xg LUA_PATH "/nix/store/95wpywsjf5iiw77f6n9rw347lk1sly15-luarocks-3.2.1/share/lua/5.1/?.lua;/nix/store/95wpywsjf5iiw77f6n9rw347lk1sly15-luarocks-3.2.1/share/lua/5.1/?/init.lua;/Users/salar/.luarocks/share/lua/5.1/?.lua;/Users/salar/.luarocks/share/lua/5.1/?/init.lua"
set -xg LUA_CPATH "?.so;/nix/store/95wpywsjf5iiw77f6n9rw347lk1sly15-luarocks-3.2.1/share/lua/5.1/?/init.lua;/Users/salar/.luarocks/lib/lua/5.1/?.so;/nix/store/95wpywsjf5iiw77f6n9rw347lk1sly15-luarocks-3.2.1/lib/lua/5.1/?.so"
'';
interactiveShellInit = ''
eval (direnv hook fish)
any-nix-shell fish --info-right | source
'';
shellAliases = {
cat="bat";
du="ncdu --color dark -rr -x";
fzfp="fzf --preview 'bat --style=numbers --color=always --line-range :500 {}'";
ping="prettyping";
".." = "cd ..";
pj="python -m json.tool";
l="exa --long --header --git --all";
g="git";
gl="git log";
gc="git commit -m";
gca="git commit -am";
gws="git status";
ghauth="gh auth login --with-token < ~/.ghauth";
giscala="gitignore scala,vim,java,sbt > .gitignore";
gforksync="git fetch upstream && git merge upstream/master && git push origin master";
grep="grep --color=auto";
new-sbt="sbt new scala/scala-seed.g8";
nixre="home-manager switch";
nixedit="home-manager edit";
nixinfo="nix-shell -p nix-info --run \"nix-info -m\"";
nixgc="nix-collect-garbage -d";
nixq="nix-env -qa";
nixupdate="nix-channel --update";
nixupgrade="nix upgrade-nix";
nixup="nix-env -u";
nixversion="nix eval nixpkgs.lib.version";
nixdaemon="sudo launchctl load /Library/LaunchDaemons/org.nixos.nix-daemon.plist && launchctl start org.nixos.nix-daemon";
rmxcodederived="rm -fr ~/Library/Developer/Xcode/DerivedData";
v="nvim";
tabninecfg="vc /Users/salar/Library/Preferences/TabNine/TabNine.toml";
sshfre1="ssh salar@fre1.softinio.net";
sshfre2="ssh salar@fre2.softinio.net";
};
};
xdg.configFile."fish/conf.d/plugin-bobthefish.fish".text = lib.mkAfter ''
for f in $plugin_dir/*.fish
source $f
end
'';
# Neovim Configuration
xdg.configFile."nvim/lua/salargalaxyline.lua".source = programs/neovim/settings/salargalaxyline.lua;
xdg.configFile."nvim/init.lua".source = programs/neovim/init.lua;
home.packages = [
pkgs.adoptopenjdk-bin
pkgs.any-nix-shell
pkgs.aspell
pkgs.bloop
pkgs.cmake
pkgs.coursier
pkgs.curlFull
pkgs.direnv
pkgs.dust
pkgs.exa
pkgs.fd
pkgs.ffmpeg
pkgs.gitAndTools.diff-so-fancy
pkgs.global
pkgs.gnupg
pkgs.go
pkgs.hugo
pkgs.jansson
pkgs.luajit
pkgs.luajitPackages.luarocks
pkgs.luajitPackages.luasocket
pkgs.maven
pkgs.multimarkdown
pkgs.ncdu
pkgs.neofetch
pkgs.neovim
pkgs.niv
pkgs.nixFlakes
pkgs.nixfmt
pkgs.nodePackages.pyright
pkgs.nodePackages.typescript-language-server
pkgs.nodePackages.vscode-html-languageserver-bin
pkgs.nodePackages.vscode-json-languageserver
pkgs.nodePackages.yaml-language-server
pkgs.openssl
pkgs.pandoc
pkgs.prettyping
pkgs.procs
pkgs.python3Full
pkgs.python39Packages.debugpy
pkgs.readline
pkgs.ripgrep
pkgs.ripgrep-all
pkgs.rnix-lsp
pkgs.rustup
pkgs.sbt
pkgs.scala-cli
pkgs.shellcheck
pkgs.stylua
pkgs.sumneko-lua-language-server
pkgs.tealdeer
pkgs.tig
pkgs.tokei
pkgs.tree
pkgs.tree-sitter
pkgs.universal-ctags
pkgs.wget
pkgs.xz
pkgs.yq
];
xdg.configFile."nvim".source = builtins.fetchGit {
url = "https://code.softinio.com/softinio/nvim-config";
rev = "b535afb6d9259e0ec18e2e7fda54384b48264746";
};
}

View file

@ -1,38 +0,0 @@
self: super: {
sumneko-lua-language-server = super.sumneko-lua-language-server.overrideAttrs (
o: rec {
version = "2.2.3";
src = builtins.fetchurl {
url = "https://github.com/sumneko/vscode-lua/releases/download/v${version}/lua-${version}.vsix";
sha256 = "16rpi6p7rslpdfi37ndy5g9qmvh22qljfk9w15kdrr668hfwp7nm";
};
unpackPhase = ''
${super.pkgs.unzip}/bin/unzip $src
'';
platform = if super.stdenv.isDarwin then "macOS" else "Linux";
preBuild = "";
postBuild = "";
nativeBuildInputs = [
super.makeWrapper
];
installPhase = ''
mkdir -p $out
cp -r extension $out/extras
chmod a+x $out/extras/server/bin/$platform/lua-language-server
makeWrapper $out/extras/server/bin/$platform/lua-language-server \
$out/bin/lua-language-server \
--add-flags "-E -e LANG=en $out/extras/server/main.lua \
--logpath='~/.cache/sumneko_lua/log' \
--metapath='~/.cache/sumneko_lua/meta'"
'';
meta.platforms = super.lib.platforms.all;
}
);
}

View file

@ -0,0 +1,25 @@
{ ... }:
let
myverbs = [
{
invocation = "panel_right";
key = "alt-right";
internal = ":panel_right";
}
{
invocation = "panel_left_no_open";
key = "alt-left";
internal = ":panel_left_no_open";
}
];
in
{
programs.broot = {
enable = true;
enableFishIntegration = true;
settings = {
modal = true;
verbs = myverbs;
};
};
}

View file

@ -1,4 +1,9 @@
[
./broot
./fish
./git
./tmux
./wezterm
./vscode
./zed
]

81
programs/fish/default.nix Normal file
View file

@ -0,0 +1,81 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [
fish
fishPlugins.foreign-env
fishPlugins.bobthefish
];
programs.fish = {
enable = true;
functions = {
gitignore = "curl -sL https://www.gitignore.io/api/$argv";
};
plugins = [ ];
loginShellInit = ''
set -xg TERM xterm-256color
if test -e /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
fenv source /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
end
if test -e /nix/var/nix/profiles/default/etc/profile.d/nix.sh
fenv source /nix/var/nix/profiles/default/etc/profile.d/nix.sh
end
if test -e $HOME/.nix-profile/etc/profile.d/hm-session-vars.sh
fenv source $HOME/.nix-profile/etc/profile.d/hm-session-vars.sh
end
set -xg PATH $HOME/bin $HOME/.cargo/bin $PATH
set -xg PATH /Users/salar/.luarocks/bin:/Users/salar/bin:/Users/salar/.nix-profile/bin:/nix/var/nix/profiles/default/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin $PATH
set -xg WORKSPACE /Users/salar/Projects
set -xg FZF_DEFAULT_OPTS "--preview='bat {} --color=always'" \n
set -xg TOOLCHAINS swift
'';
interactiveShellInit = ''
eval (direnv hook fish)
any-nix-shell fish --info-right | source
'';
shellAliases = {
addsshmac = "ssh-add ~/.ssh/id_ed25519 --apple-use-keychain --apple-load-keychain";
bf = "broot";
cat = "bat";
du = "dua i";
fzfp = "fzf --preview 'bat --style=numbers --color=always --line-range :500 {}'";
ping = "prettyping";
".." = "cd ..";
pj = "python -m json.tool";
l = "ll";
g = "git";
ghauth = "gh auth login --with-token < ~/.ghauth";
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'';
giscala = "gitignore scala,vim,java,sbt > .gitignore";
gforksync = "git fetch upstream && git merge upstream/master && git push origin master";
grep = "grep --color=auto";
lg = "lazygit";
new-sbt = "sbt new scala/scala-seed.g8";
nixc = "cd ~/.config/nixpkgs";
nixre = "nix build && sudo ./result/activate";
nixinfo = "nix-shell -p nix-info --run \"nix-info -m\"";
nixgc = "nix-collect-garbage -d";
nixq = "nix-env -qa";
nixstorerepair = "nix-store --repair --verify --check-contents";
nixupgrade = "nix upgrade-nix";
rmxcodederived = "rm -fr ~/Library/Developer/Xcode/DerivedData";
v = "nvim";
sshhcloud1 = "ssh salar@hcloud1.softinio.net";
sshhcloud1r = "ssh root@hcloud1.softinio.net";
};
};
}

View file

@ -1,53 +1,82 @@
{ config, pkgs, ... }:
{ ... }:
let
gitConfig = {
core = {
editor = "nvim";
pager = "diff-so-fancy | less --tabs=4 -RFX";
pager = "delta";
};
delta = {
"line-numbers" = true;
"hyperlinks" = true;
"side-by-side" = true;
};
diff = {
colorMoved = "default";
tool = "nvim";
};
difftool.nvim = {
cmd = "nvim -d \"$LOCAL\" \"$REMOTE\"";
prompt = false;
};
fetch.prune = true;
init.defaultBranch = "main";
merge.tool = "intellij";
mergetool = {
cmd = "idea merge \"$LOCAL\" \"$REMOTE\" \"$BASE\" \"$MERGED\"";
trustExitCode = true;
interactive = {
diffFilter = "delta --color-only";
};
merge.conflictstyle = "diff3";
merge.tool = "nvim";
mergetool.nvim = {
cmd = "nvim -d -c \"wincmd l\" -c \"norm ]c\" \"$LOCAL\" \"$MERGED\" \"$REMOTE\"";
prompt = false;
keepBackup = false;
};
diff.tool = "intellij";
difftool = {
cmd = "idea diff \"$LOCAL\" \"$REMOTE\"";
prompt = false;
};
url = {
"git@github.com:" = {
insteadOf = "https://github.com/";
};
};
# url = {
# "git@github.com:" = {
# insteadOf = "https://github.com/";
# };
# };
pull = {
rebase = true;
};
};
myAliases = {
ci = "commit";
cim = "commit -m";
cia = "commit -am";
co = "checkout";
cob = "checkout -b";
di = "diff";
gpo = "push origin";
main = "checkout main";
master = "checkout master";
st = "status";
};
myIgnores = [
"*~"
".DS_Store"
"*.bloop"
".direnv/"
".idea/"
".mypy_cache"
"*.metals"
"*.metals.sbt"
"*metals.sbt"
"*.envrc" # there is lorri, nix-direnv & simple direnv; let people decide
"*hie.yaml" # ghcide files
"*.mill-version" # used by metals
"*.vscode"
"*.python-version"
"result"
];
in
{
programs.git = {
enable = true;
userEmail = "code@softinio.com";
userName = "Salar Rahmanian";
ignores = [
"*~"
".DS_Store"
"*.bloop"
"*.metals"
"*.metals.sbt"
"*metals.sbt"
"*.direnv"
"*.envrc" # there is lorri, nix-direnv & simple direnv; let people decide
"*hie.yaml" # ghcide files
"*.mill-version" # used by metals
"*.idea"
"*.vscode"
"*.python-version"
];
aliases = myAliases;
ignores = myIgnores;
extraConfig = gitConfig;
};
}

View file

@ -1,559 +0,0 @@
local fn = vim.fn
local install_path = fn.stdpath 'data' .. '/site/pack/packer/start/packer.nvim'
local function load_plugins()
local use = require('packer').use
require('packer').startup(function()
use 'wbthomason/packer.nvim' -- Package manager
use 'neovim/nvim-lspconfig' -- Collection of configurations for built-in LSP client
use 'nvim-treesitter/nvim-treesitter'
use 'nvim-treesitter/nvim-treesitter-textobjects'
use 'nvim-treesitter/playground'
use 'folke/which-key.nvim'
use 'folke/lua-dev.nvim'
use 'folke/tokyonight.nvim' -- Theme
use { 'folke/trouble.nvim', requires = 'kyazdani42/nvim-web-devicons' }
use { 'nvim-telescope/telescope.nvim', requires = { { 'nvim-lua/popup.nvim' }, { 'nvim-lua/plenary.nvim' } } }
use 'nvim-telescope/telescope-dap.nvim'
use {'nvim-telescope/telescope-fzf-native.nvim', run = 'make' }
use { 'softinio/scaladex.nvim' }
use 'windwp/nvim-autopairs' -- Autopairs
use 'kyazdani42/nvim-tree.lua' -- File explorer
use {
'glepnir/galaxyline.nvim',
config = function()
require 'salargalaxyline'
end,
requires = 'kyazdani42/nvim-web-devicons',
}
use 'lukas-reineke/indent-blankline.nvim'
use { 'lewis6991/gitsigns.nvim', requires = 'nvim-lua/plenary.nvim' }
use { 'TimUntersberger/neogit', requires = { { 'nvim-lua/plenary.nvim' }, { 'sindrets/diffview.nvim' } } }
use { 'hrsh7th/nvim-compe', requires = 'L3MON4D3/LuaSnip' } -- Autocompletion plugin
use {'tzachar/compe-tabnine', run='./install.sh', requires = 'hrsh7th/nvim-compe'}
use 'kevinhwang91/nvim-bqf'
use 'mfussenegger/nvim-dap'
use 'mfussenegger/nvim-dap-python'
use 'jbyuki/one-small-step-for-vimkind'
use {'theHamsta/nvim-dap-virtual-text'}
use 'sheerun/vim-polyglot'
use 'scalameta/nvim-metals'
use 'ray-x/lsp_signature.nvim'
use 'b3nj5m1n/kommentary'
use 'ckipp01/stylua-nvim'
use 'gennaro-tedesco/nvim-jqx'
use 'p00f/nvim-ts-rainbow'
use 'christoomey/vim-tmux-navigator'
end)
end
_G.load_config = function()
require('gitsigns').setup()
require('kommentary.config').use_extended_mappings()
require 'salargalaxyline'
require('trouble').setup()
require('which-key').setup()
require('indent_blankline').setup({
indent_blankline_use_treesitter = true
})
-- nvim-autopairs
require('nvim-autopairs').setup()
require('nvim-autopairs.completion.compe').setup({
map_cr = true,
map_complete = true
})
-- nvim-dap
local dap = require('dap')
dap.configurations.lua = {
{
type = 'nlua',
request = 'attach',
name = "Attach to running Neovim instance",
host = function()
local value = vim.fn.input('Host [127.0.0.1]: ')
if value ~= "" then
return value
end
return '127.0.0.1'
end,
port = function()
local val = tonumber(vim.fn.input('Port: '))
assert(val, "Please provide a port number")
return val
end,
}
}
dap.adapters.nlua = function(callback, config)
callback({ type = 'server', host = config.host, port = config.port or 8088 })
end
dap.configurations.scala = {
{
type = "scala",
request = "launch",
name = "Run",
metals = {
runType = "run",
args = { "firstArg", "secondArg", "thirdArg" },
},
},
{
type = "scala",
request = "launch",
name = "Test File",
metals = {
runType = "testFile",
},
},
{
type = "scala",
request = "launch",
name = "Test Target",
metals = {
runType = "testTarget",
},
},
}
vim.fn.sign_define('DapBreakpoint', {text='🛑', texthl='', linehl='', numhl=''})
vim.fn.sign_define('DapStopped', {text='⭐️', texthl='', linehl='', numhl=''})
require('dap-python').test_runner = 'pytest'
-- nvim-tree
require('nvim-tree').setup()
-- Treesitter
require('nvim-treesitter.configs').setup {
query_linter = {
enable = true,
use_virtual_text = true,
lint_events = { 'BufWrite', 'CursorHold' },
},
ensure_installed = 'maintained',
highlight = { enable = true },
incremental_selection = {
enable = true,
keymaps = {
init_selection = 'gnn',
node_incremental = 'grn',
scope_incremental = 'grc',
node_decremental = 'grm',
},
},
indent = {
enable = true,
},
textobjects = {
select = {
enable = true,
lookahead = true, -- Automatically jump forward to textobj, similar to targets.vim
keymaps = {
-- You can use the capture groups defined in textobjects.scm
['af'] = '@function.outer',
['if'] = '@function.inner',
['ac'] = '@class.outer',
['ic'] = '@class.inner',
},
},
move = {
enable = true,
set_jumps = true, -- whether to set jumps in the jumplist
goto_next_start = {
[']m'] = '@function.outer',
[']]'] = '@class.outer',
},
goto_next_end = {
[']M'] = '@function.outer',
[']['] = '@class.outer',
},
goto_previous_start = {
['[m'] = '@function.outer',
['[['] = '@class.outer',
},
goto_previous_end = {
['[M'] = '@function.outer',
['[]'] = '@class.outer',
},
},
},
playground = {
enable = true,
disable = {},
updatetime = 25, -- Debounced time for highlighting nodes in the playground from source code
persist_queries = false, -- Whether the query persists across vim sessions
keybindings = {
toggle_query_editor = 'o',
toggle_hl_groups = 'i',
toggle_injected_languages = 't',
toggle_anonymous_nodes = 'a',
toggle_language_display = 'I',
focus_language = 'f',
unfocus_language = 'F',
update = 'R',
goto_node = '<cr>',
show_help = '?',
},
},
rainbow = {
enable = true,
extended_mode = true,
max_file_lines = 1000,
},
}
-- neogit
require('neogit').setup {
integrations = {
diffview = true,
},
}
--Incremental live completion
vim.o.inccommand = 'nosplit'
--Set highlight on search
vim.o.hlsearch = false
vim.o.incsearch = true
--Make line numbers default
vim.wo.number = true
--Do not save when switching buffers
vim.o.hidden = true
--Enable mouse mode
vim.o.mouse = 'a'
-- clipboard
vim.o.clipboard = 'unnamedplus'
--Enable break indent
vim.o.breakindent = true
--Save undo history
vim.cmd [[set undofile]]
--Case insensitive searching UNLESS /C or capital in search
vim.o.ignorecase = true
vim.o.smartcase = true
--Decrease update time
vim.o.updatetime = 250
vim.wo.signcolumn = 'yes'
--Set colorscheme (order is important here)
vim.g.tokyonight_style = 'night'
vim.g.tokyonight_italic_functions = true
vim.o.termguicolors = true
vim.cmd [[colorscheme tokyonight]]
--Remap space as leader key
vim.api.nvim_set_keymap('', '<Space>', '<Nop>', { noremap = true, silent = true })
vim.g.mapleader = ' '
vim.g.maplocalleader = ' '
--Remap for dealing with word wrap
vim.api.nvim_set_keymap('n', 'k', "v:count == 0 ? 'gk' : 'k'", { noremap = true, expr = true, silent = true })
vim.api.nvim_set_keymap('n', 'j', "v:count == 0 ? 'gj' : 'j'", { noremap = true, expr = true, silent = true })
--Remap escape to leave terminal mode
vim.api.nvim_set_keymap('t', '<Esc>', [[<c-\><c-n>]], { noremap = true })
--Add map to enter paste mode
vim.o.pastetoggle = '<F3>'
--Map blankline
vim.g.indent_blankline_char = ''
vim.g.indent_blankline_filetype_exclude = { 'help', 'packer' }
vim.g.indent_blankline_buftype_exclude = { 'terminal', 'nofile' }
vim.g.indent_blankline_char_highlight = 'LineNr'
-- Toggle to disable mouse mode and indentlines for easier paste
ToggleMouse = function()
if vim.o.mouse == 'a' then
vim.cmd [[IndentBlanklineDisable]]
vim.wo.signcolumn = 'no'
vim.o.mouse = 'v'
vim.wo.number = false
print 'Mouse disabled'
else
vim.cmd [[IndentBlanklineEnable]]
vim.wo.signcolumn = 'yes'
vim.o.mouse = 'a'
vim.wo.number = true
print 'Mouse enabled'
end
end
vim.api.nvim_set_keymap('n', '<F10>', '<cmd>lua ToggleMouse()<cr>', { noremap = true })
-- Telescope
require('telescope').setup {
defaults = {
mappings = {
i = {
['<C-u>'] = false,
['<C-d>'] = false,
},
},
file_ignore_patterns = { "node_modules", "target"},
extensions = {
fzf = {
fuzzy = true,
override_generic_sorter = true,
override_file_sorter = true,
case_mode = "smart_case"
}
}
},
}
require('telescope').load_extension('dap')
require('telescope').load_extension('fzf')
require('telescope').load_extension('scaladex')
--Add leader shortcuts
vim.api.nvim_set_keymap('n', '<leader>f', [[<cmd>lua require('telescope.builtin').find_files()<cr>]], { noremap = true, silent = true })
vim.api.nvim_set_keymap('n', '<leader><space>', [[<cmd>lua require('telescope.builtin').buffers()<cr>]], { noremap = true, silent = true })
vim.api.nvim_set_keymap('n', '<leader>l', [[<cmd>lua require('telescope.builtin').current_buffer_fuzzy_find()<cr>]], { noremap = true, silent = true })
-- vim.api.nvim_set_keymap('n', '<leader>t', [[<cmd>lua require('telescope.builtin').tags()<cr>]], { noremap = true, silent = true })
vim.api.nvim_set_keymap('n', '<leader>?', [[<cmd>lua require('telescope.builtin').oldfiles()<cr>]], { noremap = true, silent = true })
vim.api.nvim_set_keymap('n', '<leader>sd', [[<cmd>lua require('telescope.builtin').grep_string()<cr>]], { noremap = true, silent = true })
vim.api.nvim_set_keymap('n', '<leader>sp', [[<cmd>lua require('telescope.builtin').live_grep()<cr>]], { noremap = true, silent = true })
-- vim.api.nvim_set_keymap('n', '<leader>o', [[<cmd>lua require('telescope.builtin').tags{ only_current_buffer = true }<cr>]], { noremap = true, silent = true })
vim.api.nvim_set_keymap('n', '<leader>gco', [[<cmd>lua require('telescope.builtin').git_commits()<cr>]], { noremap = true, silent = true })
vim.api.nvim_set_keymap('n', '<leader>gb', [[<cmd>lua require('telescope.builtin').git_branches()<cr>]], { noremap = true, silent = true })
vim.api.nvim_set_keymap('n', '<leader>gs', [[<cmd>lua require('telescope.builtin').git_status()<cr>]], { noremap = true, silent = true })
vim.api.nvim_set_keymap('n', '<leader>gp', [[<cmd>lua require('telescope.builtin').git_bcommits()<cr>]], { noremap = true, silent = true })
vim.api.nvim_set_keymap('n', '<leader>m', [[<cmd>lua require('nvim-tree').toggle()<cr>]], { noremap = true, silent = true })
vim.api.nvim_set_keymap('n', '<leader>ng', [[<cmd>lua require('neogit').open({ kind = "split" })<cr>]], { noremap = true, silent = true })
vim.api.nvim_set_keymap('n', '<leader>nm', [[<cmd>lua require("telescope").extensions.metals.commands()<cr>]], { noremap = true, silent = true })
vim.api.nvim_set_keymap('n', '<leader>tt', [[<cmd>lua require("metals.tvp").toggle_tree_view()<cr>]], { noremap = true, silent = true })
vim.api.nvim_set_keymap('n', '<leader>tr', [[<cmd>lua require("metals.tvp").reveal_in_tree()<cr>]], { noremap = true, silent = true })
vim.api.nvim_set_keymap('n', '<leader>ws', [[<cmd>lua require"metals".worksheet_hover()<cr>]], { noremap = true, silent = true })
vim.api.nvim_set_keymap('n', '<leader>a', [[<cmd>lua RELOAD("metals").open_all_diagnostics()<cr>]], { noremap = true, silent = true })
vim.api.nvim_set_keymap('n', '<leader>nu', ':PackerUpdate<CR>', { noremap = true, silent = true })
vim.api.nvim_set_keymap('n', '<leader>si', [[<cmd>lua require('telescope').extensions.scaladex.scaladex.search()<cr>]], { noremap = true, silent = true })
-- Change preview window location
vim.g.splitbelow = true
-- Highlight on yank
vim.api.nvim_exec(
[[
augroup YankHighlight
autocmd!
autocmd TextYankPost * silent! lua vim.highlight.on_yank()
augroup end
]],
false
)
-- Y yank until the end of line
vim.api.nvim_set_keymap('n', 'Y', 'y$', { noremap = true })
--
-- LSP settings
local nvim_lsp = require 'lspconfig'
local on_attach = function(_client, bufnr)
require('lsp_signature').on_attach()
vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc')
local opts = { noremap = true, silent = true }
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gD', '<Cmd>lua vim.lsp.buf.declaration()<CR>', opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gd', '<Cmd>lua vim.lsp.buf.definition()<CR>', opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'K', '<Cmd>lua vim.lsp.buf.hover()<CR>', opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gm', '<cmd>lua vim.lsp.buf.implementation()<CR>', opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<C-k>', '<cmd>lua vim.lsp.buf.signature_help()<CR>', opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>wa', '<cmd>lua vim.lsp.buf.add_workspace_folder()<CR>', opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>wr', '<cmd>lua vim.lsp.buf.remove_workspace_folder()<CR>', opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>wl', '<cmd>lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<CR>', opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>D', '<cmd>lua vim.lsp.buf.type_definition()<CR>', opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>rn', '<cmd>lua vim.lsp.buf.rename()<CR>', opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gr', '<cmd>lua vim.lsp.buf.references()<CR>', opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>ca', '<cmd>lua vim.lsp.buf.code_action()<CR>', opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>e', '<cmd>lua vim.lsp.diagnostic.show_line_diagnostics()<CR>', opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', '[d', '<cmd>lua vim.lsp.diagnostic.goto_prev()<CR>', opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', ']d', '<cmd>lua vim.lsp.diagnostic.goto_next()<CR>', opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>q', '<cmd>lua vim.lsp.diagnostic.set_loclist()<CR>', opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'dr', [[<cmd>lua require('dap').repl.toggle()<cr>]], { noremap = true, silent = true })
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'ds', [[<cmd>lua require('dap').ui.variables.scopes()<cr>]], { noremap = true, silent = true })
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'dk', [[<cmd>lua require('dap').ui.widgets.hover()<cr>]], { noremap = true, silent = true })
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'dl', [[<cmd>lua require('dap').run_last()<cr>]], { noremap = true, silent = true })
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'dz', [[<cmd>lua require('dap').toggle_breakpoint()<cr>]], { noremap = true, silent = true })
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'dc', [[<cmd>lua require('dap').continue()<cr>]], { noremap = true, silent = true })
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<F7>', [[<cmd>lua require('dap').step_over()<cr>]], { noremap = true, silent = true })
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<F6>', [[<cmd>lua require('dap').step_out()<cr>]], { noremap = true, silent = true })
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<F5>', [[<cmd>lua require('dap').step_into()<cr>]], { noremap = true, silent = true })
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'B', [[<cmd>lua require('dap').set_breakpoint(vim.fn.input('Breakpoint condition: '))<cr>]], { noremap = true, silent = true })
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'lp', [[<cmd>lua require('dap').set_breakpoint(nil, nil, vim.fn.input('Log point message: '))<cr>]], { noremap = true, silent = true })
end
-- Enable the following language servers
local servers = { 'html', 'jdtls', 'jsonls', 'pyright', 'rnix', 'sourcekit', 'tsserver', 'yamlls' }
for _, lsp in ipairs(servers) do
nvim_lsp[lsp].setup { on_attach = on_attach }
end
-- lua language server
local sumneko_binary = vim.fn.getenv 'HOME' .. '/.nix-profile/bin/lua-language-server'
local runtime_path = vim.split(package.path, ';')
table.insert(runtime_path, 'lua/?.lua')
table.insert(runtime_path, 'lua/?/init.lua')
local luadev = require('lua-dev').setup{
lspconfig = {
cmd = { sumneko_binary },
commands = {
Format = {
function()
require('stylua-nvim').format_file()
end,
},
},
on_attach = on_attach,
settings = {
Lua = {
runtime = {
-- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim)
version = 'LuaJIT',
-- Setup your lua path
path = runtime_path,
},
diagnostics = {
-- Get the language server to recognize the `vim` global
globals = { 'vim' },
},
workspace = {
-- Make the server aware of Neovim runtime files
library = {
vim.api.nvim_get_runtime_file('', true),
},
},
-- Do not send telemetry data containing a randomized but unique identifier
telemetry = {
enable = false,
},
},
},
},
}
require('lspconfig').sumneko_lua.setup(luadev)
-- metals
-- vim.g.metals_server_version = '0.10.7+84-9d4bcf78-SNAPSHOT'
-- vim.opt_global.shortmess:remove('F'):append 'c'
local metals_config = require('metals').bare_config()
metals_config.settings = {
showImplicitArguments = true,
showInferredType = true,
bloopSbtAlreadyInstalled = true,
excludedPackages = {
"akka.actor.typed.javadsl",
"com.github.swagger.akka.javadsl",
"akka.stream.javadsl",
},
fallbackScalaVersion = "2.13.6",
superMethodLensesEnabled = true,
javaHome = "/Users/salar/.nix-profile"
}
metals_config.init_options.statusBarProvider = 'on'
metals_config.on_attach = function(client, bufnr)
vim.cmd([[autocmd CursorHold <buffer> lua vim.lsp.buf.document_highlight()]])
vim.cmd([[autocmd CursorMoved <buffer> lua vim.lsp.buf.clear_references()]])
vim.cmd([[autocmd BufEnter,CursorHold,InsertLeave <buffer> lua vim.lsp.codelens.refresh()]])
require("metals").setup_dap()
end
vim.cmd [[augroup lsp]]
vim.cmd [[au!]]
vim.cmd [[au FileType scala,sbt lua require("metals").initialize_or_attach(metals_config)]]
vim.cmd [[augroup end]]
-- Map :Format to vim.lsp.buf.formatting()
vim.cmd [[ command! Format execute 'lua vim.lsp.buf.formatting()' ]]
-- Set completeopt to have a better completion experience
vim.o.completeopt = 'menuone,noinsert'
-- Compe setup
require('compe').setup {
enabled = true,
autocomplete = true,
debug = false,
min_length = 1,
preselect = 'enable',
throttle_time = 80,
source_timeout = 200,
incomplete_delay = 400,
max_abbr_width = 100,
max_kind_width = 100,
max_menu_width = 100,
documentation = true,
source = {
path = true,
nvim_lsp = {
priority = 1000,
filetypes = { 'scala', 'sbt', 'java', 'python' },
},
nvim_lua = true,
buffer = true,
luasnip = true,
tabnine = true,
},
}
local t = function(str)
return vim.api.nvim_replace_termcodes(str, true, true, true)
end
local check_back_space = function()
local col = vim.fn.col '.' - 1
if col == 0 or vim.fn.getline('.'):sub(col, col):match '%s' then
return true
else
return false
end
end
-- Use (s-)tab to:
--- move to prev/next item in completion menuone
--- jump to prev/next snippet's placeholder
_G.tab_complete = function()
if vim.fn.pumvisible() == 1 then
return t '<C-n>'
elseif check_back_space() then
return t '<Tab>'
else
return vim.fn['compe#complete']()
end
end
_G.s_tab_complete = function()
if vim.fn.pumvisible() == 1 then
return t '<C-p>'
else
return t '<S-Tab>'
end
end
vim.api.nvim_set_keymap('i', '<Tab>', 'v:lua.tab_complete()', { expr = true })
vim.api.nvim_set_keymap('s', '<Tab>', 'v:lua.tab_complete()', { expr = true })
vim.api.nvim_set_keymap('i', '<S-Tab>', 'v:lua.s_tab_complete()', { expr = true })
vim.api.nvim_set_keymap('s', '<S-Tab>', 'v:lua.s_tab_complete()', { expr = true })
end
if fn.isdirectory(install_path) == 0 then
fn.system { 'git', 'clone', 'https://github.com/wbthomason/packer.nvim', install_path }
load_plugins()
require('packer').sync()
vim.cmd 'autocmd User PackerComplete ++once lua load_config()'
else
load_plugins()
_G.load_config()
end

View file

@ -1,197 +0,0 @@
local gl = require 'galaxyline'
local gls = gl.section
gl.short_line_list = { 'LuaTree', 'vista', 'dbui' }
local colors = {
bg = '#282c34',
yellow = '#fabd2f',
cyan = '#008080',
darkblue = '#081633',
green = '#afd700',
orange = '#FF8800',
purple = '#5d4d7a',
magenta = '#d16d9e',
grey = '#c0c0c0',
blue = '#0087d7',
red = '#ec5f67',
}
local buffer_not_empty = function()
if vim.fn.empty(vim.fn.expand '%:t') ~= 1 then
return true
end
return false
end
gls.left[1] = {
FirstElement = {
provider = function()
return ''
end,
highlight = { colors.blue, colors.yellow },
},
}
gls.left[2] = {
ViMode = {
provider = function()
local alias = { n = 'NORMAL', i = 'INSERT', c = 'COMMAND', v = 'VISUAL', V = 'VISUAL LINE', [''] = 'VISUAL BLOCK' }
return alias[vim.fn.mode()]
end,
separator = '',
separator_highlight = {
colors.purple,
function()
if not buffer_not_empty() then
return colors.purple
end
return colors.darkblue
end,
},
highlight = { colors.darkblue, colors.purple, 'bold' },
},
}
gls.left[3] = {
FileIcon = {
provider = 'FileIcon',
condition = buffer_not_empty,
highlight = { require('galaxyline.provider_fileinfo').get_file_icon_color, colors.darkblue },
},
}
gls.left[4] = {
FileName = {
provider = { 'FileName', 'FileSize' },
condition = buffer_not_empty,
separator = '',
separator_highlight = { colors.purple, colors.darkblue },
highlight = { colors.magenta, colors.darkblue },
},
}
gls.left[5] = {
GitIcon = {
provider = function()
return ''
end,
condition = buffer_not_empty,
highlight = { colors.orange, colors.purple },
},
}
gls.left[6] = {
GitBranch = {
provider = 'GitBranch',
condition = buffer_not_empty,
highlight = { colors.grey, colors.purple },
},
}
local checkwidth = function()
local squeeze_width = vim.fn.winwidth(0) / 2
if squeeze_width > 40 then
return true
end
return false
end
gls.left[7] = {
DiffAdd = {
provider = 'DiffAdd',
condition = checkwidth,
icon = '',
highlight = { colors.green, colors.purple },
},
}
gls.left[8] = {
DiffModified = {
provider = 'DiffModified',
condition = checkwidth,
icon = '',
highlight = { colors.orange, colors.purple },
},
}
gls.left[9] = {
DiffRemove = {
provider = 'DiffRemove',
condition = checkwidth,
icon = '',
highlight = { colors.red, colors.purple },
},
}
gls.left[10] = {
LeftEnd = {
provider = function()
return ''
end,
separator = '',
separator_highlight = { colors.purple, colors.bg },
highlight = { colors.purple, colors.purple },
},
}
gls.left[11] = {
DiagnosticError = {
provider = 'DiagnosticError',
icon = '',
highlight = { colors.red, colors.bg },
},
}
gls.left[12] = {
Space = {
provider = function()
return ' '
end,
},
}
gls.left[13] = {
DiagnosticWarn = {
provider = 'DiagnosticWarn',
icon = '',
highlight = { colors.blue, colors.bg },
},
}
gls.right[1] = {
FileFormat = {
provider = 'FileFormat',
separator = '',
separator_highlight = { colors.bg, colors.purple },
highlight = { colors.grey, colors.purple },
},
}
gls.right[2] = {
LineInfo = {
provider = 'LineColumn',
separator = ' | ',
separator_highlight = { colors.darkblue, colors.purple },
highlight = { colors.grey, colors.purple },
},
}
gls.right[3] = {
PerCent = {
provider = 'LinePercent',
separator = '',
separator_highlight = { colors.darkblue, colors.purple },
highlight = { colors.grey, colors.darkblue },
},
}
gls.right[4] = {
ScrollBar = {
provider = 'ScrollBar',
highlight = { colors.yellow, colors.purple },
},
}
gls.short_line_left[1] = {
BufferType = {
provider = 'FileTypeName',
separator = '',
separator_highlight = { colors.purple, colors.bg },
highlight = { colors.grey, colors.purple },
},
}
gls.short_line_right[1] = {
BufferIcon = {
provider = 'BufferIcon',
separator = '',
separator_highlight = { colors.purple, colors.bg },
highlight = { colors.grey, colors.purple },
},
}

View file

@ -1,8 +1,7 @@
{ config, pkgs, ... }:
{ pkgs, ... }:
let
tmuxConfig = builtins.readFile ./tmux.conf;
in
{
programs.tmux = {
@ -23,16 +22,9 @@ in
plugin = tmuxPlugins.continuum;
extraConfig = "set -g @continuum-restore 'on'";
}
{
plugin = tmuxPlugins.sensible;
}
{
plugin = tmuxPlugins.vim-tmux-navigator;
}
{
plugin = tmuxPlugins.onedark-theme;
}
{ plugin = tmuxPlugins.sensible; }
{ plugin = tmuxPlugins.vim-tmux-navigator; }
{ plugin = tmuxPlugins.onedark-theme; }
];
};
}

View file

@ -0,0 +1,73 @@
{ pkgs, ... }:
let
myExtensions = with pkgs.vscode-extensions; [
asvetliakov.vscode-neovim
baccata.scaladex-search
davidanson.vscode-markdownlint
enkia.tokyo-night
github.copilot
github.copilot-chat
github.github-vscode-theme
github.vscode-github-actions
github.vscode-pull-request-github
humao.rest-client
jnoortheen.nix-ide
marp-team.marp-vscode
mechatroner.rainbow-csv
mkhl.direnv
ms-python.python
ms-python.vscode-pylance
ms-vscode.makefile-tools
ms-toolsai.jupyter
redhat.java
redhat.vscode-yaml
rust-lang.rust-analyzer
scalameta.metals
skyapps.fish-vscode
sswg.swift-lang
svsool.markdown-memo
timonwong.shellcheck
usernamehw.errorlens
visualstudioexptteam.vscodeintellicode
vscode-icons-team.vscode-icons
vscjava.vscode-java-pack
xyz.local-history
yzhang.markdown-all-in-one
];
myUserSettings = {
"editor.fontFamily" = "SF Mono";
"editor.fontLigatures" = true;
"editor.fontSize" = 13;
"editor.copyWithSyntaxHighlighting" = true;
"extensions.experimental.affinity" = {
"asvetliakov.vscode-neovim" = 1;
};
"files.autoSave" = "afterDelay";
"git.autoSave" = "afterDelay";
"git.rebaseWhenSync" = true;
"github.gitProtocol" = "ssh";
"githubPullRequests.notifications" = "pullRequests";
"githubPullRequests.pullBranch" = "never";
"markdown.extension.preview.autoShowPreviewToSide" = true;
# Install paste image manually as not in nix ( https://marketplace.visualstudio.com/items?itemName=mushan.vscode-paste-image )
"pasteImage.insertPattern" = "![[\${imageFileName}]]";
"pasteImage.path" = "\${projectRoot}/Attachments";
"python.analysis.extraPaths" = [ "src" ];
"telemetry.telemetryLevel" = "off";
"window.openFoldersInNewWindow" = "on";
"workbench.colorTheme" = "Tokyo Night";
"workbench.iconTheme" = "vscode-icons";
"workbench.sideBar.location" = "right";
};
in
{
programs.vscode = {
enable = true;
enableUpdateCheck = false;
enableExtensionUpdateCheck = false;
mutableExtensionsDir = false;
extensions = myExtensions;
userSettings = myUserSettings;
};
}

View file

@ -0,0 +1,11 @@
{ ... }:
let
weztermConfig = builtins.readFile ./wezterm.lua;
in
{
programs.wezterm = {
enable = true;
extraConfig = weztermConfig;
};
}

View file

@ -0,0 +1,170 @@
local wezterm = require 'wezterm'
local mux = wezterm.mux
local act = wezterm.action
local function is_vim(pane)
-- this is set by the plugin, and unset on ExitPre in Neovim
return pane:get_user_vars().IS_NVIM == 'true'
end
local direction_keys = {
a = 'Left',
o = 'Down',
e = 'Up',
u = 'Right',
}
local function split_nav(resize_or_move, key)
return {
key = key,
mods = resize_or_move == 'resize' and 'META' or 'CTRL',
action = wezterm.action_callback(function(win, pane)
if is_vim(pane) then
-- pass the keys through to vim/nvim
win:perform_action({
SendKey = { key = key, mods = resize_or_move == 'resize' and 'META' or 'CTRL' },
}, pane)
else
if resize_or_move == 'resize' then
win:perform_action({ AdjustPaneSize = { direction_keys[key], 3 } }, pane)
else
win:perform_action({ ActivatePaneDirection = direction_keys[key] }, pane)
end
end
end),
}
end
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 = "Gruvbox Light";
color_scheme = 'tokyonight',
default_gui_startup_args = { 'connect', 'unix' },
font = wezterm.font 'SF Mono',
font_size = 16,
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' },
ssh_domains = {
{
name = 'hcloud1',
remote_address = 'hcloud1.softinio.net',
username = 'salar',
remote_wezterm_path = '/run/current-system/sw/bin/wezterm',
},
},
unix_domains = {
{
name = 'unix',
},
},
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.ToggleFullScreen },
{ 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 = '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 },
-- move between split panes
split_nav('move', 'a'),
split_nav('move', 'o'),
split_nav('move', 'e'),
split_nav('move', 'u'),
-- resize panes
split_nav('resize', 'a'),
split_nav('resize', 'o'),
split_nav('resize', 'e'),
split_nav('resize', 'u'),
},
-- temp fix
front_end = 'WebGpu',
}

27
programs/zed/default.nix Normal file
View file

@ -0,0 +1,27 @@
{ ... }:
let
myextensions = [
"fish"
"lua"
"nix"
"ruff"
"scala"
"sql"
"swift"
"toml"
];
in
{
programs.zed-editor = {
enable = true;
extensions = myextensions;
userSettings = {
features = {
copilot = true;
};
telemetry.metrics = false;
theme = "Andromeda";
vim_mode = true;
};
};
}