Signed-off-by: Lee Tang <i@d0zingcat.dev>
This commit is contained in:
Lee Tang
2022-10-27 11:51:46 +08:00
parent a98af94a5b
commit 36c2fc4c5c
4 changed files with 37 additions and 24 deletions

30
.zshrc
View File

@@ -73,7 +73,6 @@ alias kns='kubens'
alias kctx='kubectx' alias kctx='kubectx'
alias kd='kubectl debug' alias kd='kubectl debug'
alias kk='kubectl krew' alias kk='kubectl krew'
alias vim='nvim'
alias vi='nvim' alias vi='nvim'
alias wol_xps8940="host home.d0zingcat.xyz | cut -d ' ' -f 4 | cat | xargs -I {} wakeonlan -i {} -p 200 'FC:44:82:13:BA:0F'" alias wol_xps8940="host home.d0zingcat.xyz | cut -d ' ' -f 4 | cat | xargs -I {} wakeonlan -i {} -p 200 'FC:44:82:13:BA:0F'"
#alias nerdctl='lima nerdctl' #alias nerdctl='lima nerdctl'
@@ -134,22 +133,35 @@ function klogs() {
k get pods --sort-by=.metadata.creationTimestamp | grep "$keyword" | head -n 1 | awk '{print $1}' | xargs kubectl logs -f k get pods --sort-by=.metadata.creationTimestamp | grep "$keyword" | head -n 1 | awk '{print $1}' | xargs kubectl logs -f
} }
function rsync_debank() { function rsync_work() {
local_debank=`pwd` remote_dir="/home/tangli"
local_work=`pwd`
local_dir=${PWD##*/} local_dir=${PWD##*/}
local_dir=${local_dir:-/} local_dir=${local_dir:-/}
if [ $# -eq 0 ]; then if [ $# -eq 0 ]; then
remote_debank="aws-optimus-1:/home/tangli/$local_dir" remote_work="aws-optimus-1:$remote_dir/$local_dir"
elif [ $# -eq 1 ]; then elif [ $# -eq 1 ]; then
remote_debank="aws-optimus-$1:/home/tangli/$local_dir" remote_work="aws-optimus-$1:$remote_dir/$local_dir"
elif [ $# -eq 2 ]; then
remote_work="aws-optimus-$1:$remote_dir/$local_dir"
if [ "$2" = "back" ]; then
# swap local and remote
t=$local_work
local_work=$remote_work
remote_work=$t
else
echo "Invalid argument! should be 'back'"
exit(1)
fi
else else
echo 'error!' echo "invalid argument!"
exit(1)
fi fi
rsync_exclude="$local_debank/rsync_exclude.txt" rsync_exclude="$local_work/rsync_exclude.txt"
if [ -f $rsync_exclude ]; then if [ -f $rsync_exclude ]; then
rsync -r -h -v --exclude-from=$rsync_exclude --exclude=/venv --exclude=/.vscode --exclude=/.git $local_debank/ $remote_debank rsync -r -h -v --exclude-from=$rsync_exclude --exclude=/venv --exclude=/.vscode --exclude=/.git $local_work/ $remote_work
else else
rsync -r -h -v --exclude=/venv --exclude=/.vscode --exclude=/.git $local_debank/ $remote_debank rsync -r -h -v --exclude=/venv --exclude=/.vscode --exclude=/.git $local_work/ $remote_work
fi fi
} }

View File

@@ -41,15 +41,13 @@ local servers = {
pylsp = {}, pylsp = {},
rust_analyzer = { rust_analyzer = {
server = { settings = {
settings = { ['rust-analyzer'] = {
['rust-analyzer'] = { cargo = {
cargo = { loadOutDirsFromCheck = true,
loadOutDirsFromCheck = true, },
}, procMacro = {
procMacro = { enable = true,
enable = true,
},
}, },
}, },
}, },
@@ -61,6 +59,11 @@ local servers = {
end, end,
}, },
}), }),
beancount = {
init_options = {
journal_file = "",
}
}
} }
local settings = { local settings = {

View File

@@ -24,7 +24,7 @@ cmp.setup({
mapping = cmp.mapping.preset.insert({ mapping = cmp.mapping.preset.insert({
['<C-b>'] = cmp.mapping.scroll_docs(-4), ['<C-b>'] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4), ['<C-f>'] = cmp.mapping.scroll_docs(4),
['<C-Space>'] = cmp.mapping.complete(), ['<C-e>'] = cmp.mapping.complete(),
--["<C-e>"] = cmp.mapping.close(), --["<C-e>"] = cmp.mapping.close(),
-- ['<C-e>'] = function(fallback) -- ['<C-e>'] = function(fallback)
-- fallback() -- fallback()
@@ -34,12 +34,10 @@ cmp.setup({
select = true, select = true,
}), }),
['<C-y>'] = cmp.mapping.confirm({ select = true }), ['<C-y>'] = cmp.mapping.confirm({ select = true }),
-- ['<C-n>'] = cmp.mapping.select_next_item(),
-- ['<C-p>'] = cmp.mapping.select_prev_item(),
--}, --},
}), }),
--mapping = {
----['<C-n>'] = cmp.mapping.select_next_item(),
----['<C-p>'] = cmp.mapping.select_prev_item(),
sources = { sources = {
{ name = 'nvim_lsp' }, { name = 'nvim_lsp' },
{ name = 'buffer' }, { name = 'buffer' },

View File

@@ -182,7 +182,7 @@ function recover() {
} }
function post_recover() { function post_recover() {
mkdir -p ~/.1password && ln -s ~/Library/Group\ Containers/2BUA8C4S2C.com.1password/t/agent.sock ~/.1password/agent.sock mkdir -p ~/.1password && ln -s /Users/d0zingcat/Library/Group\ Containers/2BUA8C4S2C.com.1password/t/agent.sock /Users/d0zingcat/.1password/agent.sock
} }
option=$1 option=$1