Vim python syntax hilighting

I have a question mostly about Aesthetics. I installed the qtile version so I'm not sure if this is true on other versions.

When I start vim to edit a python file, I get this nice highlighting effect that doesn't happen when I create a .vimrc file. I am trying to figure out where that hightlighting is coming from but have been unable to find it any of the default vimrc files.

I have looked at /etc/vimrc and /usr/share/vim/vimfiles/archlinux.vim, but I haven't found that Python highlighting config anywhere.

:version
system file: "/etc/vimrc"
user file: "$HOME/.vimrc" --does not currently exist
2nd user file: "~/.vim/vimrc"
..
defaults file: "$VIMRUNTIME/defaults.vim
system menu file: "$VIMRUNTIME/menu.vim"
fall-back for $VIM: "/usr/share/vim"
'''
'''
System:    Kernel: 5.14.9-zen2-1-zen x86_64 bits: 64 compiler: gcc v: 11.1.0 
           parameters: BOOT_IMAGE=/@/boot/vmlinuz-linux-zen root=UUID=7bda3b14-f8fd-4850-bc94-366cbe221f09 rw 
           rootflags=subvol=@ quiet splash rd.udev.log_priority=3 vt.global_cursor_default=0 
           systemd.unified_cgroup_hierarchy=1 loglevel=3 
           Desktop: Qtile 0.18.1 wm: LG3D vt: 1 dm: SDDM Distro: Garuda Linux base: Arch Linux 
Machine:   Type: Laptop System: LENOVO product: 20N20028US v: ThinkPad T490 serial: <filter> Chassis: type: 10 
           serial: <filter> 
           Mobo: LENOVO model: 20N20028US v: SDK0J40697 WIN serial: <filter> UEFI: LENOVO v: N2IET90W (1.68 ) date: 07/06/2020 
Battery:   ID-1: BAT0 charge: 48.9 Wh (100.0%) condition: 48.9/50.5 Wh (97.0%) volts: 12.8 min: 11.5 model: SMP 02DL008 
           type: Li-poly serial: <filter> status: Full cycles: 5 
           Device-1: hidpp_battery_0 model: Logitech Wireless Keyboard serial: <filter> charge: 55% (should be ignored) 
           rechargeable: yes status: Discharging 
CPU:       Info: Quad Core model: Intel Core i7-8565U bits: 64 type: MT MCP arch: Kaby Lake note: check family: 6 
           model-id: 8E (142) stepping: C (12) microcode: EA cache: L2: 8 MiB 
           flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 31999 
           Speed: 4316 MHz min/max: 400/4600 MHz Core speeds (MHz): 1: 4316 2: 4244 3: 4429 4: 4158 5: 4202 6: 4271 7: 4462 
           8: 4251 
           Vulnerabilities: Type: itlb_multihit status: KVM: VMX disabled 
           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 and seccomp 
           Type: spectre_v1 mitigation: usercopy/swapgs barriers and __user pointer sanitization 
           Type: spectre_v2 mitigation: Enhanced IBRS, IBPB: conditional, RSB filling 
           Type: srbds mitigation: TSX disabled 
           Type: tsx_async_abort status: Not affected 
Graphics:  Device-1: Intel WhiskeyLake-U GT2 [UHD Graphics 620] vendor: Lenovo driver: i915 v: kernel bus-ID: 00:02.0 
           chip-ID: 8086:3ea0 class-ID: 0300 
           Device-2: Lite-On Integrated Camera type: USB driver: uvcvideo bus-ID: 1-8:3 chip-ID: 04ca:7070 class-ID: 0e02 
           Display: x11 server: X.Org 1.20.13 compositor: picom v: git-60eb0 driver: loaded: intel unloaded: modesetting 
           alternate: fbdev,vesa display-ID: :0 screens: 1 
           Screen-1: 0 s-res: 3840x2160 s-dpi: 96 s-size: 1013x570mm (39.9x22.4") s-diag: 1162mm (45.8") 
           Monitor-1: eDP1 res: 1920x1080 hz: 60 dpi: 157 size: 310x170mm (12.2x6.7") diag: 354mm (13.9") 
           Monitor-2: DP2-2 res: 1920x1080 hz: 60 dpi: 79 size: 620x340mm (24.4x13.4") diag: 707mm (27.8") 
           Monitor-3: DP2-3-8 res: 1920x1080 hz: 60 dpi: 79 size: 620x340mm (24.4x13.4") diag: 707mm (27.8") 
           OpenGL: renderer: Mesa Intel UHD Graphics 620 (WHL GT2) v: 4.6 Mesa 21.2.3 direct render: Yes 
