Git commit -a opening different text editor than vim

System:
  Kernel: 5.18.1-zen1-1-zen arch: x86_64 bits: 64 compiler: gcc v: 12.1.0
    parameters: BOOT_IMAGE=/@/boot/vmlinuz-linux-zen
    root=UUID=ca4f91bf-1b42-42ec-b48e-c0e4dd5c78ea rw rootflags=subvol=@
    quiet quiet splash rd.udev.log_priority=3 vt.global_cursor_default=0
    resume=UUID=dab40188-c02c-4aa2-a044-c7b1392bfaf3 loglevel=3 ibt=off
  Desktop: KDE Plasma v: 5.24.5 tk: Qt v: 5.15.4 info: latte-dock
    wm: kwin_x11 vt: 1 dm: SDDM Distro: Garuda Linux base: Arch Linux
Machine:
  Type: Desktop System: ASUS product: N/A v: N/A serial: <superuser required>
  Mobo: ASUSTeK model: PRIME B660-PLUS D4 v: Rev 1.xx
    serial: <superuser required> UEFI: American Megatrends v: 0418
    date: 10/13/2021
CPU:
  Info: model: 12th Gen Intel Core i7-12700K bits: 64 type: MST AMCP
    arch: Alder Lake family: 6 model-id: 0x97 (151) stepping: 2 microcode: 0x1F
  Topology: cpus: 1x cores: 12 mt: 8 tpc: 2 st: 4 threads: 20 smt: enabled
    cache: L1: 1024 KiB desc: d-4x32 KiB, 8x48 KiB; i-8x32 KiB, 4x64 KiB
    L2: 12 MiB desc: 8x1.2 MiB, 1x2 MiB L3: 25 MiB desc: 1x25 MiB
  Speed (MHz): avg: 1403 high: 1501 min/max: 800/6300:6400:3800 scaling:
    driver: intel_pstate governor: powersave cores: 1: 1500 2: 1484 3: 1359
    4: 1342 5: 1398 6: 1319 7: 1348 8: 1305 9: 1335 10: 1400 11: 1381
    12: 1402 13: 1393 14: 1458 15: 1402 16: 1501 17: 1458 18: 1426 19: 1448
    20: 1401 bogomips: 144383
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx
  Vulnerabilities:
  Type: itlb_multihit status: Not affected
  Type: l1tf status: Not affected
  Type: mds status: Not affected
  Type: meltdown status: Not affected
  Type: spec_store_bypass
    mitigation: Speculative Store Bypass disabled via prctl
  Type: spectre_v1
    mitigation: usercopy/swapgs barriers and __user pointer sanitization
  Type: spectre_v2
    mitigation: Enhanced IBRS, IBPB: conditional, RSB filling
  Type: srbds status: Not affected
  Type: tsx_async_abort status: Not affected
