Skip to content

Jamie-Cui/dotfiles

Repository files navigation

dotfiles

My personal dot files. It is recommended to symlink dotfiles to home folder (or whatever it should be).

key bindings (windows, linux, and mac)

Since Gnu Emacs could almost do everthing, It’s built-in browser is a true pain-in-the-ass. Therefore I decide to rely on window manager like i3 on linux, aerospace on macos, to help me switch between emacs and browser.

My definion: Command Key / Alt Key (whichever key is next to the space key) = meta My definion: Option Key / Windows Key (whichever key is next to the meta key) = super

  • meta + 1 : visit browser (firefox)
  • meta + 2 : visit emacs
  • meta + 3 : visit alacritty
  • meta + space : application launcher (would be nicer if it can do browser search)
  • meta + tab : switch applications
  • super + shift + q : kill current application
  • super + shift + e : exit window manager
  • super + shift + r : restart/reload window manager config
  • super + shift + - : minimize/hide current app
  • super + shift + + : maximuze/show current app
  • super + shift + enter : toggle float window and max screen

floating applications:

  • wechat
  • wemeetapp (tencent meeting)
  • dingtalk (dingding)

macos apps

key repeat and delay tweak

# ubuntu
gsettings set org.gnome.desktop.peripherals.keyboard repeat-interval 15
gsettings set org.gnome.desktop.peripherals.keyboard delay 200

ibus-setup # trun off emoji shortcut => which defaults to C-;

# macos
defaults write -g InitialKeyRepeat -int 15 // I think 15 is better, you can set this to 10
defaults write -g KeyRepeat -int 1
# or, config those values though GUI
open ~/Library/Preferences/.GlobalPreferences.plist

setup proxy

If you use your proxy at: 127.0.0.1:1087

git config --global http.proxy http://127.0.0.1:1087
git config --global --unset http.proxy

npm config set proxy http://127.0.0.1:1087
npm config delete proxy
export MY_PROXY=http://127.0.0.1:1087

function set-proxy() {
        export {http,https,ftp}_proxy=$MY_PROXY
        export {HTTP,HTTPS,FTP}_PROXY=$MY_PROXY
        export NO_PROXY=127.0.0.1
        git config --global http.proxy $MY_PROXY 
        git config --global https.proxy $MY_PROXY
        show-proxy
}

function unset-proxy() {
        unset {http,https,ftp}_proxy
        unset {HTTP,HTTPS,FTP}_PROXY
        unset NO_PROXY
        git config --global --unset http.proxy
        git config --global --unset https.proxy
}

function show-proxy() {
        echo "[env] http_proxy: $HTTP_PROXY"
        echo "[env] https_proxy: $HTTP_PROXY"
        echo "[env] no_proxy: $NO_PROXY"
        echo "[git] http.proxy:" $(git config --global --get http.proxy)
        echo "[git] https.proxy:" $(git config --global --get https.proxy)
}

alias et='tmux attach -t emacs-session || tmux new -s emacs-session "emacs -nw"'
alias emacs='emacs -nw'
Host github.com
  port 22
  User git
  HostName github.com
  PreferredAuthentications publickey
  IdentityFile ~/.ssh/id_ed25519

  # 10808 is local socks listening port number, find it in your v2ray / clash setting (through GUI, preferrably)
  ProxyCommand socat - socks5:127.0.0.1:%h:%p,socksport=10808

or, if you see Connection closed by UNKNOWN port 65535 erros. see: https://bannirui.github.io/2024/01/24/%E4%BB%A3%E7%90%86git%E7%9A%84ssh%E5%8D%8F%E8%AE%AE/

Host github.com
  port 443
  User git
  HostName ssh.github.com
  PreferredAuthentications publickey
  IdentityFile ~/.ssh/id_ed25519

  # 10808 is local socks listening port number, find it in your v2ray / clash setting (through GUI, preferrably)
  ProxyCommand socat - socks4:127.0.0.1:%h:%p,socksport=10808

About

My useful dotfiles

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published