this post was submitted on 16 Dec 2025
27 points (90.9% liked)

Linux

10629 readers
634 users here now

A community for everything relating to the GNU/Linux operating system (except the memes!)

Also, check out:

Original icon base courtesy of lewing@isc.tamu.edu and The GIMP

founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[โ€“] hallettj@leminal.space 3 points 17 hours ago (1 children)

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):

alias st = git status
alias sw = git switch
alias ci = git commit
alias lg = git log --color --graph '--pretty=format:%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
alias push = git push

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.

[โ€“] victorz@lemmy.world 3 points 14 hours ago* (last edited 14 hours ago) (1 children)

two keystrokes

For me I'd be saving one keystroke. Status for me would be g s, g c for commit, and so on. Single letter aliases for the most common commands, two letters for less common in a conflict. ๐Ÿ˜

But these days since a few years back I just use lazygit (aliased to lg btw, lol).

Everything in lazygit is basically just single keystrokes also. c for commit, etc. Very handy.

Fugitive

Cool beans, sounds like a good tool! I'm on team Helix since a few years, after being a vim/nvim user for about a decade, and emacs a couple years before that. Helix's paradigm just makes so much sense. ๐ŸŽฏ๐Ÿ‘Œ Jumping around symbols intra-file and inter-file, and LSP support built-in, no fussing. Worth a try for a few weeks if you ask me.

[โ€“] hallettj@leminal.space 2 points 13 hours ago (1 children)

Oh yeah, I do find Helix interesting! I sometimes recommend it to people who don't have a background with modal editing as a batteries-included option for getting started. I have tried it a little bit myself. It's hard for me to give up leap.nvim and fugitive, which is holding me back.

I've been meaning to try out dedicated git programs to see how comfortable I can be without fugitive. Tig is one that caught my eye. Or sometimes I even think about using Gitbutler because its virtual branch feature seems very useful, and I haven't seen any other tool that does that.

[โ€“] victorz@lemmy.world 2 points 13 hours ago* (last edited 13 hours ago)

I think the best way is just take the leap, and try it out for real. ๐Ÿ˜‰

I used Tig before lazygit actually. It's great for getting an overview of history. But lazygit I think is more focused on the current state, and workflow-oriented. It is very easy to drop commits, rebase, edit commits, etc.

I'm not sure what virtual branches are or why I would need them but sounds interesting. ๐Ÿ˜