dashboard-nvim
dashboard-nvim copied to clipboard
share your custom dashbaord
You can share your custom dashboard in here. i will add it to wiki demo page. Thanks.
How about this: https://gist.github.com/shaggyrogers/2c928108d1fa87ab4462fad9be99ebec
It looks complete, the github file display might be misleading:
(Those vertical lines are because of indent guides, not a problem)
seems like good.
Still working in progress and maybe I will change but I will post because I like it.
I tried to find a way to show loading time like doom emacs reading startuptime.vim code but it needs vimscript knowledge and I can't.
Hey @btwiusegentoo neovim does not intend to add time calculations at startup. So this is impossible. I have communicated with them. Unless you call the ·startuptime· command asynchronously to read the output file and return the time. However, this will affect the startup speed. So I am not going to do this. You can add other things of interest to the footer.
Hey @btwiusegentoo neovim does not intend to add time calculations at startup. So this is impossible. I have communicated with them. Unless you call the ·startuptime· command asynchronously to read the output file and return the time. However, this will affect the startup speed. So I am not going to do this. You can add other things of interest to the footer.
Thanks for the explanation! If it affects startup speed, I think it's not worth.
cool, how do you guys generate the dashbaord picture?
cool, how do you guys generate the dashbaord picture?
I personally don't have any knowledge about design so I use this site to convert from picture. https://asciiart.club/
neofetch supports showing an actual image (not asciiart), can you look into this for dashboard-nvim? https://github.com/dylanaraps/neofetch
I have been concerned about whether I can display pictures in vim for a long time. You can use uberzug in neovim to show that , But they are all based on terminal escape. Uberzug can only work on Linux, it is not universal on all platforms. Secondly, we can only get the picture display in the terminal buffer, and the picture cannot be escaped in the ordinary buffer. The dashboard builds an ordinary buffer. So I don't know if there is any way to display the correct sequence of pictures in the normal buffer. If you see any related implementation please let me know. I am happy to implement it
FWIW, I think sixel will be the future for terminal image display and there are plugin that uses it. https://github.com/mattn/vim-nyancat but I don't know other plugins that display image. the problem is sixel is still not supported by most terminals. Seems like ueberzug is the best solution for Linux that supports many terminals now but supporting macOS may be complicated because needs to support kitty or iterm2?
sixel need terminal to support. Seems like kitty iterm2 alacritty doesn't support it. The imagcat
works well in macos.But the neovim terminal cannot escape imagcat correctly. So unable to work together
also what if the client is a gui instead of a terminal?
Like emacs the client need build with imagemagick
.
For this feature, it is actually not important. Because we write code in vim most of the time....
Just FWIW, about escape sequence. I don't think it's actually usable. but if someone want to give a try
I was messing my init.vim today and I found a very hacky way to display image lol
using floating window. ofcourse there are many problems.
Maybe it's possible to use to display image using kitty or ueberzug idk I'm noob
prerequisites: text file generated using chafa or something.
chafa --size=120x25 neovim-logo-shadow.png >> ascii.txt
define function
" Show image in dashboard using ansi escape sequences
function! DashboardImage()
let s:width = 120
let s:height = 17
let s:row = float2nr(s:height / 5)
let s:col = float2nr((&columns - s:width) / 2)
let s:opts = {
\ 'relative': 'editor',
\ 'row': s:row,
\ 'col': s:col,
\ 'width': s:width,
\ 'height': s:height,
\ 'style': 'minimal'
\ }
let s:buf = nvim_create_buf(v:false, v:true)
let s:win = nvim_open_win(s:buf, v:true, s:opts)
hi! DashboardImage guibg=NONE guifg=NONE
call nvim_win_set_option(s:win, "winblend", 0)
call nvim_win_set_option(s:win, "winhl", "Normal:DashboardImage")
terminal cat ~/Downloads/ascii.txt
:exe "normal \<C-W>\<C-w>"
endfunction
and call when dashboard opened
" show image in dashboard
autocmd Filetype dashboard call DashboardImage()
problems
- Idk what is the best way to close floating window when exiting dashboard without affecting other floating windows(like FZF,vim-which-key) using WinLeave somehow breaks all other floating windows and becomes unusable.
- I can't imagine a way to move or close floating window when sidebar opened to look more natural
Wow. It looks like good. But It seems that the frame loss is a bit serious for complex pictures
you can call nvim_close_win(winid,v:true)
and bind it to autocmd buffer leave to close it when leave dashboard.
Thanks! my 1st picture was rough because I have line height set in alacritty. 2nd is default xterm. still have frame loss but... I think it is acceptable for logo imo. I will prefer than ascii art.
I tried using catimg instead of cat now and it works.
and, thanks for letting me know how to use nvim_close_win
. channging from WinLeave to BufLeave makes vim-which-key
and FZF work.
still there are errors when opening files
Error detected while processing function 10[30]..<SNR>49_callback:
line 21:
Vim(normal):Can't re-enter normal mode from terminal mode
I will try to see what I can do to fix. I hope it's possible to make this usable
Ok, I found a way that works fine for me.
" show image in dashboard
autocmd user DashboardReady call DashboardImage() | autocmd BufLeave <buffer> call CloseDashboardImage()
function! CloseDashboardImage()
"let bufnr = bufnr('%')
"execute bufnr . 'bdelete!'
execute "bdelete! 2"
"call nvim_win_close(DashboardImage(), v:true)
endfunction
(please ignore comments. it's what I tested to run simultaneously.) closing buffer instead of closing window works. I don't know if transparent window remains and I even don't know how to check but it works for me. Now, image window goes away when I open file from FZF, open terminal, open coc-explorer. that's what I confirmed. I get the error above if I close window.
Edit: Now experimenting with ueberzug. it works but it overlaps with other float windows like FZF because it's not using escape sequence and it's just showing picture above terminal.
Edit2: I will give up to try ueberzug. FZF becomes totally unusable when ueberzug is showing image above. And I can't imagine a way to detect FZF/other floating windows including denite,which-key and kill ueberzug now. I will not sacrifice usability for appearance.
@btwiusegentoo can you tell me what you did to get ueberzug working? Thanks
@btwiusegentoo can you tell me what you did to get ueberzug working? Thanks
Hi! First, I had a script to launch ueberzug that home.nix above generates. I don't have code anymore but it's what I have in that screenshot selected in visual mode.
uses variable that I set inside init.vim.
And I called floating terminal like before, but set variable and run the script above. like nvim.vim from the screenshot.
I set the variable imgwidth
,imgheight
first. set manually. it was something like 200 and 15 for me but I don't remember and it's not in the screenshot. and set $dashboardwidth
,$dashboardheight
to img{width,height}. I did this to set same size for floating window and ueberzug image. Now I think this is don't needed because ueberzug can draw outside floating window. so maybe window size can be something different and probably floating terminal is not needed? and I have $dashboardimg
to specify image path(must have full path. ~/
don't work), and the paddings. seems like $dashboardx = (&columns / 2) - (&imgwidth / 2)
is good enough to centralize horizontally. idk math but this worked for me. $dashboardy = 0
was fine for me. finally launch the script with all variablesterminal ~/scripts/nvimimg.sh
and unfocus from floating terminal exe "normal \<C-W>\<C-w>
I had a easy scripts https://github.com/hardcoreplayers/dashboard-nvim/pull/15 . But many details need to be adjusted. So I will add full support when I have time. It only works on linux .
This will only work in terminal nvim right?
I had a easy scripts #15 . But many details need to be adjusted. So I will add full support when I have time. It only works on linux .
If the gui vim support has a built-in terminal. It can be support.
Super Saiyan
How do I set the dashboard to the output of a command ?
For example I would like header to be the output of cat sunjon.cat
(see here this is really cool!) and the footer to be the output of fortune | lolcat
@p00f I got it work like this
Oh so that works. What about fortune | lolcat
? (Lolcat turns the output RGB-rainbow)
If it works fine in neovim built-in terminal, that will be work.
No I mean how do I do it?
let g: dashboard_custom_header="???"
@p00f I have not submitted pr,Please wait. About this cat file. tha author doesnot allow other to use .So you need build your own cat file ..
sunjon on Freenode that's my logo
sunjon on Freenode please don't use it yet, I'm saving it for my own project.
sunjon on Freenode rather, feel free to use it for your personal stuff
Ye I'll use it in my personal stuff, no need to include this
I will create pr tomorrow
How do I do the fortune lolcat one tho
I tried
let foo = system('fortune | lolcat')
let g:dashboard_custom_footer = [foo]
But i get
even though it works in
:terminal
-
I think it may have to do with your colorscheme taking over the output colors. I don't know though I might be wrong
@glepnir how did you get sunjon's neovim text to work? (just for my personal config)
Please check readme . I had add option to do that
how did you lolcat it? i get a black background
let g:dashboard_preview_command="cat"
let g:dashboard_preview_file="~/.config/environment.d/sway.conf"
let g:dashboard_preview_pipeline="lolcat"
let g:dashboard_preview_file_width=70
let g:dashboard_preview_file_height=10
don't know why you got black background does it work fine with this command cat youfile | lolcat
?
that makes it blank (no header at all)
don't know what happen. dashboard just call :terminal cat your file | lolcat
in neovim. you can confirm by this command.
that works, but dashboard doesnt
hmm can you send your test file here?
works fine for me
Here is mine:
Does anyone know how can I add colors to the header btw?
Does anyone know how can I add colors to the header btw?
pipe it to lolcat (see pipe command in the readme).
Infact...a better question is, is it possible to pipe the default header through lolcat?
lolcat just a cli to make some ascii text more colorful.. so what do you mean ?
I wondered if there was an easy way to apply it to the default header that comes with dashboard?
maybe just replace nvim logo by default ascii text
Has anyone ever come across this annoying message before? No idea how it can be suppressed
reduce the height value .
We finally have it...
why your header looks wired
How do you guys disable line numbers?
hmmm it's disable by default . Don't know why you got line number.
weird, tried to disable all other plugins and commented out all vim settings, still see line numbers
I can't reprodue with min config
Maybe A Demo including Telescope
https://user-images.githubusercontent.com/46556080/113480327-6e903980-94b1-11eb-8362-81dc55a7f43f.mp4
- My Dashboard :smiley:
![Screen Shot 2021-04-07 at 4 12 46 PM](https://user-images.githubusercontent.com/66688118/113833380-2a0be300-97bc-11eb-806a-42438f1667aa.png)
But how do I add custom sections on the originals?
let g:dashboard_custom_section = {
\ 'buffer_list': {
\ 'description': [' Recently lase session SPC b b'],
\ 'command': ':e .vimrc'}
\ }
it just removes all of the originals, when I set as above, there is only one entry.
Did DashBoard just set all the entries with dashboard_custom_section
if it exists.
you can build a command call a function . inside function do open vimrc .then pass the command into section.
![Снимок экрана 2021-05-01 в 10 21 21](https://user-images.githubusercontent.com/366246/116774708-14aa7180-aa67-11eb-8745-c31f5414f7ca.png)
WIP
Is there any way to add an image as the dashboard image for macOS, I found this and I thought it was really cute:
https://user-images.githubusercontent.com/71196912/117590509-d7e11900-b0fd-11eb-82bc-6d5eb9957ae1.png
@shaunsingh you can use this converter: https://505e06b2.github.io/Image-to-Braille/ Be sure to chose "Value" option instead of the default "Luminance" to see the details
![image](https://user-images.githubusercontent.com/71196912/117716898-1e8b4d80-b1a8-11eb-8e8c-f93b6cd0c085.png)
After a bit of editing this is what I got, I think it came out quite nice
Code: https://github.com/shaunsingh/vimrc-dotfiles/blob/193761d4597c0d2395391a0dad830ddf1b86f581/nvim/init.lua#L852
Decided to go with a meme from reddit. Also, sry for the indent lines, not sure why they show.
Here is mine:
Does anyone know how can I add colors to the header btw?
You can use vim.cmd 'hi DashboardHeader ' to add colors to header.
@konart Awesome config! How did you display modified and untracked files on the footer?
@PeSader I'm using Telescope's utils to get the info and then add it to the dashboard's footer:
local utils = require('telescope.utils')
local set_var = vim.api.nvim_set_var
local git_root, ret = utils.get_os_command_output({ "git", "rev-parse", "--show-toplevel" }, vim.loop.cwd())
local function get_dashboard_git_status()
local git_cmd = {'git', 'status', '-s', '--', '.'}
local output = utils.get_os_command_output(git_cmd)
set_var('dashboard_custom_footer', {'Git status', '', unpack(output)})
end
if ret ~= 0 then
local is_worktree = utils.get_os_command_output({ "git", "rev-parse", "--is-inside-work-tree" }, vim.loop.cwd())
if is_worktree[1] == "true" then
get_dashboard_git_status()
else
set_var('dashboard_custom_footer', {'Not in a git directory'})
end
else
get_dashboard_git_status()
end
@shaunsingh Your logo came out looking great! What tool did you use for it?
When Imposter is SUS
This is my Configuration.
What I really like, is the quote in the footer of dashboard. It will display the Gandalf quote, but replace Frodo
with $USER
on linux/macOS or %USERNAME%
on windows (although I don't know if it works on windows)
![Screenshot 2021-09-08 at 16 38 51](https://user-images.githubusercontent.com/36300441/132530921-4ca029fb-cccc-4894-8ef6-217ba1576de8.png)
inspired from @shaunsingh added custom mappings
as an aside, I would reconmend improving the shortcut highlight group, single keys (eg.: 'q') or symbols (eg.: '
it would be nice to define
let g:dashboard_custom_section={
\ 'section': {
\ 'description': ['Text...'],
\ 'command': 'Some Command' or function('your funciton name')
\ 'shortcut': "<leader> hjkl"}
\ }
local g = vim.g
g.dashboard_session_directory = '~/.config/nvim/.sessions'
g.dashboard_default_executive ='telescope'
g.dashboard_custom_section = {
a = {description = {" Find File leader f f"}, command = "Telescope find_files"},
b = {description = {" Recents leader f h"}, command = "Telescope oldfiles"},
c = {description = {" Find Word leader f g"}, command = "Telescope live_grep"},
d = {description = {" New File leader e n"}, command = "DashboardNewFile"},
e = {description = {" Bookmarks leader m "}, command = "Telescope marks"},
f = {description = {" Load Last Session leader l "}, command = "SessionLoad"},
g = {description = {" Update Plugins leader u "}, command = "PackerUpdate"},
h = {description = {" Settings leader e v"}, command = "edit $MYVIMRC"},
i = {description = {" Exit leader q "}, command = "exit"}
}
g.dashboard_custom_footer = {'type :help<Enter> or <F1> for on-line help'}
vim.cmd [[
augroup dashboard_au
autocmd! * <buffer>
autocmd User dashboardReady let &l:stl = 'Dashboard'
autocmd User dashboardReady nnoremap <buffer> <leader>q <cmd>exit<CR>
autocmd User dashboardReady nnoremap <buffer> <leader>u <cmd>PackerUpdate<CR>
autocmd User dashboardReady nnoremap <buffer> <leader>l <cmd>SessionLoad<CR>
augroup END
]]
g.dashboard_custom_header = {
" :h- Nhy` ",
" -mh. h. `Ndho ",
" hmh+ oNm. oNdhh ",
" `Nmhd` /NNmd /NNhhd ",
" -NNhhy `hMNmmm`+NNdhhh ",
" .NNmhhs ```....`..-:/./mNdhhh+ ",
" mNNdhhh- `.-::///+++////++//:--.`-/sd` ",
" oNNNdhhdo..://++//++++++/+++//++///++/-.` ",
" y. `mNNNmhhhdy+/++++//+/////++//+++///++////-` `/oos: ",
" . Nmy: :NNNNmhhhhdy+/++/+++///:.....--:////+++///:.`:s+ ",
" h- dNmNmy oNNNNNdhhhhy:/+/+++/- ---:/+++//++//.` ",
" hd+` -NNNy`./dNNNNNhhhh+-:///// -+oo:` ::-:+////++///:` ",
" /Nmhs+oss-:++/dNNNmhho:--::/// /mmmmmo ../-///++///////. ",
" oNNdhhhhhhhs//osso/:---:::/// /yyyyso ..o+-//////////:/. ",
" /mNNNmdhhhh/://+///:::////// -:::- ..+sy+:////////::/:/. ",
" /hNNNdhhs--:/+++////++/////. ..-/yhhs-/////////::/::/` ",
" .ooo+/-::::/+///////++++//-/ossyyhhhhs/:///////:::/::::/: ",
" -///:::::::////++///+++/////:/+ooo+/::///////.::://::---+` ",
" /////+//++++/////+////-..//////////::-:::--`.:///:---:::/: ",
" //+++//++++++////+++///::-- .::::-------:: ",
" :/++++///////////++++//////. -:/:----::../- ",
" -/++++//++///+////////////// .::::---:::-.+` ",
" `////////////////////////////:. --::-----...-/ ",
" -///://////////////////////::::-.. :-:-:-..-::.`.+` ",
" :/://///:///::://::://::::::/:::::::-:---::-.-....``/- - ",
" ::::://::://::::::::::::::----------..-:....`.../- -+oo/ ",
" -/:::-:::::---://:-::-::::----::---.-.......`-/. ``",
" s-`::--:::------:////----:---.-:::...-.....`./: ",
" yMNy.`::-.--::..-dmmhhhs-..-.-.......`.....-/:` ",
" oMNNNh. `-::--...:NNNdhhh/.--.`..``.......:/- ",
" :dy+:` .-::-..NNNhhd+``..`...````.-::-` ",
" .-:mNdhh:.......--::::-` ",
" yNh/..------..` ",
" ",
" N E O V I M ",
}
How do you align the custom menus together?
Here's how mine looks like but I'd like all of the menus be aligned to left so it looks more "flush"
@Akselmo hammering down on the spacebar until it fits
Yup, that did the trick, thanks.
Very basic, first time using this plugin and I'm lovin' it
Pikachu!
I got my logo to display:
But it should really look like this (a.k.a. I need terminal escape sequences to work.):
How did you get yours to work @EpsilonKu ?
What I get right now (pasting the contents of a lolcat
output I get this:
I did it through the
let g:dashboard_custom_header =<< trim END
<stuff>
END
Tried without trim to no avail.
@lorecast162 Well, u need to show that lolcat will render it.
let g:dashboard_preview_command = 'cat'
let g:dashboard_preview_pipeline = 'lolcat --spread=2.5 -t --seed=156'
@EpsilonKu So it has to rerender it with lolcat all the time?
Because by "lolcat output" I meant the text from a lolcat output pasted right in my config
Yea, I made like that. It will rerender everytime.
https://github.com/zim0369/dotfiles/tree/main/config/nvim
nice
@EpsilonKu I got it to show the text how I wanted (had to remove your options tho, apparently they're not in my version of lolcat (f35 repos) ) but I have another issue now: I cannot get rid of the [Process exited 0]
text...
Apparently another user had the same issue in https://github.com/glepnir/nvim/issues/20 (I cannot read chinese)
@lorecast162 Just give fixed length.
![]()
WIP
Where can I get this? I so want that