There are a million ways to check the price of your favourite coins. Now I made a nvim
plugin with which you can do the
same from your session.
Just imagine...:thinking: you are in the flow, coding your time away. You are typing a new variable name which resembles to one of your favourite coins and you remember... you did not check the crypto price for more than 5 minutes :open_mouth: :scream:. Before this plugin you would have panicked, but now you just call
:lua require("cryptoprice").toggle()
with your favourite key binding and calmness settles 😍, you can continue your work. 😌
(I made this just to learn about nvim
and lua
a little bit - nothing serious)
Plug 'nvim-lua/plenary.nvim' -- if you already have this you don't need to include it
Plug 'gaborvecsei/cryptoprice.nvim'
:lua require("cryptoprice").toggle()
nnoremap <leader>cy <cmd>lua require('cryptoprice').toggle()<cr>
You'll need to setup what coins you would like to see and in which currency.
base_currency
: E.g.:eur
orusd
- Here you can see all the valid currencies api.coingecko.com/api/v3/simple/supported_vs_currencies
crypto_list
: This is a list with the id of the coin on CoinGecko- Use
:lua require("cryptoprice.dev").find_coin_id("BTC")
to find a coin's ID- Or check the available ids here: api.coingecko.com/v3/coins/list
- Usually this is the name of the coin instead of their symbol
- e.g.
["bitcoin", "ethereum", "shiba-inu", "dogecoin"]
- Use
window_width
: width of the popup windowwindow_height
: height of the popup window
let g:cryptoprice_base_currency = "usd"
let g:cryptoprice_crypto_list = ["bitcoin", "ethereum"]
let g:cryptoprice_window_width = 60
let g:cryptoprice_window_height = 10
vim.g.cryptoprice_base_currency = "usd"
vim.g.cryptoprice_crypto_list = {"bitcoin", "ethereum"}
vim.g.cryptoprice_window_width = 60
vim.g.cryptoprice_window_height = 10
lua << EOF
require("cryptoprice").setup{
base_currency="usd",
crypto_list={"bitcoin", "ethereum"},
window_height=10,
window_width=60
}
EOF
I used parts of their code, apis or learned some concepts from them during the process