Skip to content

Commit

Permalink
chore: updates
Browse files Browse the repository at this point in the history
  • Loading branch information
tmm committed Nov 8, 2023
1 parent d95b661 commit f51b8aa
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 277 deletions.
2 changes: 1 addition & 1 deletion .config/macos/com.awkweb.sync_system_appearance.plist
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<key>ProgramArguments</key>
<array>
<string>/usr/local/bin/sync_system_appearance</string>
<string>/opt/homebrew/bin/fish</string>
<string>/etc/profiles/per-user/tmm/bin/fish</string>
<string>-c</string>
<string>change_appearance</string>
</array>
Expand Down
Binary file removed .config/nix/files/.DS_Store
Binary file not shown.
5 changes: 4 additions & 1 deletion .config/nix/files/fish/functions/change_appearance.fish
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,14 @@ function change_appearance --argument appearance_setting
end
end

# change and reload ghostty appearance
# https://github.com/mitchellh/ghostty/issues/601

# change tmux
# switch $appearance
# case dark
# tmux source-file ~/.tmux/tmux-dark.conf
# case light
# tmux source-file ~/.tmux/tmux-light.conf
# end
end
end
3 changes: 3 additions & 0 deletions .config/nix/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
useUserPackages = true;
users.tmm.imports = [
./modules/home-manager.nix
./modules/ghostty.nix
./modules/git.nix
./modules/shell.nix
];
};
}
Expand Down
166 changes: 3 additions & 163 deletions .config/nix/modules/home-manager.nix
Original file line number Diff line number Diff line change
Expand Up @@ -21,177 +21,17 @@
EDITOR = "nvim";
};

programs.bat = {
enable = true;
};

programs.bat.enable = true;
programs.direnv = {
enable = true;
config = {
load_dotenv = true;
};
};

programs.eza = {
enable = true;
};

# Let Home Manager install and manage itself.
programs.eza.enable = true;
programs.gh.enable = true;
programs.home-manager.enable = true;

programs.fish = {
enable = true;
interactiveShellInit = ''
# Pure
# https://github.com/rafaelrinaldi/pure#configuration
set pure_color_primary white
set pure_color_success green
# Add `pg_config` to path
# https://fishshell.com/docs/current/tutorial.html?highlight=fish_user_path#path
set PG_CONFIG /Applications/Postgres.app/Contents/Versions/latest/bin
fish_add_path $PG_CONFIG
# Set homebrew path
switch (arch)
case arm64
set BREW /opt/homebrew/bin
case x86_64
set BREW /usr/local/bin
end
fish_add_path $BREW
fnm env | source
zoxide init fish | source
set -gx PNPM_HOME "$HOME/.local/share/pnpm"
set -gx PATH "$PNPM_HOME" $PATH
set -gx FOUNDRY_DIR "$HOME/.foundry"
set -gx PATH "$FOUNDRY_DIR" $PATH
set FOUNDRY_BIN $HOME/.foundry/bin
fish_add_path $FOUNDRY_BIN
# bun
set --export BUN_INSTALL "$HOME/.bun"
set --export PATH $BUN_INSTALL/bin $PATH
'';
plugins = [
# https://github.com/jorgebucaran/autopair.fish
{
name = "autopair.fish";
src = pkgs.fetchFromGitHub {
owner = "jorgebucaran";
repo = "autopair.fish";
rev = "4d1752ff5b39819ab58d7337c69220342e9de0e2";
sha256 = "sha256-s1o188TlwpUQEN3X5MxUlD/2CFCpEkWu83U9O+wg3VU=";
};
}
# https://github.com/jethrokuan/fzf
{
name = "fzf";
src = pkgs.fetchFromGitHub {
owner = "jethrokuan";
repo = "fzf";
rev = "479fa67d7439b23095e01b64987ae79a91a4e283";
sha256 = "sha256-28QW/WTLckR4lEfHv6dSotwkAKpNJFCShxmKFGQQ1Ew=";
};
}
# https://github.com/pure-fish/pure
{
name = "pure";
src = pkgs.fetchFromGitHub {
owner = "pure-fish";
repo = "pure";
rev = "f1b2c7049de3f5cb45e29c57a6efef005e3d03ff";
sha256 = "1x1h65l8582p7h7w5986sc9vfd7b88a7hsi68dbikm090gz8nlxx";
};
}
];
shellAbbrs = {
b = "bun";
df = "h git";
g = "git";
hm = "home-manager";
home = "cd ~";
lsd = "eza -d .*";
p = "pnpm";
t = "tmux";
v = "nvim";

tn = "tmux new -s";
ta = "tmux a -t";
tks = "tmux kill-server";
tls = "tmux ls";
};
shellAliases = {
cat = "bat --style=numbers,changes --theme=\$(defaults read -globalDomain AppleInterfaceStyle &> /dev/null && echo tokyonight_night || echo tokyonight_day)";
find = "fd";
fup = "echo $fish_user_paths | tr \" \" \"\n\" | nl";
h = "env GIT_WORK_TREE=$HOME GIT_DIR=$HOME/.files";
ls = "eza";
reload = "exec $SHELL -l";
vim = "nvim";
hide = "defaults write com.apple.finder AppleShowAllFiles -bool false && killall Finder";
show = "defaults write com.apple.finder AppleShowAllFiles -bool true && killall Finder";

nconf = "nvim ~/.config/nix/flake.nix";
vconf = "nvim ~/.config/nvim/init.lua";
drs = "darwin-rebuild switch --flake ~/.config/nix/";

hidedesktop = "defaults write com.apple.finder CreateDesktop -bool false && killall Finder";
showdesktop = "defaults write com.apple.finder CreateDesktop -bool true && killall Finder";
};
};

