Proteusiq / dotfiles

🦊 Waiting for the World to Change One Bytes
MIT License
1 stars 0 forks source link
dotfiles

image

dotfiles

Dotfiles for 🦀(MLOps) and 🐲(Data Scientist): A Sara Pope's Spin-Off.

CleanShot 2024-06-22 at 19 34 12@2x

Installation

Before you get started make sure you give full disk access permission to your terminal (for writing macos defaults). System Preferences -> Privacy -> Full Disk Access.

Add [+] Utilities > Terminal

To install:

curl -L https://bit.ly/42YwVdi | sh

This expands to run.sh which will fetch this repo and run the install script.

File overview

The install script will also setup Python, Node and Bun versions/environments:

Brewfile Tools Definitions ```sh # GUI & Command Line Tools # Utilities and tools to enhance the command line interface experience "ack" # A tool like grep, optimized for programmers "aldente" # Battery life "applesimutils" # Apple Simulator Utilities "arc" # Browser for the future - 1Password, Vimium C extentions "alttab" # Better preview app switcher "azure-cli" # Microsoft Azure Command Line Interface "bat" # A cat clone with syntax highlighting and Git integration "bpytop" # Resource monitor that shows usage and stats "binutils" # GNU binary tools for native development "chruby" # Changes the current Ruby "cleanshot" # Better screen capture "coreutils" # GNU File, Shell, and Text utilities "diffutils" # File comparison utilities "direnv" # Environment switcher for the shell "espanso" # Expands text shortcuts to full template "eza" # A better ls and tree "fd" # A simple, fast and user-friendly alternative to 'find' "ffmpeg" # A complete, cross-platform solution to record, convert and stream audio and video "findutils" # GNU `find`, `locate`, `updatedb`, and `xargs` commands "fzf" # Command-line fuzzy finder "gawk" # GNU awk utility "git" # Distributed revision control system "git-lfs" # Git Large Files Storage "gnu-sed" # GNU implementation of the famous stream editor "gnu-tar" # GNU version of the tar archiving utility "gnu-time" # GNU implementation of the time utility "gnu-which" # GNU implementation of the 'which' utility to find path of executables "gnupg" # GNU Pretty Good Privacy (PGP) package "go" # The Go programming language "graphviz" # Visualizing graphs "grep" # GNU grep, egrep and fgrep "gum" # Glamorous shell scripts "gzip" # GNU compression utility "hiddenbar" # Hides unpopular tab icons "hyperfine" # A command-line benchmarking tool "jq" # Lightweight and flexible command-line JSON processor "lazygit" # The lazier way to manage everything git "lazydocker" # The lazier way to manage everything docker "llm" # Running LLM as CLI "moreutils" # Collection of tools that nobody wrote when UNIX was young "ncdu" # NCurses Disk Usage "neovim" # Ambitious Vim-fork focused on extensibility and agility "node" # Platform built on Chrome's JavaScript runtime for easily building fast, scalable network applications "ollama" # Running Large Language Models offline "pixi" # Fast than mamba: Drop in replacer of Pyenv + Poetry for conda universe "python" # Interpreted, interactive, object-oriented programming language "raycast" # A better spotlight - CleanShotX, Ollama, OpenAI, Alacritty, Brew extensitions "rename" # Perl-powered file rename script with many helpful built-ins "ripgrep" # Recursively searches directories for a regex pattern while respecting your gitignore "rsync" # Utility that provides fast incremental file transfer "rust" # Safe, concurrent, practical language "rye" # Python's Cargo "screen" # GNU screen, terminal multiplexer "shotcat" # Vimium C for Apps: Path to Mouseless World "starship" # Cross-shell prompt for astronauts "stow" # Manage installation of multiple softwares in the same directory structure "terraform" # Tool for building, changing, and versioning infrastructure safely and efficiently "thefuck" # Autocorrection with f as alias "tldr" # Too long I did nor read man "tmux" # Terminal multiplexer "uv" # Better drop in pip replacer alias pip='uv pip' "vim" # Highly configurable text editor built to enable efficient text editing "watchman" # Watch files and take action when they change "wget" # Internet file retriever "yarn" # JavaScript package manager "yazi" # Terminal file management "zlib" # General-purpose lossless data-compression library "zplug" # A next-generation plugin manager for zsh "zsh" # UNIX shell (command interpreter) "zoxide" # A faster way to navigate your filesystem # Custom Taps (Specialized tools) "koekeishiya/formulae/skhd" # Simple hotkey daemon for macOS "koekeishiya/formulae/yabai" # A tiling window manager for macOS # GUI Applications (Casks) # Various applications installed through Homebrew Cask "1password" # Password manager "alacritty" # GPU-accelerated terminal emulator "docker" # Platform to develop, ship, and run applications ````

Customization

Git

After First Installation, Sync dotfile with GitHub

Configure GitHub to usee SSH Configure + Setup

Change dotfile remote url to use ssh: git remote set-url origin git@github.com:Proteusiq/dotfiles.git

MacOS settings

Steps of updating or changing macos/.macos to fit your preferences Example changing Clock to Analog:

# step 1: generate before change default settings
defaults read > before
# step 2: make changes on the UI. For example change clock appearance settings and go back to terminal
defaults read > after
# step 3: used `diff before after` or VSCode to change the difference. On VSCode right click `before` > Select for Compare, right click `after`> Compare with Selected
# find the changes that highlights the UI chnages

diff

Translate the changes to .macos

# Prayson's Clock Preferences Dock
defaults write com.apple.menuextra.clock IsAnalog -int 0
defaults write com.apple.menuextra.clock ShowAMPM  -int 1
defaults write com.apple.menuextra.clock ShowDate -int 0
defaults write com.apple.menuextra.clock ShowDayOfWeek  -int 0
defaults write com.apple.menuextra.clock ShowSeconds  -int 0

See RexYuan's settings for inspiration and examples

Who You Gonna Call? 👻

cheat.sh - curl https://cheat.sh/<cli_command>

Using Tools

Tips + Tricks ### Short🐈 Ctrl + f ### Sesh Tmux raycast plugins sesh + sesh connect on terminal rocks + k ### Using [tmux](https://tmuxcheatsheet.com/) ```sh # installl plugins + I # prefix is which is C-b + c # create a new session + n # previous session or instead of n, a to switch to session + "Shift + 2" (") or i to split horizontal + "Shift + 5" (%) o - to split vertical + Arrows or hjkl # move across panes + : # command mode (:rename-window :rename-session :kill-session -a #kill all session but this one :kill-session -t , :kill-server # kills all session) + d # dettach session tmux ls # list sessions + s # list sessions + , # rename window + & # close window + z # min/maximize pane + p (P menu) # => popup terminal (leader + p to close) + O # => popup sessions (esc to close) # custom iexit # alias to kill-session ikill # alias to kill-server iswitch # alias to switch-session ipop # alias for popup window ``` ### Using fzf ```sh # search fzf # fzf -q .py$ -e # open files/folders with nvim nvim # Ctrl + t (C-t) nvim ** # + TAB # open files and folder cd ** # + TAB # commands things with fzf (kill, unalias, unset, export, ssh) kill -9 ** # TAB (Next TAB will multiselect and Shift+Tab to deselect) # looking throw the history # C-r docker # + C-r filter search to 'docker' history ``` ## Oh Vim Vim keybindings: ### Modes | **Key** | **Explanation** | |----------|------------------------------------------| | `Esc` | Command mode | | `i` | Edit mode | | `V` | Visual mode | | `a` | Move cursor forward and enter edit mode | | `A` | Move cursor to the end of the line, enter edit mode | | `o` | Add newline below and enter edit mode | | `O` | Add newline above | ### Deleting and Changing Text | **Key** | **Explanation** | |----------|-------------------------------------------------| | `x` | Delete the character under the cursor | | `~` | Swap the case of the character under the cursor | | `dd` | Cut the current line | | `d}` | Cut until the end of the block | | `cw` | Change word: delete the word in focus and enter edit mode | | `dw` | Delete word | | `D` | Delete to the end of the line | | `C` | Delete to the end of the line and enter edit mode | | `ct` | Delete up to (but not including) the specified character | | `.` | Repeat the last action | | `u` | Undo | | `3u` | Undo last 3 changes | | `Ctrl-r` | Redo | ### Navigation | **Key** | **Explanation** | |----------|--------------------------------------------------| | `hjkl` | Move cursor (left, down, up, right) | | `20j` | Go down 20 lines | | `:20` | Jump to line 20 | | `w` | Move to the next word | | `b` | Move backward one word | | `4b` | Move backward 4 words | | `0` | Move to the beginning of the line | | `^` | Move to the first non-blank character of the line| | `t` | Move just before the specified character | | `f` | Move to the specified character | | `%` | Move to the matching parenthesis, bracket, or brace | | `gg` | Go to the top of the file | | `G` | Go to the bottom of the file | | `{` | Jump backward by paragraph | | `}` | Jump forward by paragraph | | `*` | Jump to the next occurrence of the word under the cursor | | `z` | Center the line with the cursor in the middle of the screen | ### Copy and Paste | **Key** | **Explanation** | |----------|------------------------------------------| | `yy` | Copy (yank) the current line | | `P` | Paste before the cursor | | `p` | Paste after the cursor | ### Search and Help | **Key** | **Explanation** | |-----------------|----------------------------------| | `:h navigation` | Help on navigation | | `:h search` | Help on search commands | | `*` | Search for the word under the cursor | ### File and URL Handling | **Key** | **Explanation** | |----------|------------------------------------------| | `gf` | Go to file path and open | | `gx` | Go to URL and open in browser | ### Recording and Running Commands | **Key** | **Explanation** | |----------|------------------------------------------| | `qa ... q` | Record macro | | `@a` | Repeat recorded macro | | `13@a` | Repeat recorded macro 13 times | | `Shift+V Shift+G :` | Select to the end of the document | | `:'<,'> norm A!` | Jump to the end and add `!` | | `:norm I` | Jump to the beginning and enter insert mode | ### Browsing in Edit Mode | **Key** | **Explanation** | |----------|------------------------------------------| | `Ctrl-p` / `Ctrl-n` | Browse written variables or names in edit mode | ## Using lazy(neo)vim ```sh # Space # window actions # w # moves back to Neo-Tree [b ]b # option/alt 8 and 9 for [] to navigate buffers(tabs) # command mode : # run sh commands: use case sort data, select and execute : <','>!sort or structure JSON <','> !jq # Visual mode select: # '<,'>s/^./# &/ -> replace anything with '#' to all non-blank lines" # '<,'>s/^\([^#]\)/# &/ -> replace anything but lines starting with '#' with # " : + !(Shift + 1) # filter mode: echo "OPENAI_API_KEY=sk-****** >> .env" ```

Acknowledgements