Audio:     Device-1: Intel Cannon Point-LP High Definition Audio vendor: Lenovo driver: snd_hda_intel v: kernel 
           alternate: snd_soc_skl,snd_sof_pci_intel_cnl bus-ID: 00:1f.3 chip-ID: 8086:9dc8 class-ID: 0403 
           Device-2: GN Netcom Jabra PRO 9470 type: USB driver: jabra,snd-usb-audio,usbhid bus-ID: 1-2.2:5 chip-ID: 0b0e:1042 
           class-ID: 0300 serial: <filter> 
           Device-3: Lenovo ThinkPad USB-C Dock Gen2 USB Audio type: USB driver: hid-generic,snd-usb-audio,usbhid 
           bus-ID: 1-2.3.3.2:10 chip-ID: 17ef:a396 class-ID: 0300 serial: <filter> 
           Sound Server-1: ALSA v: k5.14.9-zen2-1-zen running: yes 
           Sound Server-2: JACK v: 1.9.19 running: no 
           Sound Server-3: PulseAudio v: 15.0 running: no 
           Sound Server-4: PipeWire v: 0.3.38 running: yes 
Network:   Device-1: Intel Cannon Point-LP CNVi [Wireless-AC] driver: iwlwifi v: kernel port: 3000 bus-ID: 00:14.3 
           chip-ID: 8086:9df0 class-ID: 0280 
           IF: wlp0s20f3 state: down mac: <filter> 
           Device-2: Intel Ethernet I219-V vendor: Lenovo driver: e1000e v: kernel port: efa0 bus-ID: 00:1f.6 
           chip-ID: 8086:15be class-ID: 0200 
           IF: enp0s31f6 state: up speed: 1000 Mbps duplex: full mac: <filter> 
           Device-3: Lenovo USB-C Dock Ethernet type: USB driver: r8152 bus-ID: 2-2.1:4 chip-ID: 17ef:a387 class-ID: 0000 
           serial: <filter> 
           IF: enp0s20f0u2u1 state: down mac: <filter> 
Drives:    Local Storage: total: 357.98 GiB used: 12.09 GiB (3.4%) 
           SMART Message: Required tool smartctl not installed. Check --recommends 
           ID-1: /dev/nvme0n1 maj-min: 259:0 vendor: Samsung model: MZVLB256HBHQ-000L7 size: 238.47 GiB block-size: 
           physical: 512 B logical: 512 B speed: 31.6 Gb/s lanes: 4 type: SSD serial: <filter> rev: 4M2QEXH7 temp: 22.9 C 
           scheme: GPT 
           ID-2: /dev/sda maj-min: 8:0 type: USB vendor: Samsung model: Flash Drive FIT size: 119.51 GiB block-size: 
           physical: 512 B logical: 512 B type: SSD serial: <filter> rev: 1100 scheme: GPT 
Partition: ID-1: / raw-size: 119.25 GiB size: 119.25 GiB (100.00%) used: 12.09 GiB (10.1%) fs: btrfs dev: /dev/sda2 
           maj-min: 8:2 
           ID-2: /boot/efi raw-size: 260 MiB size: 256 MiB (98.45%) used: 562 KiB (0.2%) fs: vfat dev: /dev/sda1 maj-min: 8:1 
           ID-3: /home raw-size: 119.25 GiB size: 119.25 GiB (100.00%) used: 12.09 GiB (10.1%) fs: btrfs dev: /dev/sda2 
           maj-min: 8:2 
           ID-4: /var/log raw-size: 119.25 GiB size: 119.25 GiB (100.00%) used: 12.09 GiB (10.1%) fs: btrfs dev: /dev/sda2 
           maj-min: 8:2 
           ID-5: /var/tmp raw-size: 119.25 GiB size: 119.25 GiB (100.00%) used: 12.09 GiB (10.1%) fs: btrfs dev: /dev/sda2 
           maj-min: 8:2 
Swap:      Kernel: swappiness: 133 (default 60) cache-pressure: 100 (default) 
           ID-1: swap-1 type: zram size: 7.43 GiB used: 5.2 MiB (0.1%) priority: 100 dev: /dev/zram0 
Sensors:   System Temperatures: cpu: 53.0 C mobo: N/A 
           Fan Speeds (RPM): fan-1: 3525 
Info:      Processes: 263 Uptime: 4h 16m wakeups: 31 Memory: 7.43 GiB used: 5.48 GiB (73.7%) Init: systemd v: 249 
           tool: systemctl Compilers: gcc: 11.1.0 clang: 12.0.1 Packages: pacman: 1149 lib: 299 Shell: Zsh v: 5.8 
           running-in: alacritty inxi: 3.3.06 

Hi there, welcome to the community.
Are you sure it is vim and not micro? How are you editing python files?

1 Like

Thank you very much, glad to be here.

 vim .config/qtile/config.py
or
sudo vim .config/qtile/config.py

which vim
--/usr/bin/vim

it is definitely vim that is being used. all the correct keybindings and commands are active.

Use ``` not ''' or better ~~~ for terminal text, please.

1 Like

https://wiki.archlinux.org/title/Vim#Configuration

I can highly recommend reading the various Arch wiki pages. They are heavily technical but an excellent resource.

3 Likes

That's about the nicest way anyone has said "RTFM," i think. Thanks Jonathon. I suppose I thought it might be a specific Garuda thing, instead of vim.

1 Like

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