Graphics:
  Device-1: NVIDIA GP106 [GeForce GTX 1060 6GB]
    vendor: ASUSTeK DUAL-GTX1060-O6G driver: nvidia v: 515.43.04
    alternate: nouveau,nvidia_drm non-free: 515.xx+
    status: current (as of 2022-05) arch: Pascal pcie: gen: 3 speed: 8 GT/s
    lanes: 16 bus-ID: 01:00.0 chip-ID: 10de:1c03 class-ID: 0300
  Display: x11 server: X.Org v: 21.1.3 with: Xwayland v: 22.1.2
    compositor: kwin_x11 driver: X: loaded: nvidia unloaded: modesetting
    alternate: fbdev,nouveau,nv,vesa gpu: nvidia display-ID: :0 screens: 1
  Screen-1: 0 s-res: 2560x1440 s-dpi: 108 s-size: 602x342mm (23.70x13.46")
    s-diag: 692mm (27.26")
  Monitor-1: DP-0 res: 2560x1440 hz: 144 dpi: 109
    size: 597x336mm (23.5x13.23") diag: 685mm (26.97") modes: N/A
  OpenGL: renderer: NVIDIA GeForce GTX 1060 6GB/PCIe/SSE2
    v: 4.6.0 NVIDIA 515.43.04 direct render: Yes
Audio:
  Device-1: Intel Alder Lake-S HD Audio vendor: ASUSTeK driver: snd_hda_intel
    v: kernel alternate: snd_sof_pci_intel_tgl bus-ID: 00:1f.3
    chip-ID: 8086:7ad0 class-ID: 0403
  Device-2: NVIDIA GP106 High Definition Audio
    vendor: ASUSTeK DUAL-GTX1060-O6G driver: snd_hda_intel v: kernel pcie:
    gen: 3 speed: 8 GT/s lanes: 16 bus-ID: 01:00.1 chip-ID: 10de:10f1
    class-ID: 0403
  Device-3: SteelSeries ApS Arctis Pro Wireless type: USB
    driver: hid-generic,snd-usb-audio,usbhid bus-ID: 1-9.1.3:12
    chip-ID: 1038:1294 class-ID: 0300
  Sound Server-1: ALSA v: k5.18.1-zen1-1-zen running: yes
  Sound Server-2: PulseAudio v: 15.0 running: no
  Sound Server-3: PipeWire v: 0.3.51 running: yes
Network:
  Device-1: Realtek RTL8125 2.5GbE vendor: ASUSTeK driver: r8169 v: kernel
    pcie: gen: 2 speed: 5 GT/s lanes: 1 port: 3000 bus-ID: 05:00.0
    chip-ID: 10ec:8125 class-ID: 0200
  IF: enp5s0 state: up speed: 1000 Mbps duplex: full mac: <filter>
RAID:
  Hardware-1: Intel Volume Management Device NVMe RAID Controller driver: vmd
    v: 0.6 port: N/A bus-ID: 00:0e.0 chip-ID: 8086:467f rev: class-ID: 0104
Drives:
  Local Storage: total: 2.27 TiB used: 431.06 GiB (18.6%)
  SMART Message: Unable to run smartctl. Root privileges required.
  ID-1: /dev/nvme0n1 maj-min: 259:0 vendor: Samsung
    model: SSD 970 EVO 250GB size: 232.89 GiB block-size: physical: 512 B
    logical: 512 B speed: 31.6 Gb/s lanes: 4 type: SSD serial: <filter>
    rev: 2B2QEXE7 temp: 40.9 C scheme: GPT
  ID-2: /dev/sda maj-min: 8:0 vendor: Seagate model: ST2000DM006-2DM164
    size: 1.82 TiB block-size: physical: 4096 B logical: 512 B speed: 6.0 Gb/s
    type: HDD rpm: 7200 serial: <filter> rev: CC26 scheme: MBR
  ID-3: /dev/sdb maj-min: 8:16 model: SATA SSD size: 223.57 GiB block-size:
    physical: 512 B logical: 512 B speed: 6.0 Gb/s type: SSD serial: <filter>
    rev: BB.3 scheme: GPT
Partition:
  ID-1: / raw-size: 198.39 GiB size: 198.39 GiB (100.00%)
    used: 47.49 GiB (23.9%) fs: btrfs dev: /dev/nvme0n1p2 maj-min: 259:2
  ID-2: /boot/efi raw-size: 300 MiB size: 299.4 MiB (99.80%)
    used: 576 KiB (0.2%) fs: vfat dev: /dev/nvme0n1p1 maj-min: 259:1
  ID-3: /home raw-size: 198.39 GiB size: 198.39 GiB (100.00%)
    used: 47.49 GiB (23.9%) fs: btrfs dev: /dev/nvme0n1p2 maj-min: 259:2
  ID-4: /var/log raw-size: 198.39 GiB size: 198.39 GiB (100.00%)
    used: 47.49 GiB (23.9%) fs: btrfs dev: /dev/nvme0n1p2 maj-min: 259:2
  ID-5: /var/tmp raw-size: 198.39 GiB size: 198.39 GiB (100.00%)
    used: 47.49 GiB (23.9%) fs: btrfs dev: /dev/nvme0n1p2 maj-min: 259:2
Swap:
  Kernel: swappiness: 133 (default 60) cache-pressure: 100 (default)
  ID-1: swap-1 type: zram size: 31.09 GiB used: 0 KiB (0.0%) priority: 100
    dev: /dev/zram0
  ID-2: swap-2 type: partition size: 34.2 GiB used: 0 KiB (0.0%)
    priority: -2 dev: /dev/nvme0n1p3 maj-min: 259:3
Sensors:
  System Temperatures: cpu: 27.8 C mobo: N/A gpu: nvidia temp: 54 C
  Fan Speeds (RPM): N/A gpu: nvidia fan: 21%
Info:
  Processes: 451 Uptime: 20h 8m wakeups: 7 Memory: 31.09 GiB
  used: 10.49 GiB (33.7%) Init: systemd v: 251 tool: systemctl Compilers:
  gcc: 12.1.0 clang: 13.0.1 Packages: pacman: 1269 lib: 318 Shell: Bash
  v: 5.1.16 running-in: konsole inxi: 3.3.16
e[1;34mGaruda (2.6.3-2):e[0m
e[1;34m  System install date:e[0m     2022-05-30
e[1;34m  Last full system update:e[0m 2022-05-31 e[1;31m↻
e[1;34m  Is partially upgraded:  e[0m No
e[1;34m  Relevant software:      e[0m NetworkManager
e[1;34m  Windows dual boot:      e[0m No/Undetected
e[1;34m  Snapshots:              e[0m Snapper
e[1;34m  Failed units:           e[0m systemd-coredump@1-98569-0.service 

I'm used to vim at this point and would rather have vim be opening up when writing a commit. Bash opens vim on commit -a and that's my current workaround to get into a commit with vim. I was wondering how I could fix this where I can get into a commit with vim instead of the current text editor.

What and how you always
commit -a
I would look in its settings.

1 Like

Workaround to what? Fish?

1 Like

Git has a configuration variable to set which editor you want to use.

If you want to set the editor only for Git, do either (you don’t need both):

  • Set core.editor in your Git config: git config --global core.editor "vim"

OR

  • Set the GIT_EDITOR environment variable: export GIT_EDITOR=vim
4 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.