Archive

All published posts

I made a neovim plugin

I’ve slowly adding more and more lua functions into my neovim configuration, and recently I noticed a pattern for a class of functions that reach out to run shell commands that can be abstracted away.

https://youtu.be/8m5ipBuopPU

Check out the project readme for the most up to date details on the plugin itself.

...

kedro Virtual Environment

Avoid serious version conflict issues, and use a virtual environment anytime you are running python, here are three ways you can setup a kedro virtual environment.

https://youtu.be/ZSxc5VVCBhM

I prefer to use conda as my virtual environment manager of choice as it give me both the interpreter and the packages I install. I don’t have to rely on the system version of python or another tool to maintain python versions at all, I get everything in one tool.

...

Kedro Install

Kedro comes with an install command to install and manage all of your projects dependencies.

https://youtu.be/IWimEs-hHQg

You must start by having your kedro project either cloned down from an existing project or created from kedro new. Then activate your environment.

...

Kedro Git Init

Immediately after kedro new, before you start running kedro install or your first line of code the first thing you should always do after getting a new kedro template created is to git init.

https://youtu.be/IGba3ytf_6U

Its as simple as these three commands to get started.

...

Kedro New

https://youtu.be/uqiv5LAiJe0

Kedro new is simply a wrapper around the cookiecutter templating library. The kedro team maintains a ready made template that has everything you need for a kedro project. They also maintain a few kedro starters, which are very similar to the base template.

What is Kedro

...

What is Kedro

Kedro is an unopinionated Data Engineering framework that comes with a somewhat opinionated template. It gives the user a way to build pipelines that automatically take care of io through the use of abstract DataSets that the user specifies through Catalog entries. These Catalog entries are loaded, ran through a function, and saved by Nodes. The order that these Nodes are executed are determined by the Pipeline, which is a DAG. It’s the runner’s job to manage the execution of the Nodes.

https://youtu.be/Wf4rnFsaFFU

What is Kedro

...

How I Kedro

https://youtu.be/bw5_FWDVRpU

I recently switched over to using Ubuntu, it works well pretty much out of the box for me. I am using gnome with a dark theme.

I am still using the built in default gnome terminal, it just works. It does all the things that I need it to do. It supports transparency renders my fonts and allows me to highlight things well.

...

3 min read

tmux show-messages

https://youtu.be/LLk94fKpGg4

As we push the limits of tmux further and further you are bound to end up in a situation where you are mashing down a hotkey and it’s just not doing what you want it to do, and you have no idea why.

show-messages is a tmux command that can be used to show what tmux is actually doing behind the scenes. This might highlight any hot key conflicts you might have in your ~/.tmux.conf.

...

1 min read

tmux ta

https://youtu.be/nT0FA1RNZEs

Now your creating, jumping, and killing sessions like a boss. You are slicing through projects with ease, let me show you one more thing that can be the cream on top of this silky smooth setup we have been working towards.

This script is simply my fork of Chris Toomey’s tat script straight out of his course. It helps us create or jump to project specific sessions with ease.

...

2 min read

tmux display-message

https://youtu.be/utfLA6L8o5s

You’ve got some long running tasks, and you’re trying to stay productive and knock tasks off that board, but you keep finding that your processes finish and you stay on other tasks for longer than you should. You were in the flow and just did not check back in on it. With display-message you can send yourself a notification when that long running task is complete.

Here is a snippet of display-message from the tmux man page. I rarely need to do anything other than just display message, but there are other flags for it.

...

1 min read

killing tmux

https://youtu.be/QWPyYx54JbE

Now it’s time to switch gears, we are onto a different part of our day and there are just too many sessions running and we need to clean up shop.

One viable option is to nuke the whole dang thing. I actually do this more than you might think.

...

2 min read

tmux has-session

https://youtu.be/XucVVgGmesM

I see you there, trying to script out your tmux layouts. Tryig to get each project setup just perfect with a script, but you keep stumbling over yourself with duplicate session error messages

The has-session tmux command is a handy tool to prevent this duplicate session error message when scripting your tmux layouts.

...

1 min read

tmux list-keys

https://youtu.be/Y1MYmL8ZolE

Tmux list keys can be a useful tool to help remind you of what kebindings you have setup. You can search for them and scroll just like in tmux copy-mode.

You can call list-keys from the command line but the interface is not very usable by itself. It might be nice to mix with grep or a pager in some circumstances.

...

1 min read

tmux status-bar

https://youtu.be/mvgM8UH11_U

The tmux status bar can be a handy tool to remind yourself where you are within tmux. It can also include a bunch of system information like battery status, cpu, mem, whatever you can get from the command line. Honestly I like to keep it minimal, and actually keep it turned off most of the time. I find that it helps a little bit for others to follow along if I keep it on in certain circumstances.

You can set a hotkey to show or hide the status bar.

...

2 min read

tmux source-file

https://youtu.be/dDq0depPrTs

So you have been tricking out that .tmux.conf, you’re looking for a silky smooth workflow that lets you fly through tmux with super speed, but every time you tweak out that .tmux.conf you have to restart your whole session. Not amymore,

Let’s add this to the bottom of our tmux.conf so that you can see everytime it gets sourced.

...

1 min read

tmux fzf session jumper

https://youtu.be/DkJ9rb85LC0

