Skip to main content

Vim Tips is a project to aggregate and show vim tips from different sources.

Project description

Vim Tips

Introduction

Vim Tips is a project to aggregate and show vim tips from different sources. A small daemon waits for screen unlocks and automatically starts the vim tips gui if it is the first unlock of the day.

Installation

Vim Tips can be installed with pip on Linux and macos:

python3 -m pip install vimtips

Vim tips contains components that must be compiled on installation, so ensure you have XCode installed on macos or build tools on any Linux distribution. For Linux, you also need X11 headers. On Ubuntu / Debian-based distributions you can install these dependencies with:

apt install build-essential libx11-dev nx-x11proto-xext-dev

If you run an Arch-bases system, you can also install vimtips from the AUR:

yay -S vimtips

Usage

After installation, you get the new commands vimtips-gui and vimtips-daemon to start the graphical application or the daemon process. On the first gui start, the cache of vim tips is refreshed so the first startup can take several seconds. Future runs renew the cache in the background. You can add vimtips-daemon to your startup / login items to automatically get new tips on computer startup or when you unlock the screen for the first time of the day.

Login item creation on macos

It is indeed possible to add terminal commands to the user's login items but this will cause the startup of a terminal window every time you login to your Mac. A better solution is to start the preinstalled Automator application, create a new app and add a bash script which starts vimtips-daemon. The created app can then be added to hidden login items.

Tip sources

Currently, only twitter is supported as a tip source (the vimtips, VImTipsDaily, vimpal and VimTip accounts are read) but new sources can be added by creating a new Python module in vimtips/sources. Look at vimtips/sources/twitter.py for an example. You only need to implement a global function tips which returns a list of strings.

Screen unlock detection

This package has different backends to detect a screen unlock and automatically chooses an appropriate one:

  • Linux:
    • xscreensaver: If xscreensaver is running, it will be asked for unlock events.
    • gnome-screensaver and xfce4-screensaver: Can also be asked for unlock events.
    • X11 dpms: As a fallback, dpms events are watched which should work on every Linux desktop. However, this backend does not really check for a screen unlock, it checks the screen power state instead (however, in most configurations the screen is sent to sleep when the screen is locked, so this should be fine on most systems). This backend could fail if screensavers are used.
  • macos:
    • On macos, the screen power state is watched similar to the Linux X11 backend. If anyone knows how to check for a screen lock, please send a pull request! :)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vimtips-0.2.7.tar.gz (15.9 kB view details)

Uploaded Source

File details

Details for the file vimtips-0.2.7.tar.gz.

File metadata

  • Download URL: vimtips-0.2.7.tar.gz
  • Upload date:
  • Size: 15.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.9.6

File hashes

Hashes for vimtips-0.2.7.tar.gz
Algorithm Hash digest
SHA256 25013ce03d22d5cc685cef7c96ad30e3d36fc797da9d4a6353d499dce343a8d9
MD5 4b3edc8dc9f0a3d0c561618a5ad2900a
BLAKE2b-256 fea822b5cad58cf5589f310d7d7e97eb1a54c17bceb90a314c4ad0062cda8508

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page