{"id":16583207,"url":"https://github.com/manid2/dotfiles","last_synced_at":"2025-10-29T07:32:09.212Z","repository":{"id":37387721,"uuid":"275183111","full_name":"manid2/dotfiles","owner":"manid2","description":"Swiss army knife of Software Engineer. Simplifies complex and repititive tasks. Save, restore \u0026 sync configurations.","archived":false,"fork":false,"pushed_at":"2024-09-15T17:43:13.000Z","size":417,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-09-15T19:06:39.495Z","etag":null,"topics":["aliases","bashrc","dotfiles","gitconfig","vimrc","zshrc"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/manid2.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-06-26T15:04:50.000Z","updated_at":"2024-08-17T18:59:57.000Z","dependencies_parsed_at":"2024-01-28T15:24:29.868Z","dependency_job_id":"9585ee33-a38a-480f-a4cb-6d233adf7d1f","html_url":"https://github.com/manid2/dotfiles","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manid2%2Fdotfiles","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manid2%2Fdotfiles/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manid2%2Fdotfiles/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manid2%2Fdotfiles/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/manid2","download_url":"https://codeload.github.com/manid2/dotfiles/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219858112,"owners_count":16556048,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aliases","bashrc","dotfiles","gitconfig","vimrc","zshrc"],"created_at":"2024-10-11T22:35:10.156Z","updated_at":"2025-10-29T07:32:03.854Z","avatar_url":"https://github.com/manid2.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"dotfiles\n========\n\nSwiss army knife of Software Engineer. Simplifies complex and repetitive\ntasks. Save, restore \u0026 sync configurations.\n\nThis repository is a collection of system configurations and tools for all my\ntasks in coding, admin and general system use.\n\nTested on Gnu/Linux OS such as Debian and its derivatives Ubuntu and Kali.\nMinimal support for MacOS as it is not \"free\" and recommended to use Gnu\nvariants of Unix tools such as `find`, `xargs`, `ls`, etc using Homebrew.\n\nInstall\n-------\n\nInstalling means just creating the relative symbolic links to right locations\nin `$HOME` or `$XDG_CONFIG_HOME` for the system software to use the\nconfiguration and run command scripts i.e. `~/.bashrc`, `~/.zshrc`,\n`~/.vimrc`.\n\nFor this just run `./install` in `dotfiles` repository root directory.\n\nUninstall\n---------\n\nUninstalling means just removing the relative symbolic links from the\ninstalled locations.\n\nFor this just run `./uninstall` in `dotfiles` repository root directory.\n\nWhy do we need this repository?\n-------------------------------\n\nAs Software Engineers we tend to use command line (CLI) more for our daily\ntasks such as reading and writing code and documentation.\n\nWhen some command or a group of commands for a given task is too hard to\nremember in its raw form we create an alias, a function or a binary script for\neach of its variant so that it is easy to remember to type it or search for it\nin command line history.\n\nOver time these custom commands, aliases and plugins become too many to keep\nthem in a single file for each software and also as the software version\nchanges so does the configuration and associated custom commands that needs to\nbe updated.\n\nSo we create this repository and keep all the scripts and configurations here.\nUse git to version the changes and sync across machines by cloning. Any system\nwe use it must have all these functionalities and boost our productivity\nsignificantly.\n\nBelow are some example use cases to help us understand the need for this\nrepository.\n\n### Example 1: Check date \u0026 time\n\nChecking date time with timezone in raw form requires us to remember this\nformat string which is hard and error prone due to typing mistake.\n\n```bash\n$ date +\"%Y-%m-%dT%H:%M:%S%z\"\n2024-01-22T12:30:06+0530\n```\n\nThis is simplified by adding an alias that is easy to remember, type or search\nin command line history.\n\n```bash\nalias dtz='date +\"%Y-%m-%dT%H:%M:%S%z\"'\n\n$ dtz\n2024-01-22T12:30:06+0530\n```\n\nThis is further added to the text editor `vim` as a keymap and an\nabbreviation so it can be inserted into text files or source code.\n\n```vim\n\" Insert date\nnnoremap \u003cLeader\u003edt          \"=strftime('%Y-%m-%dT%H:%M:%S%z')\u003ccr\u003ep\ninoremap \u003cC-\\\u003ed              \u003cC-O\u003e\"=strftime('%Y-%m-%dT%H:%M:%S%z')\u003ccr\u003ep\niabbrev \u003cexpr\u003e dtz           strftime('%Y-%m-%dT%H:%M:%S%z')\n```\n\n### Example 2: Create relative symbolic links\n\nWhen installing a software package or binary without root permissions we may\nneed to create symbolic links relative to the target directory where we want\nto install.\n\nFor this task the raw command as below and it is hard to remember and error\nprone when typing.\n\n```bash\nln \"$opt\" \"$(realpath --relative-to=\"$rl_dst\" \"$src\")\" \"$dst\"\n```\n\nThis is simplified by adding a function in `~/.bashrc` or `~/.zshrc` as below\nand then create aliases for shorter form.\n\n```bash\nlnr () {\n\tlocal opt=\"$1\"\n\tlocal rl_dst=\"$2\"\n\tlocal src=\"$3\"\n\tlocal dst=\"$4\"\n\tln \"$opt\" \"$(realpath --relative-to=\"$rl_dst\" \"$src\")\" \"$dst\"\n}\n\n_lnrb () {\n\tlocal opt=\"$1\"\n\tlocal src=\"$2\"\n\tlocal dst=\"$HOME/.local/bin\"\n\tlnr \"$opt\" \"$dst\" \"$src\" \"$dst\"\n}\n\nalias lnrb='_lnrb -s '\nalias lnrbf='_lnrb -sf '\n```\n\nNow installing a binary such as `bat` is simple as:\n\n```bash\nlnrb ~/Downloads/softwares/bat\n\n$ file ~/.local/bin/bat\n~/.local/bin/bat: symbolic link to ../../Downloads/softwares/bat/\n```\n\n### Example 3: Search for aliases\n\nAdd a simple function search for aliases using `grep` to filter through the\nsearch pattern and use `less` to page through with colors to view the aliases.\n\n```bash\naliasg () {\n\talias | grep --color=always \"$@\" | less -r -F\n}\n\n$ aliasg 'date'\ndtts='date +\"%Y-%m-%d-%H-%M-%S\"'\ndtymd='date +\"%Y-%m-%d\"'\ndtz='date +\"%Y-%m-%dT%H:%M:%S%z\"'\n\n$ aliasg 'git' | wc -l\n121\n```\n\nThere are many more such simplified commands, aliases, custom functions and\nutilities for software engineer tasks in this repository and can be easily\nunderstood from the code and comments in code.\n\nDesign\n------\n\nIdeally there is no need to design the `dotfiles` file layout and code as they\nare just simple collection of configurations and scripts. This is what I had\ndone initially. Started simple and added shell and vim scripts over time.\n\nSo only for these shell and vim scripts I had to design the file layout and\ncreate some conventions such as plugins to keep the code modular and scalable.\n\nThe design of the scripts file layout is based on Unix philosophies:\n\n* One tool for one task and each tool must be a filter to allow chaining of\n  the commands.\n* Make each tool work together to create the Integrated Development\n  Environment a.k.a. IDE.\n\n### Shell scripts plugins\n\nPlugins in shell scripts are just normal scripts that are designed to be\nsourced into main shell configuration scripts `~/.zshrc` or `~/.bashrc`.\n\nThey are used to separate the related code for a given tool or a task into a\nsingle script so that it becomes easy to debug, look up or detach if needed.\n\nFor example the code for git aliases and custom functions are grouped into a\nsingle script `git.plugin.sh` and sourced into shell common scripts. Here git\ndoesn't depend on a specific shell so it is sourced into shell common but the\nplugin for `fzf` tool depends on the shell so it is sourced into\n`fzf.plugin.zsh` in zshrc parts scripts.\n\nFile layout\n-----------\n\n`dotfiles` file layout is based on grouping the task or use case related\nscripts such as aliases, plugins, keymaps and options into their units that\nare later sourced into main shell configuration scripts.\n\n### Shell scripts file layout\n\n```bash\n$ tree -L 3 --charset ascii\n|-- dot-config\n|   `-- zshrcparts\n|       |-- aliases\n|       |-- completions\n|       |-- keymaps\n|       |-- plugins\n|       `-- prompt\n|-- dot-zshrc\n```\n\n### Vim scripts file layout\n\n```bash\n$ tree -L 2 dot-config/nvim\ndot-config/nvim\n|-- after\n|   `-- syntax\n|-- autoload\n|   |-- custom\n|   `-- statusline\n|-- lua\n|   |-- init.lua\n|   |-- lsp\n|   `-- plugins\n|-- plugin\n|   |-- custom.vim\n|   `-- statusline.vim\n|-- autocmds.vim\n|-- colors.vim\n|-- init.vim\n|-- keymaps.vim\n|-- options.vim\n`-- plugins.vim\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmanid2%2Fdotfiles","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmanid2%2Fdotfiles","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmanid2%2Fdotfiles/lists"}