In vim plugin 'tpope/vim-speeddating', it support wide variaty of date formats. e.g.
%Y-%m-%d%[ T_-]%H:%M 2019-08-04 07:42 %Y-%m-%d 2019-08-04
But how to add my custom data formats, e.g.
%Y/%m/%d 2019/08/04 %Y/%m 2019/08
Vi and Vim Stack Exchange is a question and answer site for people using the vi and Vim families of text editors. It only takes a minute to sign up.Sign up to join this community
According to the documentation: (
One can use the
:SpeedDatingFormatcommand to list, add, and remove formats. A good place to place custom formats is in
For the formats you listed:
SpeedDatingFormat %Y/%m/%d SpeedDatingFormat %Y/%m
Write these lines in your ~/.vimrc
au BufEnter * :SpeedDatingFormat %Y/%m/%d au BufEnter * :SpeedDatingFormat %Y/%m