feat: update tmux config

This commit is contained in:
2022-02-07 18:28:02 +08:00
parent 60d01008b6
commit 4bc52a1432
3 changed files with 35 additions and 23 deletions
+2
View File
@@ -117,3 +117,5 @@ export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
export PATH="/usr/local/sbin:$PATH" export PATH="/usr/local/sbin:$PATH"
# add nvim # add nvim
export PATH=$PATH:/usr/local/nvim/bin:/usr/local/osx-64/nvim/bin export PATH=$PATH:/usr/local/nvim/bin:/usr/local/osx-64/nvim/bin
# https://github.com/julienXX/terminal-notifier
alias alert='terminal-notifier -title "Terminal" -message "Done with task! Exit status: $?"' -activate com.apple.Terminal
+22 -23
View File
@@ -1,28 +1,27 @@
[user] [user]
name = Laily name = Laily
email = i@laily.net email = i@laily.net
[core] [core]
autocrlf = input autocrlf = input
quotepath = false quotepath = false
editor = /usr/local/bin/nvim editor = /usr/local/bin/nvim
excludesfile = ~/.dotfile/git/.gitignore excludesfile = ~/.dotfile/git/.gitignore
[alias] [alias]
au = add -u au = add -u
co = checkout co = checkout
cm = commit -m cm = commit -m
st = status st = status
ap = add -p ap = add -p
br = branch br = branch
pl = pull pl = pull
pt = push origin --tags pt = push origin --tags
merge2 = "!f() { git checkout $1 && git merge $2 && git checkout -; }; f" merge2 = "!f() { git checkout $1 && git merge $2 && git checkout -; }; f"
bg = "!f() { git branch | grep $1; }; f" bg = "!f() { git branch | grep $1; }; f"
delbr = "!f(){ git branch -D `git branch | grep \"\b$1\"`; };f" delbr = "!f(){ git branch -D $(git branch | grep \"\b$1\"); };f"
can = commit --amend --no-edit can = commit --amend --no-edit
[push] [push]
default = current default = current
[merge] [merge]
tool = vimdiff tool = vimdiff
[include]
path = ~/.subgitconfig
+11
View File
@@ -36,10 +36,12 @@ class Installer(Base):
exit() exit()
install_map = { install_map = {
"brew": self.install_brew,
"neovim": self.install_neovim, "neovim": self.install_neovim,
"z": self.install_z, "z": self.install_z,
"git": self.install_git, "git": self.install_git,
"go": self.install_go, "go": self.install_go,
"tmux": self.init_tmux,
} }
if val in install_map: if val in install_map:
install_map.get(val)() install_map.get(val)()
@@ -75,6 +77,15 @@ class Installer(Base):
os.chdir(cwd) os.chdir(cwd)
run("go install golang.org/x/tools/gopls@latest") run("go install golang.org/x/tools/gopls@latest")
def install_brew(self):
run("/bin/bash -c \"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)\"")
def init_tmux(self):
self.check_link(home_dir+"/.tmux.conf",
home_dir+"/.dotfile/.tmux.conf")
if not os.path.exists(home_dir+"/.tmux/plugins/tmux-resurrect"):
run("git clone --depth=1 https://github.com/tmux-plugins/tmux-resurrect %s/.tmux/plugins/tmux-resurrect" % (home_dir))
class Base(object): class Base(object):
def cmd_exist(self, name): def cmd_exist(self, name):