Skip to content

Statusline airplane timer for Vim: one flight per session, gentle landing reminders, vim-airline ready.

License

Notifications You must be signed in to change notification settings

LxYuan0420/soloflight.vim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SoloFlight.vim

SoloFlight is a Pomodoro-style timer for classic Vim (8.2+) that keeps one flight “in the air” per Vim process. Instead of a numeric countdown, a plane glides across your statusline over the duration (60 minutes by default). When time is up, you get a quiet landing message: “We have landed — time to take a break.”

Features

  • Process-scoped flight timer with optional machine-wide lockfile to keep only one Vim focused session at a time.
  • Statusline-friendly visualization via Soloflight_statusline()—30-track segments by default so hour-long flights tick every ~2 minutes.
  • Works out of the box with both plain Vim statuslines and vim-airline (disable the auto wiring with g:flight_auto_attach_statusline = 0).
  • Optional vim-airline integration that appends the plane to section X when airline is present (disable with g:flight_airline_integration = 0).
  • Auto-starting focus blocks on VimEnter (disable with g:flight_auto_start_on_vimenter = 0) plus pause/resume/restart commands.
  • Landing popup (with scratch-buffer fallback) to nudge you toward a break.
  • Quit guard that reminds you when you try to exit during an active flight.

Installation

Using vim-plug:

Plug 'LxYuan0420/soloflight.vim'

After installing, generate help tags once so :h soloflight works:

:helptags ~/.vim/plugged/soloflight.vim/doc

Usage

SoloFlight attaches to the statusline automatically. Core commands:

:FlightStart        " start a focus block (default 60 min)
:FlightStart 25     " start a 25 minute sprint
:FlightRestart 45   " restart immediately with a new duration
:FlightPause
:FlightResume
:FlightStop
:FlightStatus       " show numeric time remaining on demand
:FlightLandNow      " trigger the landing popup immediately

Optional tweak for classic statuslines if you want the plane in a custom slot:

set statusline=%<%f\ %h%m%r%=%-14.(%l,%c%V%)\ %P\ %{Soloflight_statusline()}

All commands ship with :Solo* aliases (e.g. :SoloStart, :SoloPause) if you prefer the shorter prefix.

vim-airline users get a soloflight part appended to section X automatically. Disable that wiring with let g:flight_airline_integration = 0.

Configuration Highlights

Set options in your vimrc before loading the plugin. Key knobs:

" Change the default duration
let g:flight_default_minutes = 50

" Allow restarting with :FlightStart while a flight is active
let g:flight_allow_restart = 1

" Append SoloFlight automatically to the statusline
" Disable automatic statusline attachment (default is 1)
let g:flight_auto_attach_statusline = 0

" Disable the default auto-start behavior
let g:flight_auto_start_on_vimenter = 0

" Soften or speed up updates (upper bound in ms; SoloFlight reduces it for
" shorter flights automatically)
let g:flight_timer_interval = 10000

" Skip automatic vim-airline wiring
let g:flight_airline_integration = 0

" Disable the quit guard if you prefer exiting without prompts
let g:flight_block_quit = 0

See :h soloflight-config for the full list, including track styling, lockfile overrides, popup options, and update intervals.

Requirements

  • Vim 8.2 or newer (popup support recommended, timers optional but preferred)
  • Classic Vim only—Neovim is not supported in this release.

License

SoloFlight.vim is released under the MIT License.

Screenshots

Takeoff: focus block underway

SoloFlight takeoff screenshot

Landing: break reminder

SoloFlight landing screenshot

About

Statusline airplane timer for Vim: one flight per session, gentle landing reminders, vim-airline ready.

Resources

License

Stars

Watchers

Forks

Packages

No packages published