programs.git = {
enable = true;

aliases = {
a = "add";
aa = "add .";
au = "add --update";
b = "branch";
c = "commit -m";
cn = "commit --no-verify -m";
ch = "checkout";
l = "log";
p = "push";
pf = "push --force";
pl = "pull";
s = "status";

amend = "commit --amend --reuse-message=HEAD";
go = "!go() { git checkout -b $1 2> /dev/null || git checkout $1; }; go";
hist = "log --pretty=oneline --pretty=format:'%Cred%h%Creset %C(yellow)%an%Creset %s%C(normal dim)%d%Creset %Cgreen(%cr)%Creset' --date=relative --abbrev-commit";
monkeys = "shortlog --summary --numbered";
undo = "reset --soft HEAD^";
unstage = "reset HEAD --";
};
userName = "Tom Meagher";
userEmail = "tom@meagher.co";

extraConfig = {
color.ui = "auto";
commit.gpgsign = true;
core = {
editor = "nvim";
excludesfile = "~/.config/git/ignore_global";
pager = "diff-so-fancy | less --tabs=4 -RFX";
};
credential.helper = "osxkeychain";
github.user = "tmm";
gpg = {
format = "ssh";
ssh.program = "/Applications/1Password.app/Contents/MacOS/op-ssh-sign";
};
init.defaultBranch = "main";
push.default = "current";
user.signingkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHLwl9HCwJ1+kNCbrx3N15oIcNfW7SgZBTFlmQnQEVn4";
};
};

