fix: merge
This commit is contained in:
@@ -6,3 +6,4 @@ _set_env_*.sh
|
||||
_set_env.sh
|
||||
log
|
||||
cn.sh
|
||||
__pycache__
|
||||
|
||||
+61
-22
@@ -1,6 +1,10 @@
|
||||
|
||||
#################################################################
|
||||
# option
|
||||
fish_vi_key_bindings
|
||||
|
||||
|
||||
#################################################################
|
||||
# basic
|
||||
# 定义一个函数来检查并添加路径到 PATH
|
||||
function add_to_path
|
||||
# 遍历传递给函数的所有参数
|
||||
@@ -20,18 +24,49 @@ function add_to_path
|
||||
end
|
||||
end
|
||||
|
||||
## set environment
|
||||
# default
|
||||
function refish
|
||||
echo "Updating fish configuration..."
|
||||
source ~/.config/fish/config.fish
|
||||
echo "Fish configuration updated!"
|
||||
end
|
||||
|
||||
# set environment
|
||||
set paths_to_check /usr/sbin /usr/local/bin /usr/bin /bin /usr/sbin /sbin /opt/bin /opt/sbin /usr/syno/sbin /usr/syno/bin /usr/local/sbin
|
||||
for path in $paths_to_check
|
||||
add_to_path $path
|
||||
end
|
||||
|
||||
function sudoo
|
||||
eval sudo $history[1]
|
||||
end
|
||||
|
||||
# add my script
|
||||
add_to_path $HOME/.dotfile/script $HOME/.app00/script
|
||||
|
||||
if test -f ~/.config/fish/custom.fish
|
||||
source ~/.config/fish/custom.fish
|
||||
end
|
||||
|
||||
function reset_proxy
|
||||
set -e http_proxy
|
||||
set -e https_proxy
|
||||
set -e ftp_proxy
|
||||
set -e all_proxy
|
||||
set -e HTTP_PROXY
|
||||
set -e HTTPS_PROXY
|
||||
set -e FTP_PROXY
|
||||
set -e ALL_PROXY
|
||||
echo "Proxy environment variables have been reset."
|
||||
end
|
||||
|
||||
|
||||
#################################################################
|
||||
# brew
|
||||
set -gx HOMEBREW_BREW_GIT_REMOTE "https://mirrors.ustc.edu.cn/brew.git"
|
||||
set -gx HOMEBREW_CORE_GIT_REMOTE "https://mirrors.ustc.edu.cn/homebrew-core.git"
|
||||
set -gx HOMEBREW_BOTTLE_DOMAIN "https://mirrors.ustc.edu.cn/homebrew-bottles"
|
||||
|
||||
#################################################################
|
||||
# go
|
||||
set -gx GOPATH $HOME/go:$HOME/workrepo/go
|
||||
set -gx GOPROXY "goproxy.cn,direct"
|
||||
@@ -39,18 +74,35 @@ set -gx GOSUMDB "sum.golang.google.cn"
|
||||
add_to_path $HOME/go/bin
|
||||
add_to_path $HOME/.yarn/bin $HOME/.config/yarn/global/node_modules/.bin
|
||||
|
||||
|
||||
#################################################################
|
||||
# node
|
||||
add_to_path /usr/local/node/bin
|
||||
|
||||
# add nvim
|
||||
|
||||
#################################################################
|
||||
# python
|
||||
set -gx PYENV_ROOT $HOME/.pyenv
|
||||
# Pyenv initialization
|
||||
if command -v pyenv 1>/dev/null 2>&1
|
||||
pyenv init - | source
|
||||
end
|
||||
|
||||
add_to_path $PYENV_ROOT/bin
|
||||
|
||||
|
||||
#################################################################
|
||||
# nvim
|
||||
add_to_path usr/local/nvim/bin /usr/local/osx-64/nvim/bin
|
||||
set -gx EDITOR vim
|
||||
function gtr
|
||||
go test -gcflags=all=-l -v -run=$argv
|
||||
end
|
||||
|
||||
# add my script
|
||||
add_to_path $HOME/.dotfile/script $HOME/.app00/script
|
||||
|
||||
# alias
|
||||
#################################################################
|
||||
# git
|
||||
# alias
|
||||
alias gitb="git branch --show-current | tr -d '\n' | pbcopy"
|
||||
alias gci="golangci-lint run -c=~/.dotfile/.golangci.yml ./..."
|
||||
alias gmt="go mod tidy"
|
||||
@@ -60,26 +112,13 @@ alias sws="swagger serve -F=swagger"
|
||||
alias sourceit="source ~/.config/fish/config.fish"
|
||||
|
||||
|
||||
function gtr
|
||||
go test -gcflags=all=-l -v -run=$argv
|
||||
end
|
||||
|
||||
#################################################################
|
||||
# other
|
||||
function ctl
|
||||
systemctl $argv
|
||||
end
|
||||
|
||||
|
||||
if test -f ~/.config/fish/custom.fish
|
||||
source ~/.config/fish/custom.fish
|
||||
end
|
||||
|
||||
|
||||
|
||||
if status is-interactive
|
||||
# Commands to run in interactive sessions can go here
|
||||
end
|
||||
|
||||
|
||||
function sudoo
|
||||
eval sudo $history[1]
|
||||
end
|
||||
|
||||
@@ -49,6 +49,7 @@
|
||||
# list files which have changed since REVIEW_BASE
|
||||
# (REVIEW_BASE defaults to 'master' in my zshrc)
|
||||
files = !git diff --name-only $(git merge-base HEAD \"$REVIEW_BASE\")
|
||||
rmsubmodule = "!f(){ git submodule deinit -f \"$1\"; git rm -f \"$1\"; git commit -m \"Removed submodule $1\"; };f"
|
||||
|
||||
# Same as above, but with a diff stat instead of just names
|
||||
# (better for interactive use)
|
||||
|
||||
+6459
-855
File diff suppressed because it is too large
Load Diff
+57
-65
@@ -1,74 +1,66 @@
|
||||
{
|
||||
"FixCursorHold.nvim": { "branch": "master", "commit": "1900f89dc17c603eec29960f57c00bd9ae696495" },
|
||||
"LazyVim": { "branch": "main", "commit": "530e94a9fa19577401e968a9673282c3d79f01e3" },
|
||||
"LuaSnip": { "branch": "master", "commit": "b152822e1a4bafb6bdf11a16cc26525cbd95ee00" },
|
||||
"SchemaStore.nvim": { "branch": "main", "commit": "8c46453bdf84ad91877effb95e0b6c7b51ea7dda" },
|
||||
"barbar.nvim": { "branch": "master", "commit": "dd852401ee902745b67fc09a83d113b3fe82a96f" },
|
||||
"bufferline.nvim": { "branch": "main", "commit": "73540cb95f8d95aa1af3ed57713c6720c78af915" },
|
||||
"catppuccin": { "branch": "main", "commit": "6af91673ceccbd6e073b66c439e7fce239f72d24" },
|
||||
"LazyVim": { "branch": "main", "commit": "73f14943bac5830905d715804ca581a91844272a" },
|
||||
"SchemaStore.nvim": { "branch": "main", "commit": "22ce6adf3c866a8c3d0c55956c4b8feeb4f10c32" },
|
||||
"barbar.nvim": { "branch": "master", "commit": "53b5a2f34b68875898f0531032fbf090e3952ad7" },
|
||||
"bufferline.nvim": { "branch": "main", "commit": "5cc447cb2b463cb499c82eaeabbed4f5fa6a0a44" },
|
||||
"catppuccin": { "branch": "main", "commit": "35d8057137af463c9f41f169539e9b190d57d269" },
|
||||
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
|
||||
"cmp-emoji": { "branch": "main", "commit": "e8398e2adf512a03bb4e1728ca017ffeac670a9f" },
|
||||
"cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" },
|
||||
"cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" },
|
||||
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
|
||||
"cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" },
|
||||
"conform.nvim": { "branch": "master", "commit": "6dc1603ea408f476a57937bbeaf7f86520a21a98" },
|
||||
"dashboard-nvim": { "branch": "master", "commit": "a0a78099658c7d4be3714f657b18ca8285d5d106" },
|
||||
"diffview.nvim": { "branch": "main", "commit": "3afa6a053f680e9f1329c4a151db988a482306cd" },
|
||||
"dressing.nvim": { "branch": "master", "commit": "5162edb1442a729a885c45455a07e9a89058be2f" },
|
||||
"flash.nvim": { "branch": "main", "commit": "7bb4a9c75d1e20cd24185afedeaa11681829ba23" },
|
||||
"friendly-snippets": { "branch": "main", "commit": "3e9a3f5a0cfcef1741e352c37bda4e82e5eb846a" },
|
||||
"gitsigns.nvim": { "branch": "main", "commit": "805610a9393fa231f2c2b49cb521bfa413fadb3d" },
|
||||
"indent-blankline.nvim": { "branch": "master", "commit": "3d08501caef2329aba5121b753e903904088f7e6" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "bef521ac89c8d423f9d092e37b58e8af0c099309" },
|
||||
"lsp_signature.nvim": { "branch": "master", "commit": "c6aeb2f1d2538bbdfdaab1664d9d4c3c75aa9db8" },
|
||||
"lualine.nvim": { "branch": "master", "commit": "0a5a66803c7407767b799067986b4dc3036e1983" },
|
||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "05744f0f1967b5757bd05c08df4271ab8ec990aa" },
|
||||
"mason-nvim-dap.nvim": { "branch": "main", "commit": "67210c0e775adec55de9826b038e8b62de554afc" },
|
||||
"mason.nvim": { "branch": "main", "commit": "751b1fcbf3d3b783fcf8d48865264a9bcd8f9b10" },
|
||||
"mini.ai": { "branch": "main", "commit": "55e9b7217f29e62f734e239bfeed5731a065d801" },
|
||||
"mini.bufremove": { "branch": "main", "commit": "931a3bb514147d9e812767275c4beba6b779b1d3" },
|
||||
"mini.comment": { "branch": "main", "commit": "f9f1a646fd3d9df7397aa1b9550a875fe8189eb0" },
|
||||
"mini.indentscope": { "branch": "main", "commit": "a8274b6ea2d868198d27bd91a31ed5ea3a6a5744" },
|
||||
"mini.pairs": { "branch": "main", "commit": "927d19cbdd0e752ab1c7eed87072e71d2cd6ff51" },
|
||||
"mini.surround": { "branch": "main", "commit": "0f528eb2e1bab420c0569d9e52615144c51db920" },
|
||||
"neo-tree.nvim": { "branch": "v3.x", "commit": "7aad1bf3f6b849cbf108e02c55ad4d701cb4d33a" },
|
||||
"neoconf.nvim": { "branch": "main", "commit": "d4a48c2a6fdeec138605cee4eb6f8c6fafd0b3ed" },
|
||||
"neodev.nvim": { "branch": "main", "commit": "ce9a2e8eaba5649b553529c5498acb43a6c317cd" },
|
||||
"neotest": { "branch": "master", "commit": "5caac5cc235d495a2382bc2980630ef36ac87032" },
|
||||
"neotest-go": { "branch": "main", "commit": "27c80deab9cf5cb30b20ee407b3a6c7285518128" },
|
||||
"neotest-golang": { "branch": "main", "commit": "c5d557df0a30e6902d53a072416045006a823762" },
|
||||
"noice.nvim": { "branch": "main", "commit": "f4decbc7a80229ccc9f86026b74bdcf0c39e38a7" },
|
||||
"nui.nvim": { "branch": "main", "commit": "a3597dc88b53489d3fddbddbbd13787355253bb0" },
|
||||
"nvim-cmp": { "branch": "main", "commit": "cd2cf0c124d3de577fb5449746568ee8e601afc8" },
|
||||
"nvim-dap": { "branch": "master", "commit": "5a2f7121869394502521c52b2bc581ab22c69447" },
|
||||
"nvim-dap-go": { "branch": "main", "commit": "5faf165f5062187320eaf9d177c3c1f647adc22e" },
|
||||
"nvim-dap-ui": { "branch": "master", "commit": "334cf3038c4756e6ab999cbac67c847fb654c190" },
|
||||
"nvim-dap-virtual-text": { "branch": "master", "commit": "3e8e207513e6ef520894950acd76b79902714103" },
|
||||
"nvim-lint": { "branch": "master", "commit": "861a04313501563bb1b11f125ae9b7237a517b9b" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "a3d9395455f2b2e3b50a0b0f37b8b4c23683f44a" },
|
||||
"nvim-nio": { "branch": "master", "commit": "8765cbc4d0c629c8158a5341e1b4305fd93c3a90" },
|
||||
"nvim-notify": { "branch": "master", "commit": "5371f4bfc1f6d3adf4fe9d62cd3a9d44356bfd15" },
|
||||
"nvim-spectre": { "branch": "master", "commit": "4651801ba37a9407b7257287aec45b6653ffc5e9" },
|
||||
"nvim-tree.lua": { "branch": "master", "commit": "64f61e4c913047a045ff90bd188dd3b54ee443cf" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "3607d9c59cb16ed5368ecfed53e8ca1735bb98fb" },
|
||||
"nvim-treesitter-context": { "branch": "master", "commit": "2650e6431f7daba5d9c2c64134fa5eb2312eb3d7" },
|
||||
"nvim-treesitter-textobjects": { "branch": "master", "commit": "23b820146956b3b681c19e10d3a8bc0cbd9a1d4c" },
|
||||
"nvim-ts-autotag": { "branch": "main", "commit": "531f48334c422222aebc888fd36e7d109cb354cd" },
|
||||
"nvim-ts-context-commentstring": { "branch": "main", "commit": "0bdccb9c67a42a5e2d99384dc9bfa29b1451528f" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "5b9067899ee6a2538891573500e8fd6ff008440f" },
|
||||
"persistence.nvim": { "branch": "main", "commit": "4982499c1636eac254b72923ab826ee7827b3084" },
|
||||
"conform.nvim": { "branch": "master", "commit": "d28ccf945374edd9f1c34a82f6c22261dbd8ab98" },
|
||||
"dashboard-nvim": { "branch": "master", "commit": "ae309606940d26d8c9df8b048a6e136b6bbec478" },
|
||||
"diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" },
|
||||
"dressing.nvim": { "branch": "master", "commit": "6ef1ca479d37d4ff66f13eed44d08912caff483a" },
|
||||
"flash.nvim": { "branch": "main", "commit": "34c7be146a91fec3555c33fe89c7d643f6ef5cf1" },
|
||||
"friendly-snippets": { "branch": "main", "commit": "de8fce94985873666bd9712ea3e49ee17aadb1ed" },
|
||||
"gitsigns.nvim": { "branch": "main", "commit": "4daf7022f1481edf1e8fb9947df13bb07c18e89a" },
|
||||
"grug-far.nvim": { "branch": "main", "commit": "190c03d54e8976491e6e49acb97087bf4182b079" },
|
||||
"indent-blankline.nvim": { "branch": "master", "commit": "04e44b09ee3ff189c69ab082edac1ef7ae2e256c" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "077102c5bfc578693f12377846d427f49bc50076" },
|
||||
"lazydev.nvim": { "branch": "main", "commit": "d5800897d9180cea800023f2429bce0a94ed6064" },
|
||||
"lsp_signature.nvim": { "branch": "master", "commit": "fc38521ea4d9ec8dbd4c2819ba8126cea743943b" },
|
||||
"lualine.nvim": { "branch": "master", "commit": "640260d7c2d98779cab89b1e7088ab14ea354a02" },
|
||||
"luvit-meta": { "branch": "main", "commit": "ce76f6f6cdc9201523a5875a4471dcfe0186eb60" },
|
||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "4d0e5b49363cac187326998b96aa6a2884e0e89b" },
|
||||
"mason-nvim-dap.nvim": { "branch": "main", "commit": "8b9363d83b5d779813cdd2819b8308651cec2a09" },
|
||||
"mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" },
|
||||
"mini.ai": { "branch": "main", "commit": "9b9b7cfa38b4871c3e44cfe89cf6d53fd40684d9" },
|
||||
"mini.icons": { "branch": "main", "commit": "a2742459f0ee32806c2438ca06b4d8b331f3f4d4" },
|
||||
"mini.pairs": { "branch": "main", "commit": "7e834c5937d95364cc1740e20d673afe2d034cdb" },
|
||||
"neo-tree.nvim": { "branch": "main", "commit": "a77af2e764c5ed4038d27d1c463fa49cd4794e07" },
|
||||
"neotest": { "branch": "master", "commit": "6d3d22cdad49999ef774ebe1bc250a4994038964" },
|
||||
"neotest-golang": { "branch": "main", "commit": "df6e3f34ae65f2520db798481a9d3f97581899b7" },
|
||||
"noice.nvim": { "branch": "main", "commit": "8c9a29acbcb5380c4dadc09f25ab3e99f5ab626e" },
|
||||
"nui.nvim": { "branch": "main", "commit": "b58e2bfda5cea347c9d58b7f11cf3012c7b3953f" },
|
||||
"nvim-cmp": { "branch": "main", "commit": "f17d9b4394027ff4442b298398dfcaab97e40c4f" },
|
||||
"nvim-dap": { "branch": "master", "commit": "8517126e9323e346f6a99b3b594c5a940b914dcd" },
|
||||
"nvim-dap-go": { "branch": "main", "commit": "6aa88167ea1224bcef578e8c7160fe8afbb44848" },
|
||||
"nvim-dap-ui": { "branch": "master", "commit": "ffa89839f97bad360e78428d5c740fdad9a0ff02" },
|
||||
"nvim-dap-virtual-text": { "branch": "master", "commit": "76d80c3d171224315b61c006502a1e30c213a9ab" },
|
||||
"nvim-lint": { "branch": "master", "commit": "36da8dd0ddc4f88e0beae234c20e75397326f143" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "52302604e3c667cfdf33aadf89088e96eb3c5da3" },
|
||||
"nvim-nio": { "branch": "master", "commit": "a428f309119086dc78dd4b19306d2d67be884eee" },
|
||||
"nvim-notify": { "branch": "master", "commit": "fbef5d32be8466dd76544a257d3f3dce20082a07" },
|
||||
"nvim-snippets": { "branch": "main", "commit": "56b4052f71220144689caaa2e5b66222ba5661eb" },
|
||||
"nvim-tree.lua": { "branch": "master", "commit": "610a1c189bdb2b9b936169b2ea9d1838f971fa2b" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "4b9a83f6017ee5edea85722cbfda1b3058a82e69" },
|
||||
"nvim-treesitter-textobjects": { "branch": "master", "commit": "3e450cd85243da99dc23ebbf14f9c70e9a0c26a4" },
|
||||
"nvim-ts-autotag": { "branch": "main", "commit": "e239a560f338be31337e7abc3ee42515daf23f5e" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "19d257cf889f79f4022163c3fbb5e08639077bd8" },
|
||||
"persistence.nvim": { "branch": "main", "commit": "f6aad7dde7fcf54148ccfc5f622c6d5badd0cc3d" },
|
||||
"playground": { "branch": "master", "commit": "ba48c6a62a280eefb7c85725b0915e021a1a0749" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "08e301982b9a057110ede7a735dd1b5285eb341f" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" },
|
||||
"symbols-outline.nvim": { "branch": "master", "commit": "564ee65dfc9024bdde73a6621820866987cbb256" },
|
||||
"telescope-file-browser.nvim": { "branch": "master", "commit": "4d5fd21bae12ee6e9a79232e1c377f43c419d0c5" },
|
||||
"telescope-fzf-native.nvim": { "branch": "main", "commit": "9ef21b2e6bb6ebeaf349a0781745549bbb870d27" },
|
||||
"telescope.nvim": { "branch": "master", "commit": "fac83a556e7b710dc31433dec727361ca062dbe9" },
|
||||
"todo-comments.nvim": { "branch": "main", "commit": "a7e39ae9e74f2c8c6dc4eea6d40c3971ae84752d" },
|
||||
"tokyonight.nvim": { "branch": "main", "commit": "67afeaf7fd6ebba000633e89f63c31694057edde" },
|
||||
"trouble.nvim": { "branch": "main", "commit": "b9cf677f20bb2faa2dacfa870b084e568dca9572" },
|
||||
"vim-illuminate": { "branch": "master", "commit": "e522e0dd742a83506db0a72e1ced68c9c130f185" },
|
||||
"vim-startuptime": { "branch": "master", "commit": "ac2cccb5be617672add1f4f3c0a55ce99ba34e01" },
|
||||
"telescope-file-browser.nvim": { "branch": "master", "commit": "626998e5c1b71c130d8bc6cf7abb6709b98287bb" },
|
||||
"telescope-fzf-native.nvim": { "branch": "main", "commit": "cf48d4dfce44e0b9a2e19a008d6ec6ea6f01a83b" },
|
||||
"telescope.nvim": { "branch": "master", "commit": "85922dde3767e01d42a08e750a773effbffaea3e" },
|
||||
"todo-comments.nvim": { "branch": "main", "commit": "ae0a2afb47cf7395dc400e5dc4e05274bf4fb9e0" },
|
||||
"tokyonight.nvim": { "branch": "main", "commit": "ce91ba480070c95f40753e4663e32b4632ac6db3" },
|
||||
"trouble.nvim": { "branch": "main", "commit": "2f3b537f2207ce32f4459f9d56746ee013b5e01b" },
|
||||
"ts-comments.nvim": { "branch": "main", "commit": "2002692ad1d3f6518d016550c20c2a890f0cbf0e" },
|
||||
"vim-vsnip": { "branch": "master", "commit": "02a8e79295c9733434aab4e0e2b8c4b7cea9f3a9" },
|
||||
"vim-vsnip-integ": { "branch": "master", "commit": "1914e72cf3de70df7f5dde476cd299aba2440aef" },
|
||||
"which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" }
|
||||
"vim-vsnip-integ": { "branch": "master", "commit": "90ae474e8b05ed41e36d6f58382a9fbfb4b672c4" },
|
||||
"which-key.nvim": { "branch": "main", "commit": "8badb359f7ab8711e2575ef75dfe6fbbd87e4821" }
|
||||
}
|
||||
+2
-2
@@ -4,7 +4,7 @@
|
||||
"lazyvim.plugins.extras.lang.go"
|
||||
],
|
||||
"news": {
|
||||
"NEWS.md": "3314"
|
||||
"NEWS.md": "6520"
|
||||
},
|
||||
"version": 3
|
||||
"version": 6
|
||||
}
|
||||
@@ -3,18 +3,21 @@ return {
|
||||
"lewis6991/gitsigns.nvim",
|
||||
opts = {
|
||||
signs = {
|
||||
-- TODO add hl to colorscheme
|
||||
add = { hl = "GitSignsAdd", text = "▎", numhl = "GitSignsAddNr", linehl = "GitSignsAddLn" },
|
||||
change = { hl = "GitSignsChange", text = "▎", numhl = "GitSignsChangeNr", linehl = "GitSignsChangeLn" },
|
||||
delete = { hl = "GitSignsDelete", text = "契", numhl = "GitSignsDeleteNr", linehl = "GitSignsDeleteLn" },
|
||||
topdelete = { hl = "GitSignsDelete", text = "契", numhl = "GitSignsDeleteNr", linehl = "GitSignsDeleteLn" },
|
||||
changedelete = {
|
||||
hl = "GitSignsChange",
|
||||
text = "▎",
|
||||
numhl = "GitSignsChangeNr",
|
||||
linehl = "GitSignsChangeLn",
|
||||
},
|
||||
},
|
||||
add = { text = '┃' },
|
||||
change = { text = '┃' },
|
||||
delete = { text = '_' },
|
||||
topdelete = { text = '‾' },
|
||||
changedelete = { text = '~' },
|
||||
untracked = { text = '┆' },
|
||||
},
|
||||
signs_staged = {
|
||||
add = { text = '┃' },
|
||||
change = { text = '┃' },
|
||||
delete = { text = '_' },
|
||||
topdelete = { text = '‾' },
|
||||
changedelete = { text = '~' },
|
||||
untracked = { text = '┆' },
|
||||
},
|
||||
numhl = false,
|
||||
linehl = false,
|
||||
watch_gitdir = {
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
cd ~/Downloads/
|
||||
wget https://github.com/tonsky/FiraCode/releases/download/6.2/Fira_Code_v6.2.zip
|
||||
|
||||
echo '1. unzip Fira_Code_v6.2.zip'
|
||||
echo '2. select all file and install it'
|
||||
|
||||
open ~/Downloads/
|
||||
@@ -0,0 +1,104 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import os
|
||||
import sys
|
||||
import platform
|
||||
import subprocess
|
||||
from typing import Dict, List, Optional
|
||||
import urllib.request
|
||||
import zipfile
|
||||
import shutil
|
||||
|
||||
def get_font_dir() -> str:
|
||||
"""根据操作系统确定字体安装目录"""
|
||||
system = platform.system()
|
||||
if system == "Darwin": # macOS
|
||||
return os.path.expanduser("~/Library/Fonts")
|
||||
elif system == "Linux":
|
||||
return os.path.expanduser("~/.local/share/fonts")
|
||||
else:
|
||||
raise OSError(f"不支持的操作系统: {system}")
|
||||
|
||||
def check_command(command: str) -> bool:
|
||||
"""检查命令是否存在"""
|
||||
return shutil.which(command) is not None
|
||||
|
||||
def download_file(url: str, dest_path: str) -> None:
|
||||
"""下载文件到指定路径"""
|
||||
try:
|
||||
urllib.request.urlretrieve(url, dest_path)
|
||||
except Exception as e:
|
||||
print(f"下载失败: {e}")
|
||||
sys.exit(1)
|
||||
|
||||
def get_top_level_dirs(zip_file: zipfile.ZipFile) -> List[str]:
|
||||
"""获取 ZIP 文件中的顶级目录"""
|
||||
return list(set(item.split('/')[0] for item in zip_file.namelist() if '/' in item))
|
||||
|
||||
def has_single_top_dir(zip_file: zipfile.ZipFile) -> bool:
|
||||
"""检查 ZIP 文件是否只有一个顶级目录"""
|
||||
top_dirs = get_top_level_dirs(zip_file)
|
||||
return len(top_dirs) == 1 and all(name.startswith(top_dirs[0] + '/') for name in zip_file.namelist())
|
||||
|
||||
|
||||
def unzip_file(zip_path: str, font_name: str) -> None:
|
||||
"""解压文件到指定路径,根据 ZIP 文件结构决定是否创建顶级目录"""
|
||||
with zipfile.ZipFile(zip_path, 'r') as zip_ref:
|
||||
if has_single_top_dir(zip_ref):
|
||||
# ZIP 文件有单一顶级目录,直接解压
|
||||
zip_ref.extractall("/tmp")
|
||||
print(f"已解压 {font_name} 到现有顶级目录")
|
||||
else:
|
||||
# 没有单一顶级目录,创建一个以字体名命名的目录
|
||||
font_dir = os.path.join("/tmp", font_name)
|
||||
os.makedirs(font_dir, exist_ok=True)
|
||||
for file in zip_ref.namelist():
|
||||
if not file.startswith('__MACOSX'): # 排除 macOS 系统文件
|
||||
zip_ref.extract(file, font_dir)
|
||||
print(f"已解压 {font_name} 并创建新的顶级目录")
|
||||
|
||||
|
||||
def install_font(font_name: str, font_dir: str) -> None:
|
||||
"""安装字体到指定目录"""
|
||||
# find ttf files to copy to the font_dir
|
||||
ttf_files = [file for file in os.listdir(f"/tmp/{font_name}") if file.endswith(".ttf")]
|
||||
for ttf_file in ttf_files:
|
||||
shutil.copy(f"/tmp/{font_name}/{ttf_file}", font_dir)
|
||||
print(f"已安装 {font_name} 到 {font_dir}")
|
||||
|
||||
def refresh_font_cache() -> None:
|
||||
"""在 Linux 系统上刷新字体缓存"""
|
||||
if platform.system() == "Linux" and check_command("fc-cache"):
|
||||
subprocess.run(["fc-cache", "-f"])
|
||||
print("字体缓存已刷新。")
|
||||
else:
|
||||
print("警告:无法刷新字体缓存。您可能需要手动刷新。")
|
||||
|
||||
def main() -> None:
|
||||
fonts: Dict[str, str] = {
|
||||
"SarasaNerd":"https://github.com/jonz94/Sarasa-Gothic-Nerd-Fonts/releases/download/v1.0.23-0/sarasa-fixed-sc-nerd-font.zip",
|
||||
"FiraCode": "https://github.com/tonsky/FiraCode/releases/download/6.2/Fira_Code_v6.2.zip"
|
||||
}
|
||||
|
||||
try:
|
||||
font_dir = get_font_dir()
|
||||
except OSError as e:
|
||||
print(str(e))
|
||||
sys.exit(1)
|
||||
|
||||
os.makedirs(font_dir, exist_ok=True)
|
||||
|
||||
for font in fonts:
|
||||
print(f"正在下载和安装 {font}...")
|
||||
zip_path = f"/tmp/{font}.zip"
|
||||
download_file(fonts[font], zip_path)
|
||||
unzip_file(zip_path, font)
|
||||
install_font(font, font_dir)
|
||||
os.remove(zip_path)
|
||||
|
||||
refresh_font_cache()
|
||||
print("安装完成。请重启您的终端或应用程序以使用新字体。")
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
#!/bin/bash
|
||||
|
||||
# 定义变量
|
||||
NVIM_CONFIG_DIR="$HOME/.config/nvim"
|
||||
YOUR_CUSTOM_CONFIG_DIR="$HOME/.dotfile/nvim" # 请替换为您的自定义配置目录路径
|
||||
|
||||
# 检查软链接是否已经存在并指向正确的目录
|
||||
if [ -L "$NVIM_CONFIG_DIR" ] && [ "$(readlink -f "$NVIM_CONFIG_DIR")" = "$(readlink -f "$YOUR_CUSTOM_CONFIG_DIR")" ]; then
|
||||
echo "软链接已经存在并指向正确的目录。无需进行任何操作。"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# 检查是否存在现有的 Neovim 配置
|
||||
if [ -e "$NVIM_CONFIG_DIR" ]; then
|
||||
echo "检测到现有的 Neovim 配置。"
|
||||
|
||||
# 如果是目录或常规文件,创建备份
|
||||
if [ -d "$NVIM_CONFIG_DIR" ] || [ -f "$NVIM_CONFIG_DIR" ]; then
|
||||
BACKUP_DIR="$NVIM_CONFIG_DIR.backup.$(date +%Y%m%d%H%M%S)"
|
||||
mv "$NVIM_CONFIG_DIR" "$BACKUP_DIR"
|
||||
echo "已将现有配置备份到 $BACKUP_DIR"
|
||||
else
|
||||
# 如果是其他类型的文件(如损坏的软链接),直接删除
|
||||
rm "$NVIM_CONFIG_DIR"
|
||||
echo "已删除现有的无效配置。"
|
||||
fi
|
||||
fi
|
||||
|
||||
# 创建软链接
|
||||
ln -s "$YOUR_CUSTOM_CONFIG_DIR" "$NVIM_CONFIG_DIR"
|
||||
|
||||
# 检查软链接是否创建成功
|
||||
if [ -L "$NVIM_CONFIG_DIR" ] && [ "$(readlink -f "$NVIM_CONFIG_DIR")" = "$(readlink -f "$YOUR_CUSTOM_CONFIG_DIR")" ]; then
|
||||
echo "软链接创建成功。Neovim 现在将使用您的自定义配置。"
|
||||
else
|
||||
echo "创建软链接时出错。请检查路径和权限。"
|
||||
fi
|
||||
|
||||
+10
-5
@@ -1,30 +1,35 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
# install neovim
|
||||
os_arch=$(uname -s)-$(uname -m)
|
||||
ver=v0.10.2
|
||||
|
||||
if [ "$EUID" -ne 0 ]; then
|
||||
echo "need sudo"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
case $os_arch in
|
||||
"Darwin-x86_64")
|
||||
cd /tmp
|
||||
rm -rf nvim-macos-x86_64.tar.gz
|
||||
wget https://github.com/neovim/neovim/releases/download/$ver/nvim-macos-x86_64.tar.gz
|
||||
tar zxf nvim-macos-x86_64.tar.gz
|
||||
sudo mv -f /usr/local/nvim /usr/local/nvim-bak
|
||||
sudo mv nvim-macos-x86_64 /usr/local/nvim
|
||||
sudo ln -sf /usr/local/nvim/bin/nvim /usr/local/bin/vim
|
||||
sudo ln -sf /usr/local/nvim/bin/nvim /usr/local/bin/nvim
|
||||
echo ""
|
||||
vim -v
|
||||
;;
|
||||
"Linux-x86_64"|"Linux-arm64")
|
||||
cd /tmp
|
||||
rm -rf nvim-linux64.tar.gz
|
||||
wget https://github.com/neovim/neovim/releases/download/$ver/nvim-linux64.tar.gz
|
||||
tar zxf nvim-linux64.tar.gz
|
||||
sudo mv -f /usr/local/nvim /usr/local/nvim-bak
|
||||
sudo mv nvim-linux64 /usr/local/nvim
|
||||
sudo ln -sf /usr/local/nvim/bin/nvim /usr/local/bin/vim
|
||||
sudo ln -sf /usr/local/nvim/bin/nvim /usr/local/bin/nvim
|
||||
echo ""
|
||||
vim -v
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
# 设置颜色
|
||||
GREEN='\033[0;32m'
|
||||
RED='\033[0;31m'
|
||||
NC='\033[0m' # No Color
|
||||
|
||||
# 检查是否已安装 pyenv
|
||||
if ! command -v pyenv &> /dev/null
|
||||
then
|
||||
echo -e "${RED}pyenv 未安装. 正在安装 pyenv...${NC}"
|
||||
# 安装 pyenv
|
||||
curl https://pyenv.run | bash
|
||||
source ~/.config/fish/config.fish
|
||||
else
|
||||
echo -e "${GREEN}pyenv 已安装${NC}"
|
||||
fi
|
||||
|
||||
# 询问用户想安装的 Python 版本
|
||||
python_version=3.11.10
|
||||
|
||||
# 安装指定版本的 Python
|
||||
echo -e "${GREEN}正在安装 Python $python_version...${NC}"
|
||||
pyenv install $python_version
|
||||
|
||||
# 设置全局 Python 版本
|
||||
pyenv global $python_version
|
||||
|
||||
# 验证安装
|
||||
installed_version=$(python --version)
|
||||
echo -e "${GREEN}Python 安装完成. 当前版本: $installed_version${NC}"
|
||||
|
||||
# 安装一些常用的 Python 包
|
||||
echo -e "${GREEN}正在安装一些常用的 Python 包...${NC}"
|
||||
pip install --upgrade pip
|
||||
pip install ipython jupyter notebook pandas numpy matplotlib scikit-learn
|
||||
|
||||
echo -e "${GREEN}Python 环境设置完成!${NC}"
|
||||
Reference in New Issue
Block a user