Quickly getting between tmux splits is critical skill for productivity. You can get by with next or prev session for awhile, but if you have more than about three session you need something a bit more targeted.

I have used this fzf one keybinding for quite awhile, honestly I did not make it up, and cannot remember where it came from. It will open up a session picker in a new full screen window.

...

1 min read

tmux next/prev session

https://youtu.be/8kZnjHPYnKU

Now that we are splitting up work into their own sessions, lets talk about how to navigate between them without the command line. Navigating sessions is what kept me using a too many splits and windows workflow for far too long. It was rough, I was always tripping over panes and windows until I got too frustrated and just ran tmux kill-server to start on a new blank slate.

bind -n M-P switch-client -p bind -n M-N switch-client -n

How I navigate tmux in 2021

...

1 min read

tmux start application

https://youtu.be/c-a2Bnv_NJ0

Scripting tmux to open up specific applications can be intimidating your first time. It can be tricky to get it to start in the right directory. If you are trying to assign applictaions to a keybinding it can be easy to mess up and have weird things happen every time your ~/.tmux.conf gets sourced.

I used this one for a number of years to take a quick peek into my systems performance while a memory intensive task was running.

...

2 min read

tmux rename session

https://youtu.be/WRLRiQDjVIA

So you have been working on your tmux workflow, you’ve dropped a too many window workflow for scoping work that belongs together into separate sessions, but you cannot remember what session your work is in. If your diligent you have named your window when you created it, but sometimes its intent has changed or your were just plain too lazy at the time for the extra characters needed to name it. Don’t worry we can still give that session a descriptive name.

Let’s rename some sessions in the terminal.

...

1 min read

tmux targeted session

https://youtu.be/5KE7Il7SOEk

This is something that I made up but use every single day, this is what keeps much of what is on my blog or my teams private work wiki going. I have a few very important directories that I have assigned directly to a hotkey for fast session switching.

bind -n M-i new-session -A -s waylonwalker_com "cd ~/git/waylonwalker.com/ && nvim" bind i popup -E -h 95% -w 95% -x 100% "tmux new-session -A -s waylonwalker_com 'cd ~/git/waylonwalker.com/ && nvim'" bind -n M-I popup -E "tmux new-session -A -s waylonwalker_com 'cd ~/git/waylonwalker.com/ && nvim'"

tmux new-session

...

tmux new-session

https://youtu.be/LbQNdCAUogE

This one starts a new chapter in our series that is going to open up a whole new set of workflow productivity options, understanding how the new-session command is a critical command in our adventure into tmux glory. This is going to open the door for some seriously game changing hotkeys and scripting.

# create a new session tmux new-session # create a new session detached tmux new-session -d # create a new session and name it tmux new-session -s me # create a new named session and attach to it if one exists tmux new-session -As me

How I navigate tmux in 2021

...

1 min read

tmux detach

https://youtu.be/A1qx3tNKDdA

tmux detach is a handy tmux command that will quit your current session while keeping it running. The full name of the comamnd is detach-client, detach is a shorthand.

default keybinding

...

tmux attach

https://youtu.be/JQ0yDCVu44E

attach is one of the most useful features of tmux. If you have no interest in tmux for pane and window management, you should use tmux for this. It can be a life saver if you ever get disconnected from the host machine or accidently close your terminal you can connect right back into the session you were just in using attach.

tmux attach

this command will simply attach back to tmux if you are ever disconnected

...

tmux command line

https://youtu.be/SNu-4IrkjAs

So far we have covered a lot of tmux commands and how they map to keybindings but these same commands can be executed at the command line.

Let’s make a popup that displays our git status for 5s or until we close it manually. We can run the following command at the command line, in a split.

...

tmux copy-mode

https://youtu.be/-ypY_-VmBKk

tmux copy-mode is a tmux mode that lets you scroll, search, copy, and jump your way through a pane. There are a ton of keybindings for copy-mode, the main ones you will need to know are / for searching down ? for searching up, n for next item, space for starting a selection, and enter to copy the selection. Arrow keys will be used for navigation unless you have specified vi mode, then it will be hjkl.

Default keybinding to get into copy mode is prefix+[.

...

tmux join-pane

https://youtu.be/Vm5rRtcVXLw

Join-pane allows you to join panes that you have broken away from your window, or created in a different window to the window you want it in. As far as I know there is not a default keybinding for it.

Before you can join a pane you must first have a pane marked to join. Once you mark a pane, go back to the window you want to join it to and join-pane.

...

tmux break-pane

https://youtu.be/ICL609F2xnc

Break-pane is a handy tmux command when your layout gets too cramped and you want to just move a split into its own window. Calling break-pane does exactly that, it creates a new-window for you and moves your currently selected split into that window

Default key binding for break-pane

...

tmux zoom

https://youtu.be/Rn6mOarCQ-Y

Zooming into the current split in tmux is a valuable tool to give yourself some screen real estate. These days I am almost always presenting, streaming, or pairing up with a co-worker over a video call. Since I am always sharing my screen I am generally zoomed in to a level that is just a bit uncomfortable, so anytime I make a split it is really uncomfortable, being able to zoom into the split I am focused on is a big help, and also help anyone watching follow where I am currently working.

Default key bindings for zooming the current split

...