xdg = {
enable = true;
configFile = {
Expand Down
128 changes: 21 additions & 107 deletions .config/nvim/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -314,74 +314,6 @@ vim.opt.runtimepath:prepend(lazypath)
require("lazy").setup({
defaults = { lazy = true },

-- bufferline.nvim (https://github.com/akinsho/bufferline.nvim)
{
"akinsho/bufferline.nvim",
event = "VeryLazy",
keys = {
{ "<leader>bp", "<Cmd>BufferLineTogglePin<CR>", desc = "Toggle pin" },
{ "<leader>bP", "<Cmd>BufferLineGroupClose ungrouped<CR>", desc = "Delete non-pinned buffers" },
{ "[b", "<cmd>BufferLineCyclePrev<cr>", desc = "Prev buffer" },
{ "]b", "<cmd>BufferLineCycleNext<cr>", desc = "Next buffer" },
{ "gb", "<cmd>BufferLinePick<cr>", desc = "Pick buffer" },
{ "bD", "<cmd>BufferLinePickClose<cr>", desc = "Delete buffer (pick)" },
},
opts = function()
local c = require("tokyonight.colors").setup()
return {
highlights = {
background = { bg = c.bg_dark },
buffer_selected = { bg = c.bg },
buffer_visible = { bg = c.bg_dark },
close_button = { bg = c.bg_dark },
diagnostic = { bg = c.bg_dark },
error = { bg = c.bg_dark },
error_diagnostic = { bg = c.bg_dark },
fill = { bg = c.bg_dark },
indicator_selected = { bg = c.bg_dark },
indicator_visible = { bg = c.bg_dark },
modified = { bg = c.bg_dark, fg = c.comment },
modified_visible = { bg = c.bg_dark, fg = c.comment },
modified_selected = { bg = c.bg, fg = c.comment },
offset_separator = { bg = c.bg_dark },
separator = { bg = c.bg_dark },
tab = { bg = c.bg_dark },
tab_close = { bg = c.bg_dark },
tab_selected = { bg = c.bg_dark },
tab_separator_selected = { bg = c.bg_dark },
},
options = {
always_show_bufferline = false,
diagnostics = "nvim_lsp",
indicator = "none",
diagnostics_indicator = function(_, _, diag)
local ret = (diag.error and icons.diagnostics.Error .. diag.error .. " " or "")
.. (diag.warning and icons.diagnostics.Warn .. diag.warning or "")
return vim.trim(ret)
end,
offsets = {
{
filetype = "neo-tree",
text = "Neo-tree",
highlight = "NeoTreeNormal",
text_align = "left",
separator = true,
},
},
separator_style = { " ", " " },
show_buffer_icons = true,
themable = true,
close_command = function(n)
require("mini.bufremove").delete(n, false)
end,
right_mouse_command = function(n)
require("mini.bufremove").delete(n, false)
end,
},
}
end,
},

-- dressing.nvim (https://github.com/stevearc/dressing.nvim)
{
"stevearc/dressing.nvim",
Expand Down Expand Up @@ -1218,35 +1150,17 @@ require("lazy").setup({
end,
},

-- tokyonight (https://github.com/folke/tokyonight)
-- rasmus.nvim (https://github.com/kvrohit/rasmus.nvim)
{
"folke/tokyonight.nvim",
"kvrohit/rasmus.nvim",
lazy = false,
opts = {
style = "night",
styles = {
sidebars = "dark",
floats = "dark",
},
on_colors = function(c)
if vim.o.background == "light" then
c.bg = ""
end
end,
on_highlights = function(hl, c)
-- neo-tree
hl.NeoTreeDirectoryIcon = { fg = c.comment }
hl.NeoTreeModified = { fg = c.comment }
hl.NeoTreeWinSeparator = { fg = c.fg_gutter, bg = c.bg_sidebar }
-- telescope
hl.TelescopeBorder = { fg = c.fg_gutter, bg = c.bg_float }
-- misc
hl.MsgArea = { bg = c.bg_dark }
hl.WinSeparator = { fg = c.fg_gutter, bold = true }
end,
},
config = function(_, opts)
require("tokyonight").load(opts)
config = function()
vim.g.rasmus_italic_comments = false
vim.g.rasmus_italic_keywords = false
vim.g.rasmus_italic_booleans = false
vim.g.rasmus_italic_functions = false
vim.g.rasmus_italic_variables = false
vim.cmd([[colorscheme rasmus]])
end,
},

Expand Down Expand Up @@ -1286,6 +1200,18 @@ require("lazy").setup({
end,
},

-- vim-tmux-navigator (https://github.com/christoomey/vim-tmux-navigator)
{
"christoomey/vim-tmux-navigator",
event = "VeryLazy",
config = function()
vim.g.tmux_navigator_disable_when_zoomed = 1
vim.g.tmux_navigator_save_on_switch = 2
vim.g.VtrOrientation = "v"
vim.g.VtrPercentage = 20
end,
},

-- vim-illuminate (https://github.com/RRethy/vim-illuminate)
{
"RRethy/vim-illuminate",
Expand Down Expand Up @@ -1336,18 +1262,6 @@ require("lazy").setup({
event = "VeryLazy",
},

-- vim-tmux-navigator (https://github.com/christoomey/vim-tmux-navigator)
{
"christoomey/vim-tmux-navigator",
event = "VeryLazy",
config = function()
vim.g.tmux_navigator_disable_when_zoomed = 1
vim.g.tmux_navigator_save_on_switch = 2
vim.g.VtrOrientation = "v"
vim.g.VtrPercentage = 20
end,
},

-- which-key (https://github.com/folke/which-key.nvim)
{
"folke/which-key.nvim",
Expand Down
Loading

0 comments on commit f51b8aa

Please sign in to comment.