mirror of
https://github.com/js0ny/dotfiles.git
synced 2025-12-21 08:43:00 +00:00
fix: shell script to lf from crlf
This commit is contained in:
parent
29729674e5
commit
d14df507e8
8 changed files with 208 additions and 206 deletions
|
|
@ -4,12 +4,14 @@ root = true
|
||||||
|
|
||||||
[*]
|
[*]
|
||||||
charset = utf-8
|
charset = utf-8
|
||||||
end_of_line = lf
|
|
||||||
insert_final_newline = true
|
insert_final_newline = true
|
||||||
indent_style = space
|
indent_style = space
|
||||||
indent_size = 4
|
indent_size = 4
|
||||||
trim_trailing_whitespace = true
|
trim_trailing_whitespace = true
|
||||||
|
|
||||||
|
[*.{sh,zsh,zshrc,zshenv,bashrc}]
|
||||||
|
end_of_line = lf
|
||||||
|
|
||||||
[*.md]
|
[*.md]
|
||||||
trim_trailing_whitespace = false
|
trim_trailing_whitespace = false
|
||||||
indent_style = space
|
indent_style = space
|
||||||
|
|
|
||||||
118
.obsidian.vimrc
118
.obsidian.vimrc
|
|
@ -1,59 +1,59 @@
|
||||||
" Put this in OBSIDIAN_VAULT/.obsidian.vimrc
|
" Put this in OBSIDIAN_VAULT/.obsidian.vimrc
|
||||||
set clipboard=unnamed " Sync with System Clipboard
|
set clipboard=unnamed " Sync with System Clipboard
|
||||||
|
|
||||||
" Word wrap
|
" Word wrap
|
||||||
noremap n gj
|
noremap n gj
|
||||||
noremap e gk
|
noremap e gk
|
||||||
noremap i l
|
noremap i l
|
||||||
|
|
||||||
" Similar position to i
|
" Similar position to i
|
||||||
noremap l i
|
noremap l i
|
||||||
noremap L I
|
noremap L I
|
||||||
" ne[k]st
|
" ne[k]st
|
||||||
noremap k n
|
noremap k n
|
||||||
noremap K N
|
noremap K N
|
||||||
" [j]ump
|
" [j]ump
|
||||||
noremap j e
|
noremap j e
|
||||||
noremap J E
|
noremap J E
|
||||||
|
|
||||||
" Y to yank to end of line
|
" Y to yank to end of line
|
||||||
noremap Y y$
|
noremap Y y$
|
||||||
|
|
||||||
""" Visual mode surrounding
|
""" Visual mode surrounding
|
||||||
exmap addbold obcommand editor:toogle-bold
|
exmap addbold obcommand editor:toogle-bold
|
||||||
exmap additalic obcommand editor:toogle-italic
|
exmap additalic obcommand editor:toogle-italic
|
||||||
exmap addhighlight obcommand editor:toogle-highlight
|
exmap addhighlight obcommand editor:toogle-highlight
|
||||||
exmap addcode obcommand editor:toogle-code
|
exmap addcode obcommand editor:toogle-code
|
||||||
exmap adddel obcommand editor:toogle-strikethrough
|
exmap adddel obcommand editor:toogle-strikethrough
|
||||||
vnoremap ~ :adddel<CR> " Add delete to selection
|
vnoremap ~ :adddel<CR> " Add delete to selection
|
||||||
vnoremap ` c`<C-r>"`<Esc> " editor:toogle-code is buggy
|
vnoremap ` c`<C-r>"`<Esc> " editor:toogle-code is buggy
|
||||||
vnoremap * :addbold<CR> " Add bold to selection
|
vnoremap * :addbold<CR> " Add bold to selection
|
||||||
vnoremap _ :additalic<CR> " Add italic to selection
|
vnoremap _ :additalic<CR> " Add italic to selection
|
||||||
vnoremap = :addhighlight " Add highlight to selection
|
vnoremap = :addhighlight " Add highlight to selection
|
||||||
|
|
||||||
exmap prevtab obcommand workspace:previous-tab
|
exmap prevtab obcommand workspace:previous-tab
|
||||||
exmap nexttab obcommand workspace:next-tab
|
exmap nexttab obcommand workspace:next-tab
|
||||||
nnoremap H :prevtab<CR>
|
nnoremap H :prevtab<CR>
|
||||||
nnoremap I :nexttab<CR>
|
nnoremap I :nexttab<CR>
|
||||||
|
|
||||||
exmap reload :source .obsidian.vimrc<CR>
|
exmap reload :source .obsidian.vimrc<CR>
|
||||||
|
|
||||||
unmap <Space>
|
unmap <Space>
|
||||||
exmap vsplit obcommand workspace:split-vertical
|
exmap vsplit obcommand workspace:split-vertical
|
||||||
exmap hsplit obcommand workspace:split-horizontal
|
exmap hsplit obcommand workspace:split-horizontal
|
||||||
map <Space>| :vsplit<CR>
|
map <Space>| :vsplit<CR>
|
||||||
map <Space>- :hsplit<CR>
|
map <Space>- :hsplit<CR>
|
||||||
" map <Space>bd
|
" map <Space>bd
|
||||||
|
|
||||||
exmap chat obcommand obsidian-custom-frames:open-custom-frames-chatgpt
|
exmap chat obcommand obsidian-custom-frames:open-custom-frames-chatgpt
|
||||||
map <Space>ai :chat<CR>
|
map <Space>ai :chat<CR>
|
||||||
|
|
||||||
exmap omnisearch obcommand omnisearch:show-modal
|
exmap omnisearch obcommand omnisearch:show-modal
|
||||||
map <Space><Space> :omnisearch<CR>
|
map <Space><Space> :omnisearch<CR>
|
||||||
|
|
||||||
exmap command-palette obcommand command-palette:open
|
exmap command-palette obcommand command-palette:open
|
||||||
map <Space>: :command-palette<CR>
|
map <Space>: :command-palette<CR>
|
||||||
|
|
||||||
""" g-commands
|
""" g-commands
|
||||||
exmap tsource obcommand editor:toggle-source
|
exmap tsource obcommand editor:toggle-source
|
||||||
nnoremap gs :tsource<CR>
|
nnoremap gs :tsource<CR>
|
||||||
|
|
|
||||||
88
mac/.zshrc
88
mac/.zshrc
|
|
@ -1,44 +1,44 @@
|
||||||
# $XDG_CONFIG_HOME/zsh/.zshrc
|
# $XDG_CONFIG_HOME/zsh/.zshrc
|
||||||
# ln -s $DOTFILES/mac/.zshrc $XDG_CONFIG_HOME/zsh/.zshrc
|
# ln -s $DOTFILES/mac/.zshrc $XDG_CONFIG_HOME/zsh/.zshrc
|
||||||
### Variables ###
|
### Variables ###
|
||||||
|
|
||||||
export DOTFILES="$HOME/.dotfiles"
|
export DOTFILES="$HOME/.dotfiles"
|
||||||
export PATH=/opt/homebrew/bin:/opt/homebrew/sbin:$PATH
|
export PATH=/opt/homebrew/bin:/opt/homebrew/sbin:$PATH
|
||||||
for file in $DOTFILES/zsh/*.zsh; do
|
for file in $DOTFILES/zsh/*.zsh; do
|
||||||
source $file
|
source $file
|
||||||
done
|
done
|
||||||
export ARCHFLAGS="-arch arm64"
|
export ARCHFLAGS="-arch arm64"
|
||||||
|
|
||||||
### Navigation ###
|
### Navigation ###
|
||||||
# Absolute navigation
|
# Absolute navigation
|
||||||
alias doku="cd ~/doku && ls"
|
alias doku="cd ~/doku && ls"
|
||||||
alias dotfiles="cd $DOTFILES && ls"
|
alias dotfiles="cd $DOTFILES && ls"
|
||||||
alias docs="cd ~/Documents"
|
alias docs="cd ~/Documents"
|
||||||
alias dt="cd ~/Desktop"
|
alias dt="cd ~/Desktop"
|
||||||
alias down="cd ~/Downloads"
|
alias down="cd ~/Downloads"
|
||||||
alias one="cd ~/OneDrive"
|
alias one="cd ~/OneDrive"
|
||||||
alias gdrive="cd ~/Google\ Drive"
|
alias gdrive="cd ~/Google\ Drive"
|
||||||
|
|
||||||
# >>> conda initialize >>>
|
# >>> conda initialize >>>
|
||||||
# !! Contents within this block are managed by 'conda init' !!
|
# !! Contents within this block are managed by 'conda init' !!
|
||||||
__conda_setup="$('/opt/homebrew/Caskroom/miniconda/base/bin/conda' 'shell.zsh' 'hook' 2> /dev/null)"
|
__conda_setup="$('/opt/homebrew/Caskroom/miniconda/base/bin/conda' 'shell.zsh' 'hook' 2> /dev/null)"
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
eval "$__conda_setup"
|
eval "$__conda_setup"
|
||||||
else
|
else
|
||||||
if [ -f "/opt/homebrew/Caskroom/miniconda/base/etc/profile.d/conda.sh" ]; then
|
if [ -f "/opt/homebrew/Caskroom/miniconda/base/etc/profile.d/conda.sh" ]; then
|
||||||
. "/opt/homebrew/Caskroom/miniconda/base/etc/profile.d/conda.sh"
|
. "/opt/homebrew/Caskroom/miniconda/base/etc/profile.d/conda.sh"
|
||||||
else
|
else
|
||||||
export PATH="/opt/homebrew/Caskroom/miniconda/base/bin:$PATH"
|
export PATH="/opt/homebrew/Caskroom/miniconda/base/bin:$PATH"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
unset __conda_setup
|
unset __conda_setup
|
||||||
# <<< conda initialize <<<
|
# <<< conda initialize <<<
|
||||||
|
|
||||||
# >>> juliaup initialize >>>
|
# >>> juliaup initialize >>>
|
||||||
|
|
||||||
# !! Contents within this block are managed by juliaup !!
|
# !! Contents within this block are managed by juliaup !!
|
||||||
|
|
||||||
path=('$HOME/.juliaup/bin' $path)
|
path=('$HOME/.juliaup/bin' $path)
|
||||||
export PATH
|
export PATH
|
||||||
|
|
||||||
# <<< juliaup initialize <<<
|
# <<< juliaup initialize <<<
|
||||||
|
|
|
||||||
|
|
@ -1,33 +1,33 @@
|
||||||
# pip
|
# pip
|
||||||
alias pip=pip3
|
alias pip=pip3
|
||||||
alias python=python3
|
alias python=python3
|
||||||
python -m pip install --upgrade pip
|
python -m pip install --upgrade pip
|
||||||
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
|
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
|
||||||
# npm
|
# npm
|
||||||
npm config set registry https://registry.npmmirror.com
|
npm config set registry https://registry.npmmirror.com
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Homebrew
|
# Homebrew
|
||||||
# 手动设置
|
# 手动设置
|
||||||
export HOMEBREW_CORE_GIT_REMOTE="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git"
|
export HOMEBREW_CORE_GIT_REMOTE="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git"
|
||||||
|
|
||||||
# 注:自 brew 4.0 起,大部分 Homebrew 用户无需设置 homebrew/core 和 homebrew/cask 镜像,只需设置 HOMEBREW_API_DOMAIN 即可。
|
# 注:自 brew 4.0 起,大部分 Homebrew 用户无需设置 homebrew/core 和 homebrew/cask 镜像,只需设置 HOMEBREW_API_DOMAIN 即可。
|
||||||
# 如果需要使用 Homebrew 的开发命令 (如 `brew cat <formula>`),则仍然需要设置 homebrew/core 和 homebrew/cask 镜像。
|
# 如果需要使用 Homebrew 的开发命令 (如 `brew cat <formula>`),则仍然需要设置 homebrew/core 和 homebrew/cask 镜像。
|
||||||
# 请按需执行如下两行命令:
|
# 请按需执行如下两行命令:
|
||||||
brew tap --custom-remote --force-auto-update homebrew/core https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git
|
brew tap --custom-remote --force-auto-update homebrew/core https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git
|
||||||
brew tap --custom-remote --force-auto-update homebrew/cask https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-cask.git
|
brew tap --custom-remote --force-auto-update homebrew/cask https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-cask.git
|
||||||
|
|
||||||
# 除 homebrew/core 和 homebrew/cask 仓库外的 tap 仓库仍然需要设置镜像
|
# 除 homebrew/core 和 homebrew/cask 仓库外的 tap 仓库仍然需要设置镜像
|
||||||
brew tap --custom-remote --force-auto-update homebrew/cask-fonts https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-cask-fonts.git
|
brew tap --custom-remote --force-auto-update homebrew/cask-fonts https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-cask-fonts.git
|
||||||
brew tap --custom-remote --force-auto-update homebrew/cask-versions https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-cask-versions.git
|
brew tap --custom-remote --force-auto-update homebrew/cask-versions https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-cask-versions.git
|
||||||
brew tap --custom-remote --force-auto-update homebrew/command-not-found https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-command-not-found.git
|
brew tap --custom-remote --force-auto-update homebrew/command-not-found https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-command-not-found.git
|
||||||
brew tap --custom-remote --force-auto-update homebrew/services https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-services.git
|
brew tap --custom-remote --force-auto-update homebrew/services https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-services.git
|
||||||
brew update
|
brew update
|
||||||
|
|
||||||
# 或使用下面的几行命令自动设置
|
# 或使用下面的几行命令自动设置
|
||||||
export HOMEBREW_CORE_GIT_REMOTE="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git"
|
export HOMEBREW_CORE_GIT_REMOTE="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git"
|
||||||
for tap in core cask{,-fonts,-versions} command-not-found services; do
|
for tap in core cask{,-fonts,-versions} command-not-found services; do
|
||||||
brew tap --custom-remote --force-auto-update "homebrew/${tap}" "https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-${tap}.git"
|
brew tap --custom-remote --force-auto-update "homebrew/${tap}" "https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-${tap}.git"
|
||||||
done
|
done
|
||||||
brew update
|
brew update
|
||||||
|
|
|
||||||
|
|
@ -1,22 +1,22 @@
|
||||||
# pip
|
# pip
|
||||||
alias pip=pip3
|
alias pip=pip3
|
||||||
alias python=python3
|
alias python=python3
|
||||||
python -m pip install --upgrade pip
|
python -m pip install --upgrade pip
|
||||||
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
|
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
|
||||||
# npm
|
# npm
|
||||||
npm config set registry https://registry.npmmirror.com
|
npm config set registry https://registry.npmmirror.com
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Linuxbrew
|
# Linuxbrew
|
||||||
export HOMEBREW_CORE_GIT_REMOTE="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git"
|
export HOMEBREW_CORE_GIT_REMOTE="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git"
|
||||||
|
|
||||||
# 注:自 brew 4.0 起,使用默认 prefix (即 "/home/linuxbrew/.linuxbrew") 的大部分 Homebrew 用户无需设置 homebrew/core 镜像,只需设置 HOMEBREW_API_DOMAIN 即可。
|
# 注:自 brew 4.0 起,使用默认 prefix (即 "/home/linuxbrew/.linuxbrew") 的大部分 Homebrew 用户无需设置 homebrew/core 镜像,只需设置 HOMEBREW_API_DOMAIN 即可。
|
||||||
# 如果不是默认 prefix 或者需要使用 Homebrew 的开发命令 (如 `brew cat <formula>`),则仍然需要设置 homebrew/core 镜像。
|
# 如果不是默认 prefix 或者需要使用 Homebrew 的开发命令 (如 `brew cat <formula>`),则仍然需要设置 homebrew/core 镜像。
|
||||||
# 请按需执行如下命令:
|
# 请按需执行如下命令:
|
||||||
brew tap --custom-remote --force-auto-update homebrew/core https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git
|
brew tap --custom-remote --force-auto-update homebrew/core https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git
|
||||||
|
|
||||||
# 除 homebrew/core 仓库外的 tap 仓库仍然需要设置镜像
|
# 除 homebrew/core 仓库外的 tap 仓库仍然需要设置镜像
|
||||||
brew tap --custom-remote --force-auto-update homebrew/command-not-found https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-command-not-found.git
|
brew tap --custom-remote --force-auto-update homebrew/command-not-found https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-command-not-found.git
|
||||||
brew tap --custom-remote --force-auto-update homebrew/services https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-services.git
|
brew tap --custom-remote --force-auto-update homebrew/services https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-services.git
|
||||||
brew update
|
brew update
|
||||||
|
|
|
||||||
40
zsh/.zshenv
40
zsh/.zshenv
|
|
@ -1,20 +1,20 @@
|
||||||
# ~/.zshenv
|
# ~/.zshenv
|
||||||
# ln -s $DOTFILES/zsh/.zshenv $ZDOTDIR/.zshenv
|
# ln -s $DOTFILES/zsh/.zshenv $ZDOTDIR/.zshenv
|
||||||
# This file is sourced by all zsh sessions upon startup.
|
# This file is sourced by all zsh sessions upon startup.
|
||||||
|
|
||||||
# Use XDG Base Directory Specification
|
# Use XDG Base Directory Specification
|
||||||
export XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}"
|
export XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}"
|
||||||
export XDG_DATA_HOME="${XDG_DATA_HOME:-$HOME/.local/share}"
|
export XDG_DATA_HOME="${XDG_DATA_HOME:-$HOME/.local/share}"
|
||||||
export XDG_STATE_HOME="${XDG_STATE_HOME:-$HOME/.local/state}"
|
export XDG_STATE_HOME="${XDG_STATE_HOME:-$HOME/.local/state}"
|
||||||
export XDG_CACHE_HOME="${XDG_CACHE_HOME:-$HOME/.cache}"
|
export XDG_CACHE_HOME="${XDG_CACHE_HOME:-$HOME/.cache}"
|
||||||
export XDG_RUNTIME_DIR="/run/user/$(id -u)"
|
export XDG_RUNTIME_DIR="/run/user/$(id -u)"
|
||||||
# Disable shell sessions on macOS when using default terminal
|
# Disable shell sessions on macOS when using default terminal
|
||||||
SHELL_SESSIONS_DISABLE=1
|
SHELL_SESSIONS_DISABLE=1
|
||||||
|
|
||||||
# Zsh
|
# Zsh
|
||||||
export ZDOTDIR="${XDG_CONFIG_HOME}/zsh"
|
export ZDOTDIR="${XDG_CONFIG_HOME}/zsh"
|
||||||
|
|
||||||
# Also put in /etc/zsh/zshenv
|
# Also put in /etc/zsh/zshenv
|
||||||
# or /etc/zshenv in macOS
|
# or /etc/zshenv in macOS
|
||||||
# sudo cp $DOTFILES/zsh/.zshenv /etc/zsh/zshenv
|
# sudo cp $DOTFILES/zsh/.zshenv /etc/zsh/zshenv
|
||||||
# sudo cp $DOTFILES/zsh/.zshenv /etc/zshenv
|
# sudo cp $DOTFILES/zsh/.zshenv /etc/zshenv
|
||||||
|
|
|
||||||
|
|
@ -1,20 +1,20 @@
|
||||||
# $DOTFILES/keymap.zsh
|
# $DOTFILES/keymap.zsh
|
||||||
bindkey -v # Vi Keybindings
|
bindkey -v # Vi Keybindings
|
||||||
|
|
||||||
# Colemak hnei
|
# Colemak hnei
|
||||||
# bindkey -M vicmd 'h' vi-backward-char # No change
|
# bindkey -M vicmd 'h' vi-backward-char # No change
|
||||||
bindkey -M vicmd 'n' down-line-or-history
|
bindkey -M vicmd 'n' down-line-or-history
|
||||||
bindkey -M vicmd 'e' up-line-or-history
|
bindkey -M vicmd 'e' up-line-or-history
|
||||||
bindkey -M vicmd 'i' vi-forward-char
|
bindkey -M vicmd 'i' vi-forward-char
|
||||||
|
|
||||||
# Similar position to [i] in QWERTY
|
# Similar position to [i] in QWERTY
|
||||||
bindkey -M vicmd 'l' vi-insert
|
bindkey -M vicmd 'l' vi-insert
|
||||||
bindkey -M vicmd 'L' vi-insert-bol
|
bindkey -M vicmd 'L' vi-insert-bol
|
||||||
# Ne{[k]s}t
|
# Ne{[k]s}t
|
||||||
bindkey -M vicmd 'k' vi-repeat-search
|
bindkey -M vicmd 'k' vi-repeat-search
|
||||||
bindkey -M vicmd 'K' vi-rev-repeat-search
|
bindkey -M vicmd 'K' vi-rev-repeat-search
|
||||||
# [J]ump
|
# [J]ump
|
||||||
bindkey -M vicmd 'j' vi-forward-word-end
|
bindkey -M vicmd 'j' vi-forward-word-end
|
||||||
bindkey -M vicmd 'J' vi-forward-blank-word-end
|
bindkey -M vicmd 'J' vi-forward-blank-word-end
|
||||||
# Use N to Join
|
# Use N to Join
|
||||||
bindkey -M vicmd 'N' vi-join
|
bindkey -M vicmd 'N' vi-join
|
||||||
16
zsh/navi.zsh
16
zsh/navi.zsh
|
|
@ -1,9 +1,9 @@
|
||||||
|
|
||||||
# Relative navigation
|
# Relative navigation
|
||||||
alias ..="cd .."
|
alias ..="cd .."
|
||||||
alias ...="cd ../.."
|
alias ...="cd ../.."
|
||||||
alias ....="cd ../../.."
|
alias ....="cd ../../.."
|
||||||
alias .....="cd ../../../.."
|
alias .....="cd ../../../.."
|
||||||
alias ......="cd ../../../../.."
|
alias ......="cd ../../../../.."
|
||||||
|
|
||||||
eval "$(zoxide init zsh)"
|
eval "$(zoxide init zsh)"
|
||||||
Loading…
Add table
Add a link
Reference in a new issue