Ⅰ. 插件描述
A calendar application for VimⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'itchyny/calendar-vim-state-of-grace'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'itchyny/calendar-vim-state-of-grace'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'itchyny/calendar-vim-state-of-grace'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/itchyny/calendar.vim
Ⅳ. 文档说明
# A calendar application for Vim
Vim meets a next generation application
Press E key to view the event list, and T key to view the task list.
Also, press ? key to view a quick help.
Basic Usage
:Calendar
:Calendar 2000 1 1
:Calendar -view=year
:Calendar -view=year -split=vertical -width=27
:Calendar -view=year -split=horizontal -position=below -height=12
:Calendar -first_day=monday
:Calendar -view=clock
You can switch between views with < and > keys.
If you have a trouble like the above screenshot, add the following configuration to your vimrc.
let g:calendar_frame = 'default'
Concept
This is a calendar which is ...
Comfortable
The key mappings are designed to match the default mappings of Vim.
Powerful
The application can be connected to Google Calendar and used in your life.
Elegant
The appearance is carefully designed, dropping any unnecessary information.
Interesting
You can choose the calendar in Julian calendar or in Gregorian calendar.
Useful
To conclude, very useful.
Author
itchyny (https://github.com/itchyny)
License
This software is released under the MIT License, see LICENSE.
Installation
Install with your favorite plugin manager.
Google Calendar and Google Task
In order to view and edit calendars on Google Calendar, or task on Google Task,
add the following configurations to your vimrc file.
let g:calendar_google_calendar = 1
let g:calendar_google_task = 1
It requires wget
or curl
.
Important notice
Currently the client key of this application is disabled and you will get the Sign in with Google temporarily disabled for this app error.
You can create your own Google API key and use for authentication with the following steps.
- Create a new project in GCP and go to Google APIs.
- Click
ENABLE APIS AND SERVICES
addGoogle Calendar API
andTasks API
. Go to Google APIs and click
OAuth consent screen
from the sidebar.- Choose
External
(Available to any user with a Google Account.) and clickCREATE
. - Input your favorite name to
Application name
. In theScopes for Google APIs
section, clickAdd scope
and addGoogle Calendar API ../auth/calendar
andTask API ../auth/tasks
. - Click
Save
(DO NOTSubmit for verification
).
- Choose
Go to the
Credentials
page from the sidebar.Create a new API key and restrict key to the two APIs (
Google Calendar API
,Tasks API
).- You have the api key.
Create a new
OAuth client ID
. SelectOther
for the application type.- You have the client id and client secret.
Open your terminal and save the credentials.
mkdir -p ~/.cache/calendar.vim/ && touch ~/.cache/calendar.vim/credentials.vim
chmod 700 ~/.cache/calendar.vim && chmod 600 ~/.cache/calendar.vim/credentials.vim
vi ~/.cache/calendar.vim/credentials.vim
- Add the following three lines and save it. Please be sure to keep this file securely.
let g:calendar_google_api_key = '...'
let g:calendar_google_client_id = '....apps.googleusercontent.com'
let g:calendar_google_client_secret = '...'
- Add
source ~/.cache/calendar.vim/credentials.vim
to your .vimrc.
- Restart Vim and open calendar.vim. You will get the unverified message but click
Advanced
andGo to your-app (unsafe)
. - Approve against some confirms (maybe three clicks) and you will get the login code. Copy and paste it into the prompt of calendar.vim. Now you'll be authenticated to your application..
Terms of Use
Under no circumstances we are liable for any damages (including but not limited to damages for loss of business, loss of profits, interruption or the like) arising from use of this software.
This software deals with your events and tasks.
We are not liable for any circumstances; leakage of trade secrets due to the cache files of this software, loss of important events and tasks due to any kind of bugs and absence from important meetings due to any kind of failures of this software.
This software downloads your events from Google Calendar, and your tasks from Google Task.
DO NOT use this software with important events and tasks.
This software downloads your events or tasks to the cache directory.
Please be careful with the cache directory; DO NOT share the directory with any cloud storage softwares.
This software also uploads your events and tasks to Google APIs.
While it uses https, but DO NOT use this software for confidential matters.
This software NEVER uploads your events and tasks to any other server except Google's.
However, if wget
or curl
command are replaced with malicious softwares, your events or tasks can be uploaded to other sites.
Please use the official softwares for the commands.