|
| 1 | +# speeddating.vim |
| 2 | + |
| 3 | +Take the following date: |
| 4 | + |
| 5 | + 1999-12-31 |
| 6 | + |
| 7 | +Because Vim treats the hyphen as a negative sign, pressing `<C-A>` on the 31 |
| 8 | +would normally increment it to |
| 9 | + |
| 10 | + 1999-12-30 |
| 11 | + |
| 12 | +Compare this with what happens when speeddating.vim is installed: |
| 13 | + |
| 14 | + 2000-01-01 |
| 15 | + |
| 16 | +Pressing `5<C-X>` on the `03` in the first line below transforms it into the |
| 17 | +second: |
| 18 | + |
| 19 | + Sat, 01 Jan 2000 00:00:03 +0000 |
| 20 | + Fri, 31 Dec 1999 23:59:58 +0000 |
| 21 | + |
| 22 | +Several date, time, and datetime formats are included. Additional formats can |
| 23 | +be defined in a strftime-like syntax with the `:SpeedDatingFormat` command. |
| 24 | + |
| 25 | +Existing Vim semantics are preserved. `<C-A>` and `<C-X>` accept a count, and |
| 26 | +plain number incrementing is used if no date format is matched. |
| 27 | + |
| 28 | +Use of `<C-A>`/`<C-X>` in visual mode enables incrementing several lines at |
| 29 | +once. Blank spots are filled by incrementing the match from the previous |
| 30 | +line, allowing for creation of sequences (1, 2, 3; 2000-10-30, 2000-10-31, |
| 31 | +2000-11-01). |
| 32 | + |
| 33 | +It can also increment roman numerals and ordinals (1st, 2nd, 3rd, ...). In |
| 34 | +visual mode, letters of the alphabet are supported. |
| 35 | + |
| 36 | +`d<C-A>` sets the timestamp under the cursor to the current time. `d<C-X>` |
| 37 | +does the same, but uses UTC rather than the local time. |
| 38 | + |
| 39 | +The `.` command will work as expected if you install |
| 40 | +[repeat.vim](https://github.com/tpope/vim-repeat). |
| 41 | + |
| 42 | +## Installation |
| 43 | + |
| 44 | +If you don't have a preferred installation method, I recommend |
| 45 | +installing [pathogen.vim](https://github.com/tpope/vim-pathogen), and |
| 46 | +then simply copy and paste: |
| 47 | + |
| 48 | + cd ~/.vim/bundle |
| 49 | + git clone git://github.com/tpope/vim-speeddating.git |
| 50 | + |
| 51 | +Once help tags have been generated, you can view the manual with |
| 52 | +`:help speeddating`. |
| 53 | + |
| 54 | +## Contributing |
| 55 | + |
| 56 | +See the contribution guidelines for |
| 57 | +[pathogen.vim](https://github.com/tpope/vim-pathogen#readme). |
| 58 | + |
| 59 | +## Self-Promotion |
| 60 | + |
| 61 | +Like speeddating.vim? Follow the repository on |
| 62 | +[GitHub](https://github.com/tpope/vim-speeddating) and vote for it on |
| 63 | +[vim.org](http://www.vim.org/scripts/script.php?script_id=2120). And if |
| 64 | +you're feeling especially charitable, follow [tpope](http://tpo.pe/) on |
| 65 | +[Twitter](http://twitter.com/tpope) and |
| 66 | +[GitHub](https://github.com/tpope). |
| 67 | + |
| 68 | +## License |
| 69 | + |
| 70 | +Copyright © Tim Pope. Distributed under the same terms as Vim itself. |
| 71 | +See `:help license`. |
0 commit comments