mastodon.nvim is Mastodon Client for Neovim.
- Loading bookmarks
- Adding bookmark
- Reloading statuses
- Replying to status
- Switching account
- Neovim >= 0.8
- Neovim plugin
- nvim-lua/plenary.nvim
- rcarriga/nvim-notify
- kkharji/sqlite.lua
If you are using packer.nvim, you can install this plugin as below:
use {
"kode-team/mastodon.nvim",
requires = {
"nvim-lua/plenary.nvim",
"rcarriga/nvim-notify",
"kkharji/sqlite.lua",
},
config = function()
require("mastodon").setup()
end
}
If you are using lazy.nvim, you can install this plugin as below:
{
"kode-team/mastodon.nvim",
dependencies = {
"nvim-lua/plenary.nvim",
"rcarriga/nvim-notify",
"kkharji/sqlite.lua",
},
config = function()
require("mastodon").setup()
end
}
(thanks to @kimusan)
Before using this plugin, you need to add your mastodon account using MastodonAddAccount
command. With this command, you can switch to the account using MastodonSelectAccount
For the detail, follow the guide below:
(Click me)
- Go to
/settings/applications
, and ClickNew Application
button
- Fill in the form freely and Check proper permissions as below
- After creating new application, Copy the
ACCESS TOKEN
- Go back to the neovim, and Enter
:MastodonAddAccount
- Enter your mastodon instance's url
- Enter your access token
- After adding account, make sure that your mastodon account is available. Switch to your account using
:MastodonSelectAccount
command, and Watch your home timeline using:MastodonLoadHomeTimeline
command. That's all!
With MastodonLoadHomeTimeline
command, you can see your account's home timeline.
If you want to switch to another account, you can use MastodonSelectAccount
command.
Buffer-wide or system-wide keymap starts with
,m
For buffer-wide keymap, you can call those keymap within only Mastodon Buffer
:
,mr
- Refreshes currentMastodon Buffer
For system-wide keymap, you can call those keymap in anywhere:
,mw
- alias forMastodonTootMessage
command,ms
- alias forMastodonSelectAccount
command,mh
- alias forMastodonLoadHomeTimeline
command,mf
- alias forMastodonLoadFavourites
command,mb
- alias forMastodonLoadBookmarks
command
Status-wide keymap starts with
,t
Within Mastodon Buffer
, each line has metadata which includes status's id and url. Through those status-wide keymap, the keymap takes status's id from current line's metadata, and fetches status, and enable you take action:
,tr
- Enables you to reply current status,tb
- Enables you to add current status to bookmarks,tf
- Enables you to add current status to favourites,tB
- Enables you to boost current status,tv
- Enables you to see current status's raw data
require("mastodon").setup({
keymaps = {
["buffer-wide-keymaps"] = {
["reload-statuses"] = ",mr",
["scroll-to-top"] = ",mk",
["scroll-to-bottom"] = ",mj",
["reply"] = ",tr",
["bookmark"] = ",tb",
["favourite"] = ",tf",
["boost"] = ",tB",
["print"] = ",tv",
},
["system-wide-keymaps"] = {
["home-timeline"] = ",mh",
["bookmarks"] = ",mb",
["favourites"] = ",mf",
["mentions"] = ",mR",
["post-message"] = ",mw",
["select-account"] = ",ms",
},
}
})
.
├── Makefile
├── README.md
├── lua
│ ├── mastodon
│ │ ├── actions.lua
│ │ ├── api_client.lua
│ │ ├── commands.lua
│ │ ├── db_client.lua
│ │ ├── parser.lua
│ │ ├── renderer.lua
│ │ └── utils.lua
│ └── mastodon.lua
Just run commands as below:
$ make