Posts tagged: bash

All posts with the tag "bash"

Creating a minimal config specifically for git commits has made running much more pleasant. It starts up Much faster,...

Stow is an incredible way to manage your dotfiles. It works by managing symlinks between your dotfiles directory and ...

tmux popups can be sized how you like based on the % width of the terminal on creation by using the flags (h, w, x, y...

Code Review from the comfort of vim | Diffurcate

I often review Pull requests from the browser as it just makes it so easy to see the diffs and navigate through them, but there comes a time when the diffs get really big and hard to follow. That’s when its time to bring in the comforts of vim.

https://youtu.be/5NKaZFavM0E

This all stems from the great plugin by AndrewRadev. It breaks a down into a project. So rather than poping into a pager from git diff, you can pipe to diffurcate and it will setup a project in a tmp directory for you and you can browse this project just like any other except it’s just a diff.

...

Open files FAST from zsh | or bash if thats your thing

https://youtu.be/PQw_is7rQSw

I am often in a set of tmux splits flying back and forth, accidentally close my editor, so when I come back to that split and hit my keybinds to edit files I enter them into zsh rather than into nvim like I intended. Today I am going to sand off that rough edge and get as similar behavior to nvim as I can with a couple of aliases.

Make sure you check out the YouTube video to see all of my improvements.

...

30 days dotfile ricing

https://youtu.be/Jq1Y48F_rOU

I am challenging myself to 30 days of dotfile ricing. I have been on linux desktop for a few months now and have a pretty good workflow going, I have the coarse edits done to my workflow, but it has some rough edges that need sanded down. It’s time to squash some of those little annoyances that still exist in my setup.

This is primarily going to be focused on productivity, but may have a few things to just look better. This will comprise heavily of aliases, zsh, and nvim config.

...

Update Alternatives in Linux

update-alternatives --query python update-alternatives: error: no alternatives for python sudo update-alternatives --install /usr/local/bin/python python `which python3.8` 2 # update-alternatives: using /usr/bin/python3.8 to provide /usr/local/bin/python (python) in auto mode sudo update-alternatives --install /usr/local/bin/python python `which python2.7` 5 # update-alternatives: using /usr/bin/python2.7 to provide /usr/local/bin/python (python) in auto mode update-alternatives --query python # Name: python # Link: /usr/local/bin/python # Status: auto # Best: /usr/bin/python2.7 # Value: /usr/bin/python2.7 # # Alternative: /usr/bin/python2.7 # Priority: 5 # # Alternative: /usr/bin/python3.8 # Priority: 2 sudo update-alternatives --install /usr/local/bin/python python `which python3.8` 20 # update-alternatives: using /usr/bin/python3.8 to provide /usr/local/bin/python (python) in auto mode

Trim unused git branches

Trim branches no longer on origin ¶ # git remote prune origin --dry-run git remote prune origin Find branches already merged ¶ # git checkout main # list remote branches that have already been merged into main git branch -r --merged # list local branches that have already been merged into main git branch --merged

Create a Virtual File Gallery with Symlinks

Creating a directory that is a union of several directories can be achieved with a few symlinks at the command line.

Here is how I am creating a virtual directory of all my projects that is a combination of both work and not-work projects. I am creating symlinks for every directory under ~/work and ~/git.

rm -rf ~/projects mkdir ~/projects ln -sf ~/work/* ~/projects ln -sf ~/git/* ~/projects

⚠ Notice that first I am recreating the directory each time. This will ensure that any project that is deleted from their actual directory is removed from the virtual gallery.

...

Vim Wsl Clipboard

I’ve long used neovim from within windows wsl, and for far too long, I went without a proper way to get text out of it and into windows.

wsl can access clip.exe. You can do some cool things with it, such as cat a file into the clipboard, sending output from a command to the clipboard, or set an autocmd group in vim to send yank to the windows clipboard.

Let’s say you want to send a teammate the tail of a log file over chat. You can tail the file into clip.exe.

...

2 min read