{"id":13602912,"url":"https://github.com/JohnEricson/dotfiles","last_synced_at":"2025-04-11T13:31:53.079Z","repository":{"id":44089581,"uuid":"371017486","full_name":"JohnEricson/dotfiles","owner":"JohnEricson","description":"Personal config files for Bash, Windows PowerShell, PowerShell Core and Vim/Neovim. Works on Linux/Windows/WSL/Cygwin/Git Bash/VS Code Remote - Containers. Good cross platform configuration that works similar on different operatingsystems.","archived":false,"fork":false,"pushed_at":"2024-05-22T20:32:39.000Z","size":1322,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-05-22T21:43:47.304Z","etag":null,"topics":["bash","centos","cygwin","debian","devcontainer","devcontainer-ready","devcontainers","dotfiles","linux","neovim","powershell","rhel","rockylinux","shell","ubuntu","vim","vscode","vscode-remote","windows","wsl"],"latest_commit_sha":null,"homepage":"","language":"PowerShell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JohnEricson.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2021-05-26T11:58:53.000Z","updated_at":"2024-05-28T14:45:48.477Z","dependencies_parsed_at":"2023-10-16T06:29:09.139Z","dependency_job_id":"9fb5d968-e531-46d5-914d-e3550c4eeeeb","html_url":"https://github.com/JohnEricson/dotfiles","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JohnEricson%2Fdotfiles","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JohnEricson%2Fdotfiles/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JohnEricson%2Fdotfiles/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JohnEricson%2Fdotfiles/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JohnEricson","download_url":"https://codeload.github.com/JohnEricson/dotfiles/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223470318,"owners_count":17150535,"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":["bash","centos","cygwin","debian","devcontainer","devcontainer-ready","devcontainers","dotfiles","linux","neovim","powershell","rhel","rockylinux","shell","ubuntu","vim","vscode","vscode-remote","windows","wsl"],"created_at":"2024-08-01T18:01:42.700Z","updated_at":"2025-04-11T13:31:53.066Z","avatar_url":"https://github.com/JohnEricson.png","language":"PowerShell","funding_links":[],"categories":["bash"],"sub_categories":[],"readme":"# John's dotfiles\n\nPersonal config files for Bash, Windows PowerShell, PowerShell Core and Vim/Neovim. Works on Linux/Windows/WSL/Cygwin/Git Bash.\nGood cross platform configuration that works similar on different operatingsystems.\n\n## Install\nTo install these dotfiles and [chezmoi](https://www.chezmoi.io) which is the software used to easily manage them, just run these commands on a new machine:\n\n### Linux / Unix\nAs your normal user in your home dir run:\n```sh\nsh -c \"$(curl -fsLS get.chezmoi.io)\" -- init --apply JohnEricson\n```\nOn Ubuntu the `curl` command is not installed by default so the equivalent using wget is:\n```sh\nsh -c \"$(wget -qO- get.chezmoi.io)\" -- init --apply JohnEricson\n```\nIf you get questions about entering username/password try this command instead:\n```sh\nsh -c \"$(curl -fsLS get.chezmoi.io)\" -- init --apply --guess-repo-url=false https://github.com/JohnEricson/dotfiles.git\n```\nThe new config for bash will be used next time you login. To refresh your current session with the new config run:\n```sh\n. ~/.bashrc\n```\n#### Alternative one-liner\nThis both installs these dotfiles and [chezmoi](https://www.chezmoi.io) as well as refresh your current session with the new bash config:\n```sh\n. \u003c(curl -sL https://raw.github.com/JohnEricson/dotfiles/main/install.sh)\n```\n\n### Windows\nThis installs [chezmoi](https://www.chezmoi.io) in the official way in your `~/bin` dir. Same way as it's installed on Linux.\n\nStart PowerShell as your normal user and run:\n```powershell\nSet-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope CurrentUser\n```\nAfter this in your home dir run (This allows your user to run *.ps1 scripts):\n```powershell\n(irm -useb https://get.chezmoi.io/ps1) | powershell -c -\n```\nThen run:\n```powershell\n~/bin/chezmoi init --apply JohnEricson\n```\nClose your PowerShell window and open a new one to refresh your shell with the new config.\n\n## Manage configuration\nThis configuration creates an alias `cm` that calls the `chezmoi` command. This is to make chezmoi easier to work with.\n\n### Update configuration to latest version on a machine\nAs your normal user run:\n```sh\ncm update\n```\n\n## Keyboard shortcuts\n\n### Windows/Linux Gnome\n\nVerified to work with Windows 11 and Ubuntu 24.10. On Ubuntu, Gnome extension [Dash to Panel](https://extensions.gnome.org/extension/1160/dash-to-panel/) should be installed for best experience, although standard Ubuntu Dock is also customized as good as possbile.\nThe Win button here is also called the Super button on Linux.\n\n| Keyboard Shortcut | Description |\n|-------------------|-------------|\n| Win               | Open Start meu. Search for apps to start |\n| Alt+Tab           | Switch between open applications |\n| Ctrl+Alt+Tab      | Same as Alt+Tab but allows changing app with keyboard cursors and enter (Unsure about Linux) |\n| Win+Tab           | Switch between open applications |\n| Win+l             | Lock session |\n| Shift+Win+s       | Take interactive screenshot (Snipping tool in Windows) |\n| Win+1..9          | Switch open application that is pinned to Windows Taskbar/Gnome panel on slot where number 1 to 9 is slot on panel |'\n| Ctrl+Win+Left     | Switch to left workspace |\n| Ctrl+Win+Right    | Switch to right worksapce |\n| Win+Left          | Snap active window to left side of screen |\n| Win+Right         | Snap active window to right side of screen |\n| Win+Up            | Maximize active window to full screen |\n| Win+Down          | Restore active maximized window to previous size |\n| Alt+Space         | Activate the window menu |\n| Win+n             | Show notifications (Unsure about Linux) |\n| Win+Shift+v       | Set focus to a notification (toast) on screen (Unsure about Linux) |\n\n### Microsoft PowerToys\n\nThese requires program [Microsoft PowerToys](https://github.com/microsoft/PowerToys) to be installed.\n\n| Keyboard Shortcut | Description |\n|-------------------|-------------|\n| Win+Alt+Space     | Show PowerToys Run launcher |\n| Shift+Win+h       | Toggle highlighting clicks on screen. Good for presentations |\n| Win+Ctrl+t        | Pin active window to always stay on top |\n\n### Neovim/Vim\n\n| Keyboard Shortcut | Description |\n|-------------------|-------------|\n| *                 | Search forward for word under cursor |\n| #                 | Search backward for word under cursor |\n| .                 | Repeat the last buffer operation. For example add same inputted text or do same manipulation as before |\n| Ctrl+PgUp         | Go to left tab |\n| Ctrl+PgDn         | Go to right tab |\n| Ctrl+h            | Go to previous buffer |\n| Ctrl+l            | Go to next buffer |\n| Shift+H           | Go to top of page |\n| Shift+L           | Go to bottom of page |\n| h j k l           | Navigate left, down, up, right |\n| zf                | Create fold of selected text |\n| zo                | Open fold |\n| zc                | Close fold |\n| zd                | Delete fold |\n| za                | Toggle fold |\n| w                 | Navigate one word forward |\n| b                 | Navigate one word backward |\n| f                 | Navigate forward to first matching character pressed after f |\n| t                 | Navigate forward to one character before first matching character pressed after f |\n| gd                | Go to definition. For example go to function in Python |\n| Shift+k           | Enter link in :help |\n| Enter             | Enter link in :help (only in help) |\n| Ctrl+o            | Go backward |\n| Ctrl+r*           | Paste on command line. Instead of using Shift-Insert to insert the marked text, use Vim registers. So first copy your line using a yank command like 0y$ and then use :Ctrl-r0 to paste it into the command line. From: https://vi.stackexchange.com/questions/38508/paste-command-to-command-mode-instead-of-insert-mode |\n| \":p                | Paste last command ran on command line. From: https://stackoverflow.com/questions/7047618/how-to-copy-text-from-command-line-mode-in-vim |\n| Ctrl+f (Command Line mode) | Opens the history of all commands you have ran in Command Line. Here you can paste the one you want. From: https://stackoverflow.com/questions/7047618/how-to-copy-text-from-command-line-mode-in-vim |\n| :tabnew \\| term   | Open a new terminal in a new tab. From: https://stackoverflow.com/questions/64584698/how-to-open-a-terminal-in-new-tab-in-neovim-with-only-one-command-without-remap |\n| :tcd              | Like :cd, but only set the directory for the current tab |\n| Ctrl+g            | Get filename and row for current buffer |\n| Ctrl+d            | Half page down. In VS Code this also works in hover opened with gh and focused using shift+k |\n| Ctrl+u            | Half page up. In VS Code this also works in hover opened with gh  and focused using shift+k |\n| Ctrl+f, PgDn      | Page down. In VS Code this also works in hover opened with gh and focused using shift+k |\n| Ctrl+b, PgUp      | Page up. In VS Code this also works in hover opened with gh  and focused using shift+k |\n| H                 | Nove cursor to top (H for high) of the screen |\n| M                 | Move cursor to middle (M for middle) of the screen |\n| L                 | Nove cursor to bottom (L for low) of the screen |\n| u                 | Undo |\n| Ctrl+r            | Redo |\n\n#### Explorer in Neovim/Vim\n\n| Keyboard Shortcut | Description |\n|-------------------|-------------|\n| /                 | Start searching |\n| r                 | Rename the designated file(s)/directory(ies) |\n| R                 | Refresh |\n| Ctrl+Left         | Collapse all directories in Explorer |\n| zm                | Collapse all |\n\n### VS Code\n\n| Keyboard Shortcut | Description |\n|-------------------|-------------|\n| Ctrl+w m          | Maximize editor |\n| Ctrl+k Ctrl+z     | Maximize editor by hiding other editor groups |\n| Ctrl+k Ctrl+m     | Maximize editor by hiding other editor groups (a bit slower) |\n| Ctrl+k Ctrl+w     | Maximize editor by hiding other editor groups (less reliable) |\n| Ctrl+PgUp or Ctrl+h | Go to left tab |\n| Ctrl+PgDn or Ctrl+l | Go to right tab |\n| Ctrl+Shift+PgUp   | Move tab left |\n| Ctrl+Shift+PgDn   | Move tab right |\n| Alt+1..0          | Go to tab X where X is the numerical key between 1 and 0 |\n| Alt+Left          | Go to previous editor in history |\n| Alt+Right         | Go to newer editor in history |\n| Alt+Up            | Move current line or selected lines up one row |\n| Alt+Down          | Move current line or selected lines down one row |\n| Ctrl+Tab          | List and switch to another tab in focused editor group |\n| Alt+z             | Word wrap |\n| Alt+x             | Toggle between normal and relative line numbering |\n| Ctrl+w Ctrl+up, down, left, right | Move focused editor to another/new editor group |\n| Ctrl+w + up, down, left, right | Move focused editor to another/new editor group |\n| Ctrl+w Shift+Left or Right | Move editor group |\n| Ctrl+Shift+Left or Right | Move editor to another editor group |\n| Ctrl+w q          | Close focused editor, or misc. windows such as Markdown preview, Keyboard shortcuts |\n| Ctrl+k w          | Close all editors in group |\n| Ctrl+k z          | Enter Zen mode |\n| Ctrl+ö            | Toggle Terminal. Toogle between show and focus terminal/hide and focus editor |\n| Alt+ö             | Focus last used editor from terminal and keep terminal open |\n| Ctrl+Shift+b      | Build default task |\n| Ctrl+Shift+m      | Toggle showing Problems |\n| Ctrl+Shift+u      | Toggle showing Output |\n| Ctrl+Alt+Shift+m  | Maximize panel |\n| Ctrl+b            | Close sidebar (Only works when sidebar is focused) |\n| Ctrl+shift+e      | Focus Explorer sidebar |\n| Ctrl+Shift+f      | Focus Search sidebar |\n| Ctrl+Shift+o      | Go to Symbol in Editor (Outline view) |\n| Shift+Alt+f       | Set to only search files inside current folder in Search sidebar |\n| Ctrl+Shift+g g    | Focus Source Control sidebar |\n| Ctrl+y            | [Scroll without moving cursor](https://stackoverflow.com/questions/49142401/how-to-scroll-without-moving-my-cursor-in-visual-studio-code-from-the-keyboard) up |\n| Ctrl+e            | [Scroll without moving cursor](https://stackoverflow.com/questions/49142401/how-to-scroll-without-moving-my-cursor-in-visual-studio-code-from-the-keyboard) down |\n| Ctrl+Shift+Enter  | In Explorer toggle selection of files |\n| Shift+k           | Open hover if not opened. Focus it if opened. So press twice to open and navigate |\n| Ctrl+'            | Toggle comment. First select text. If line selection is used then line comments. If block selection is used then block comment |\n| Ctrl+Alt+r        | Works in Terminal. Open list of recently ran commands to select and run again. Allow searching |\n| Ctrl+Shift+o      | Works in Terminal. Opens list of detected links and allows you to open selected one |\n| Shift+k           | Focus hover menu, such as the one that shows when you press gh in Neovim on Python function. When in focus you can scroll in it |\n| F6                | Focus next part in VS Code |\n| Shift+F6          | Focus previous part in VS Code |\n| Shift+F12         | Go to References |\n\n#### Search sidebar\n\n| Keyboard Shortcut | Description |\n|-------------------|-------------|\n| Ctrl+Shift+f      | Focus Search sidebar |\n| Ctrl+Up           | In Search sidebar fields navigate to field above |\n| Ctrl+Down         | In Search sidebar fields navigate to field below |\n| F4                | Next search result |\n| Shift+F4          | Previous search result |\n\n#### Explorer sidebar\n\n| Keyboard Shortcut | Description |\n|-------------------|-------------|\n| Ctrl+e            | Focus Explorer sidebar |\n| Ctrl+Left         | Collapse all directories in Explorer |\n| /                 | Start searching |\n| up, down          | Next or previous search result after searching |\n| Enter             | Open file in new editor |\n| Space             | Preview file in preview editor. Uses same preview editor for all files |\n\n#### VS Code Neovim extension\n\n| Keyboard Shortcut | Description |\n|-------------------|-------------|\n| mi                | Select multiple rows with visual block to get multiple cursors at the beginning of the selection |\n| Hold Alt and click| To place multiple cursors |\n| z=                | Open quickfix menu for spelling corrections and refactoring |\n\n## Git aliases\n\n### Install\n1) Add this to your `~/.gitconfig` file:\n```\n[include]\n   path = .gitaliases\n```\n\n### Aliases\n\n| Alias | Description |\n|-------|-------------|\n| `l`   | Displays a one-line log of commit history, showing commit hash, date, branch, commit message, and author. |\n| `a`   | Shortcut for `git add`. |\n| `ap`  | Interactively adds changes to the staging area. |\n| `c`   | Shortcut for `git commit --verbose`. |\n| `ca`  | Commits all changes, automatically staging tracked files, with verbose mode. |\n| `cm`  | Shortcut for `git commit -m`, allowing you to specify the commit message directly. |\n| `cmp`  | Same as alias `cm` but also push local changes to remote if commit is successful. |\n| `cam` | Commits all changes with a specified commit message. |\n| `camp` | Same as alias `cam` but also push local changes to remote if commit is successful. |\n| `m`   | Amends the last commit with the changes made in the current working directory, maintaining the previous commit message. |\n| `pl`  | Pull latest changes from remote. Shortcut for `git pull` |\n| `p`   | Push local changes to remote. Shortcut for `git push` |\n| `d`   | Shows the difference between the working directory and the index. |\n| `ds`  | Shows the diffstat of changes between the working directory and the index. |\n| `dc`  | Shows the difference between the index and the last commit. |\n| `s`   | Displays a short status showing modified, added, and deleted files. |\n| `co`  | Switch branch. Shortcut for `git checkout`. |\n| `cob` | Creates a new branch and switches to it. |\n| `b`   | Lists branches sorted by the last modified date. |\n| `bd`  | Delete local branch. Shortcut for `git branch -d` |\n| `st`  | Stash modified files. Shortcut for `git stash` |\n| `po`  | Restore stashed files. Use after `st`. Shortcut for `git stash pop` |\n| `la`  | Lists all git aliases configured in the `.gitconfig` file. |\n\nSource code for the aliases: [~/.gitaliases](dot_gitaliases)\n\n### How to use\nThe git aliases are exposed both in git and in bash and PowerShell so you can for example use `s` for `git status` like this:\n#### Bash and PowerShell\n```shell\ng s\n```\nIn bash you can also use:\n```bash\ngs\n```\nwith all the aliases. In PowerShell this works with all aliases except the ones already set in PowerShell such as `gl` and `gp`. The `g s` format is recommended for best compatibility.\n\n#### git\nOf course traditional use of aliases in git works as well:\n```shell\ngit s\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJohnEricson%2Fdotfiles","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FJohnEricson%2Fdotfiles","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJohnEricson%2Fdotfiles/lists"}