Migration from v1 to v2

Alisue edited this page Jan 14, 2016 · 4 revisions
Clone this wiki locally

Usage difference

Authentication

Use :Gista login [--username={USERNAME}] or :Gista logout instead of :Gista --login or :Gista --logout.

Note that a new vim-gista support a temporal authorization so once you configure g:gista#client#default_username, you won't need to manually login unless you would like to switch the account or API.

See :Gista login -h or :Gista logout -h for more detail.

Listing

Use :Gista list [{LOOKUP}] instead of :Gista --list to list gists.

See :Gista list -h for more detail.

Additionally, the default mappings provided in gista-list are drastically changed as well. Hit ? in gista-list window to check new mappings.

Opening

Use :Gista open [{GISTID}] [{FILENAME}] or :edit gista-file:{APINAME}:{GISTID}:{FILENAME} instead of :Gista --open to open a gist file.

Any buffer with buffer name like gista-file:{APINAME}:{GISTID}:{FILENAME} will automatically be connected to a remote gist.

Executing :write command in a connected buffer will patch the content to the remote gist. A bang (!) is required for :write command when the remote content seems be modified. To disconnect from a remote gist (:Gista --disconnect in v1), give a new local filename by :file {NEW_FILENAME}.

Posting

Use :Gista post instead of :Gista or :Gista --post.

See :Gista post -h for more detail.

Editing

Use:

  • :Gista rename instead of :Gista --rename
  • :Gista remove instead of :Gista --remove
  • :Gista delete instead of :Gista --delete
  • :Gista fork instead of :Gista --fork
  • :Gista star instead of :Gista --star
  • :Gista unstar instead of :Gista --unstar

Note that no alternative command for :Gista --is-starred is provided.

Browsing

Use :Gista browse instead of :Gista --browse. v2 does not require tyru/open-browser.vim for browsing.

See :Gista browse -h for more detail.

Anonymous mode

Use :Gista --anonymous {COMMAND} to temporary logout from API within the command execution.

Option difference

Options not listed the table is removed and not configurable.

v1 option name v2 alternative option name Remarks
g:github_user g:gista#client#default_username v2 does not check git profile
g:gista#github_user g:gista#client#default_username v2 does not check git profile
g:gista#gist_api_url gista#client#register({APINAME}, {URL}) v2 has a different architecture. See :help vim-gista-authorization
g:gista#directory g:gista#client#cache_dir v2 store all information into ~/.cache/vim-gista
g:gista#token_directory g:gista#client#cache_dir v2 store all information into ~/.cache/vim-gista
g:gista#gist_entries_cache_directory g:gista#client#cache_dir v2 store all information into ~/.cache/vim-gista
g:gista#list_opener g:gista#command#list#default_opener
g:gista#gist_openers g:gista#command#open#default_opener not exactly same
g:gista#gist_openers_in_action g:gista#command#list#entry_openers the dictionary structure has changed
g:gista#update_on_write - the role of "!" has changed
g:gista#enable_default_keymaps g:gista#command#list#enable_default_mappings
g:gista#post_private g:gista#command#post#default_public
g:gista#interactive_description g:gista#command#post#interactive_description
g:gista#interactive_visibility - Use --private option for :Gista post
g:gista#include_invisible_buffer_in_multaiple - Multiple posting has removed. Use :Gista patch individually
g:gista#unite_smart_open_threshold - Use vim-gista-unite

Unite / CtrlP

Use vim-gista-unite to enable unite feature.

Use vim-gista-ctrlp to enable CtrlP feature which had not been supported in v1.