hallettj
Just a basic programmer living in California
- 1 Post
- 2 Comments
Joined 2 years ago
Cake day: February 23rd, 2024
You are not logged in. If you use a Fediverse account that is able to follow users, you can follow this user.
hallettj@leminal.spaceto
Linux@programming.dev•What are some of your most useful or favorite terminal commands?English
0·1 month agoWhen I’m in some subdirectory of a git repository, I use this command to jump to the repo root:
alias gtop="cd \$(git rev-parse --show-toplevel)"

I certainly see the value in this strategy! But I’m not going to give up my top-level aliases. I enjoy saving two keystrokes too much!
Here are my most used aliases (these ones use Nushell syntax):
I was also delighted to learn that I could get the same short aliases for corresponding fugitive commands in vim/neovim using the vim-alias plugin:
-- This is a lazy.nvim plugin module return { 'Konfekt/vim-alias', config = function() -- Shortcuts for git operations to match some of the shell aliases I have. -- For example, `:sw ` expands to `:Git switch ` vim.cmd [[Alias sw Git\ switch]] vim.cmd [[Alias ci Git\ commit]] vim.cmd [[Alias pull Git\ pull]] vim.cmd [[Alias push Git\ push]] vim.cmd [[Alias show Git\ show]] vim.cmd [[Alias re Git\ restore]] vim.cmd [[Alias lg GV]] end, }Fugitive is very nice for integrating git workflows in the editor, and its commands have very nice tab completion for branches and such.