The other day I was thinking,
I spend way too much time going up my terminal history, so I tried to create an alias with the grep command and my life got immediately better:
alias ??='history | grep '
I can now pick and replay the command I need:
~/WorkSpace/ : ?? yarn
10 yarn dev
14 yarn install
16 yarn dev -- -p 5783
23 yarn build-storybook
24 yarn run-storybook
63 yarn
65 yarn
87 yarn
89 yarn
90 yarn
96 yarn
135 yarn add eslint --dev
136 yarn add @typescript-eslint/parser --save-dev
144 yarn
154 rm admin-client/yarn-error.log
170 rm -f yarn.lock
171 rm -f admin-client/yarn.lock
174 cd admin-client && yarn install
175 cd .. && yarn install
183 rm -f yarn.lock
184 rm -f admin-client/yarn.lock
187 cd admin-client && yarn install
188 cd .. && yarn install
193 co -- yarn.lock
245 rm -f yarn.lock
246 rm -f admin-client/yarn.lock
249 cd admin-client && yarn install
250 cd .. && yarn install
255 yarn build
256 yarn build
270 yarn build
294 yarn build
297 yarn build
299 yarn build
300 yarn build
303 yarn build
304 yarn build
305 yarn build
384 co -- admin-client/yarn.lock
503 ?? yarn
But then I quickly became tired with the copy-paste routine and looked into hotkeys (I am using iTerm).
It turns out that Settings > Pointer > Bindings could really implement what I needed:
Now I can simply select the command I need, CMD+right click and voilรก :)
Top comments (0)