nvimdev / dashboard-nvim Goto Github PK
View Code? Open in Web Editor NEWvim dashboard
License: MIT License
vim dashboard
License: MIT License
Greetings @glepnir,
Thank you for work on this amazing plugin. It modernizes the neovim setup quite much. Is it possible to embed in session load/save's like pre and post commands?
I want to close out empty buffers whenever I open a session because I sometimes have leftover directory buffer or some random empty buffers on the session. Is this something possible or am I missing something that is already implemented in?
This might seems sort of obscure but in the examples in the wiki the default has a footer of "neovim loaded 63 plugins". It's not in the README but skimming through the code it looks like this information is obtained by using the dein plugin manager.
Maybe have a section in the wiki for code snippets for getting the same the in the footer. For example if the user has fd installed and is using packer to install plugins.
" we ignore the directories 'start' and 'opt'
let g:total_plugins = trim(system("fd -d 2 . $HOME'/.local/share/nvim/site/pack/packer' | head -n -2 | wc -l"))
let g:dashboard_custom_footer = [' loaded '. g:total_plugins .' plugins ']
Note ~/.local/share/nvim/site/pack/*/opt
and ~/.local/share/nvim/site/pack/*/start
are the default runtime for plugins in neovim. Any plugin manager that installs to this directory can use this could if they change packer to whatever their package manager uses.
Hi,
I just installed dashboard-vim
to replace Startify
(or to see whether it can do that, because I just realized how much I rely on startify now that it is gone :D). I have not made up my mind yet, but it does seem really awesome; I just kinda miss seeing the recently edited files and opening them by number, but perhaps I can change my workflow. Anyway, that is not what this is about.
Is it possible to run autocmnds on the dashboard? I use Yggdroot/indentline
, which is configured to display tabs. This makes the dashboard look ugly, as there are "random" vertical lines where there should be noting at all. While I can manually run IndentLineToggle
, I'd prefer to automatically run this when dashboard-vim
is started (and ideally when it's closed again so I got my indentation visible in regular text files again).
I tried :echo @%
to determine what the buffer is titled (will usually return something like /home/me/.config/nvim/init.vim
), but it will return nothing / empty string for the dashboard when opening vim.
Btw., I just tested, and the very same happens when running :Startify
, so this doesn't seem to be a bug per se, but it'd still be nice if there was a way to fix this.
Thank you for your help :)
Error detected while processing /home/kino/.cache/dein/.cache/init.vim/.dein/autoload/dashboard/section.vim:
line 37:
E716: Key not present in Dictionary: new_file
Press ENTER or type command to continue
Error detected while processing /home/kino/.cache/dein/.cache/init.vim/.dein/autoload/dashboard/section.vim:
line 37:
E15: Invalid expression: { 'last_session' :[s:dashboard_shortcut_icon['last_session'].'Recently last session
'.s:dashboard_shortcut['last_session']], 'find_history' :[s:dashboard_shortcut_icon['find_history'].'Recently opened files
'.s:dashboard_shortcut['find_history']], 'find_file' :[s:dashboard_shortcut_icon['find_file'].'Find File
'.s:dashboard_shortcut['find_file']], 'new_file' :[s:dashboard_shortcut_icon['new_file'].'New F
ile '.s:dashboard_shortcut['new_file']], 'change_colorscheme' :[s:dashboard_shortcut_icon['change_color
scheme'].'Change Colorscheme '.s:dashboard_shortcut['change_colorscheme']], 'find_word' :[s:dashboard_s
hortcut_icon['find_word'].'Find word '.s:dashboard_shortcut['find_word']], 'book_marks' :[s:das
hboard_shortcut_icon['book_marks'].'Jump to book marks '.s:dashboard_short
I run SessionSave can get confirmation that 'is now persistent'. However when I try to load it will say the session loaded, but it will just be a blank page
我更新完插件之后打开vim会报这个错
处理 /home/kyle/.config/nvim/plugged/dashboard-nvim/autoload/dashboard/section.vim 时发生错误:
第 45 行:
E716: Dictionary 中不存在键: new_file
请按 ENTER 或其它命令继续
处理 /home/kyle/.config/nvim/plugged/dashboard-nvim/autoload/dashboard/section.vim 时发生错误:
第 45 行:
E15: 无效的表达式: { 'last_session' :[s:dashboard_shortcut_icon['last_session'].'Recently last session '.s:dashboard_shortcut['last_session']], 'fi
nd_history' :[s:dashboard_shortcut_icon['find_history'].'Recently opened files '.s:dashboard_shortcut['find_history']], 'find_file' :[s:
dashboard_shortcut_icon['find_file'].'Find File '.s:dashboard_shortcut['find_file']], 'new_file' :[s:dashboard_shortcut_icon['new_f
ile'].'New File '.s:dashboard_shortcut['new_file']], 'change_colorscheme' :[s:dashboard_shortcut_icon['change_colorscheme'].'Change Colorsch
eme '.s:dashboard_shortcut['change_colorscheme']], 'find_word' :[s:dashboard_shortcut_icon['find_word'].'Find word
'.s:dashboard_shortcut['find_word']], 'book_marks' :[s:dashboard_shortcut_icon['book_marks'].'Jump to book marks '.s:dashboard_short
请按 ENTER 或其它命令继续
请问这个该怎么解决?
I’m new to using neovim/vim and I wanted to try this plugin.
I tried translating the mappings for the built in functionality of the dashboard to lua, but I couldn’t get my mappings to work.
could you create an example of how to map the default commands of the dashboard using Lua?
For more context, I’m using telescope with this dashboard plugin.
Maybe it is not an issue, but could I know how can I created the logo like this? Is it output by figlet? If so, what's the figlet's font?
These are the defaults of dashboard, personally I don't use change_colorscheme, book_marks
, etc.
eg : "SPC mean the leaderkey
let g:dashboard_custom_shortcut={
\ 'last_session' : 'SPC s l',
\ 'find_history' : 'SPC f h',
\ 'find_file' : 'SPC f f',
\ 'new_file' : 'SPC c n',
\ 'change_colorscheme' : 'SPC t c',
\ 'find_word' : 'SPC f a',
\ 'book_marks' : 'SPC f b',
\ }
When I only include the ones that I use, dashboard gives an error. For example if I remove the change_colorscheme
line, it gives an error saying Key not present in Dictionary: "change_colorscheme"
Is there a way for me to not include everything?
firstly I use the vimplug to manage my vim plugs.
and i add
Plug 'hardcoreplayers/dashboard-nvim'
into
~/.vimrc.custom.plug
then i open the file via vim , i meet these error, do you know why.my system is ubuntu-20.04
Error detected while processing /home/meison/.vim/plugged/dashboard-nvim/plugin/dashboard.vim:
line 16:
E117: Unknown function: getenv
E15: Invalid expression: getenv('HOME')
line 17:
E121: Undefined variable: s:home_dir
E116: Invalid arguments for function expand(($XDG_CACHE_HOME ? $XDG_CACHE_HOME : s:home_dir.'/.cache') . '/vim')
E15: Invalid expression: expand(($XDG_CACHE_HOME ? $XDG_CACHE_HOME : s:home_dir.'/.cache') . '/vim')
line 24:
E121: Undefined variable: s:session_path
E116: Invalid arguments for function get(g:, 'dashboard_session_directory', s:session_path.'/session')
E15: Invalid expression: get(g:, 'dashboard_session_directory', s:session_path.'/session')
When opening neovim, the dashboard appears like it should. If using a command like find word, or find recently opened files from telescope, the dashboard disappears when exiting telescope. The weird thing is that this only happens if the terminal window size is smaller than a certain size. If the terminal window is taking up the entire screen, this does not happen, but with the default size when opening a new window, this bug happens.
If it's helping, I am using macOS with iTerm2, and here is my minimal init.vim
call plug#begin('~/.vim/plugged')
Plug 'glepnir/dashboard-nvim'
Plug 'nvim-telescope/telescope.nvim'
Plug 'nvim-lua/popup.nvim'
Plug 'nvim-lua/plenary.nvim'
call plug#end()
set termguicolors
lua require'config/telescope'
lua require'config/dashboard'
config/telescope:
local utils = require'utils'
local map = utils.map
map('', '<C-p>', ':update <bar> :Telescope find_files<CR>', {noremap = false})
map('n', '<leader>a', ':Telescope live_grep<CR>', {noremap = false})
map('n', '<C-t>', ':tabedit <bar> :Telescope find_files<CR>', {noremap = false})
require('telescope').setup{}
config/dashboard:
local g = vim.g
g.dashboard_default_executive = 'telescope'
g.dashboard_custom_footer = {''}
g.dashboard_custom_section = {
find_history = {
description = {' Recently opened files'},
command = 'DashboardFindHistory'
},
find_word = {
description = {' Find word '},
command = 'DashboardFindWord'
},
last_session = {
description = {' New file '},
command = 'DashboardNewFile'}
}
g.dashboard_custom_header = {
"",
"",
"",
" 'c. ",
" ,xNMM. ",
" .OMMMMo ",
" OMMM0, ",
" .;loddo:' loolloddol;. ",
" cKMMMMMMMMMMNWMMMMMMMMMM0: ",
" .KMMMMMMMMMMMMMMMMMMMMMMMWd. ",
" XMMMMMMMMMMMMMMMMMMMMMMMX. ",
";MMMMMMMMMMMMMMMMMMMMMMMM: ",
":MMMMMMMMMMMMMMMMMMMMMMMM: ",
".MMMMMMMMMMMMMMMMMMMMMMMMX. ",
" kMMMMMMMMMMMMMMMMMMMMMMMMWd. ",
" .XMMMMMMMMMMMMMMMMMMMMMMMMMMk ",
" .XMMMMMMMMMMMMMMMMMMMMMMMMK. ",
" kMMMMMMMMMMMMMMMMMMMMMMd ",
" ;KMMMMMMMWXXWMMMMMMMk. ",
" .cooc,. .,coo:. ",
"",
}
How hard would it be to scale the dashboard based on the split size instead of the whole terminal window size? For example, right now this is what happens when I try to open the dashboard in two different vertical splits:
.
I'm not sure but I think this happens because it's trying to adapt to the size of the terminal, not to the size of its current vim split.
Would also be great to automatically adjust to window or split resize. In my .vimrc I have autocmd VimResized * wincmd =
, this automatically balances the splits when I resize the terminal window, the dashboard may be refreshed in this scenario and also in the "split changed size" scenario (I think there's already an autocmd event option for that).
Thank you for this amazing dashboard plugin by the way :)
I use shortcut keys for Dashboard functions, but when I select an icon and press Enter, an error will be reported;Using clap to use the shortcut key function is fine, but if you press Enter in the second way, it will not report an error, but there will be no query results.
My Dashboard config
Plug 'glepnir/dashboard-nvim'
Plug 'junegunn/fzf.vim'
" ===
" === FZF
" ===
set rtp+=/usr/local/opt/fzf
noremap <C-p> :Leaderf file<CR>
noremap <C-f> :Ag<CR>
noremap <C-h> :MRU<CR>
noremap <C-t> :BTags<CR>
noremap <C-l> :LinesWithPreview<CR>
noremap <C-w> :Buffers<CR>
"noremap ; :History:<CR>
autocmd! FileType fzf
autocmd FileType fzf set laststatus=0 noruler
\| autocmd BufLeave <buffer> set laststatus=2 ruler
command! -bang -nargs=* Buffers
\ call fzf#vim#buffers(
\ '',
\ <bang>0 ? fzf#vim#with_preview('up:60%')
\ : fzf#vim#with_preview('right:0%', '?'),
\ <bang>0)
command! -bang -nargs=* LinesWithPreview
\ call fzf#vim#grep(
\ 'rg --with-filename --column --line-number --no-heading --color=always --smart-case . '.fnameescape(expand('%')), 1,
\ fzf#vim#with_preview({}, 'up:50%', '?'),
\ 1)
command! -bang -nargs=* Ag
\ call fzf#vim#ag(
\ '',
\ <bang>0 ? fzf#vim#with_preview('up:60%')
\ : fzf#vim#with_preview('right:50%', '?'),
\ <bang>0)
command! -bang -nargs=* MRU call fzf#vim#history(fzf#vim#with_preview())
command! -bang BTags
\ call fzf#vim#buffer_tags('', {
\ 'down': '40%',
\ 'options': '--with-nth 1
\ --reverse
\ --prompt "> "
\ --preview-window="70%"
\ --preview "
\ tail -n +\$(echo {3} | tr -d \";\\\"\") {2} |
\ head -n 16"'
\ })
" ===
" === Dashboard
" ===
let g:dashboard_default_executive ='fzf'
let g:mapleader="\<Space>"
let g:indentLine_fileTypeExclude = ['dashboard']
nmap <Leader>ss :<C-u>SessionSave<CR>
nmap <Leader>sl :<C-u>SessionLoad<CR>
nmap <Leader>cn :<C-u>DashboardNewFile<CR>
nnoremap <silent> <Leader>fh :History<CR>
nnoremap <silent> <Leader>ff :Files<CR>
nnoremap <silent> <Leader>tc :Colors<CR>
nnoremap <silent> <Leader>fa :Rg<CR>
nnoremap <silent> <Leader>fb :Marks<CR>
nnoremap <silent> <Leader>cn :<C-u>DashboardNewFile<CR>
let g:dashboard_custom_shortcut={
\ 'last_session' : 'SPC s l',
\ 'find_history' : 'SPC f h',
\ 'find_file' : 'SPC f f',
\ 'new_file' : 'SPC c n',
\ 'change_colorscheme' : 'SPC t c',
\ 'find_word' : 'SPC f a',
\ 'book_marks' : 'SPC f b',
\ }
Basically the title: https://github.com/glepnir/dashboard-nvim#faq
I wanted to set some of these but wanted to read more about what they did and it doesn't see like they're defined in the help yet.
Hey, there is an issue with the custom shortcut icon
if I set the following in my init.vim
let g:dashboard_custom_shortcut_icon = {}
let g:dashboard_custom_shortcut_icon['last_session'] = '> '
let g:dashboard_custom_shortcut_icon['find_history'] = '> '
let g:dashboard_custom_shortcut_icon['find_file'] = '> '
let g:dashboard_custom_shortcut_icon['new_file'] = '> '
let g:dashboard_custom_shortcut_icon['change_colorscheme'] = '> '
let g:dashboard_custom_shortcut_icon['find_word'] = '> '
let g:dashboard_custom_shortcut_icon['book_marks'] = '> '
it throws the following error
line 23:
E121: Undefined variable: g:dashboard_custom_shortcut
because we are not extending the correct variable in section.vim
I've linked a PR if you want to have a look: #16
Cheers
win10 error ouput:
处理 function sessions#session#session_save 时发生错误
无法打开并写入 “D:/Neovim/session/D:\Neovim\bin\.vim”
session `D:/Ndovim/session/D:\Neovim\bin\.vim` is now persistent
It seems to be caused by the variable file_path
in file autoload/sessions/session.vim
.
let file_path = g:session_directory.'/'.file_name.'.vim'
I try to reprocess file_name
as follow, it looks working.
let file_path = g:session_directory.'/'.split(file_name, '')[-1].'.vim'
First of all, thanks for this amazing VIM plugin. It is a simple but crazy useful idea, that brings VIM way closer to being a full IDE.
My only request/question: is there a way to list sessions rather autoload latest session? If I open another file not in session list, a error will return to me shows that can't load the session of this file.
Thanks a lot.
After updating to a1a2516, I get
Error detected while processing /home/p00f/.local/share/nvim/site/pack/packer/start/dashboard-nvim/autoload/dashboard/section.vim:
line 37:
E716: Key not present in Dictionary: new_file
Press ENTER or type command to continue
Error detected while processing /home/p00f/.local/share/nvim/site/pack/packer/start/dashboard-nvim/autoload/dashboard/section.vim:
line 37:
E15: Invalid expression: { 'last_session' :[s:dashboard_shortcut_icon['last_session'].'Recently last session '.s:dashboard_shortcut['last_session']], '
find_history' :[s:dashboard_shortcut_icon['find_history'].'Recently opened files '.s:dashboard_shortcut['find_history']], 'find_file' :[s:da
shboard_shortcut_icon['find_file'].'Find File '.s:dashboard_shortcut['find_file']], 'new_file' :[s:dashboard_shortcut_icon['new_file'].
'New File '.s:dashboard_shortcut['new_file']], 'change_colorscheme' :[s:dashboard_shortcut_icon['change_colorscheme'].'Change Colorscheme
'.s:dashboard_shortcut['change_colorscheme']], 'find_word' :[s:dashboard_shortcut_icon['find_word'].'Find word '.s:dashboar
d_shortcut['find_word']], 'book_marks' :[s:dashboard_shortcut_icon['book_marks'].'Jump to book marks '.s:dashboard_short
on startup
Commit 38c1d6a is fine
Lines 6 and 10 have Telesope instead of Telescope_
好像staryify使用列表来配置section,希望作者大大也可以修改下,这样,可以把最常用的section放在最上面。我很喜欢这个插件,希望越来越好!
Whenever I open a file in neovim remote lightline doesn't show up. It works fine in normal neovim though
I'm using let g:dashboard_preview_file = '~/.config/nvim/motd'
, which is a file that contains shell control chars. When I run the DashboardNewFile
command, the contents from the dashboard_preview_file are still being displayed and not cleared off the screen. The writing in i mode then happens "behind" the contents.
After following the install instructions, I get many errors about Clap not being installed.
Hey, thanks for making a nice replacement for vim-startify!
I noticed in the default footer you show the amount of plugins being loaded. Will you be able to extend the functionality by putting startup time of the plugins?
When opening recent files, pwd
is home (/home/chinmay
) instead of the directory of the current file
How to reproduce: Select any file from "recently opened" menu, then do :pwd
Expected: pwd
is the directory of the opened file
Hi! I do not use any status bar, how can I stop the dashboard from setting laststatus
to 2
when leaving the dashboard buffer? I tried autocmd FileType dashboard autocmd WinLeave <buffer> set laststatus=0
but does not work.
I have a bash alias to start nvim in "scratchpad mode" (using Codi).
I'd like my alias to disable dashboard-nvim on startup (with e.g. using something like Startify's g:startify_disable_at_vimenter = 1
). Is it currently possible?
Hello. Thank you for your plugin.
I'm using the LunarVim configuration of neovim. It includes dashboard and barbar. Barbar provides tabs for file navigation. I've noticed that when I load a session the tabs do not show up correctly. This only occurs when loading a session from the Dashboard home screen. If I open up neovim with a new buffer and load a saved session, tabs work as expected. I'm not sure what's different about the home screen vs any other buffer.
My workaround is to
nvim i # The file name can be anything since it never gets saved and will be lost immediately when loading a session
Once I've opened neovim without the dashboard home screen, tabs appear correctly in a loaded session.
It seems the line numbers are removed after opening (as well as other settings) depending on the text size relative to the terminal size.
numbers not working with fontsize 11
numbers working with fontsize 10
This is relative to you terminal window so it takes some adjusting.
The above pictures are in alacritty, I have also tested on iterm2
i am using:
let g:dashboard_custom_shortcut={
\ 'last_session' : 'SPC s l',
\ 'find_history' : 'SPC f h',
\ 'find_file' : 'SPC f f',
\ 'new_file' : 'SPC c n',
\ 'change_colorscheme' : 'SPC t c',
\ 'find_word' : 'SPC f a',
\ 'book_marks' : 'SPC f b',
\ }
let g:dashboard_custom_shortcut_icon['last_session'] = ' '
let g:dashboard_custom_shortcut_icon['find_history'] = 'ﭯ '
let g:dashboard_custom_shortcut_icon['find_file'] = ' '
let g:dashboard_custom_shortcut_icon['new_file'] = ' '
let g:dashboard_custom_shortcut_icon['change_colorscheme'] = ' '
let g:dashboard_custom_shortcut_icon['find_word'] = ' '
let g:dashboard_custom_shortcut_icon['book_marks'] = ' '
As in the readme, but it returns me this error on the screenshot.
When I use find file or new file, or otherwise start editing a file right after opening nvim into the dashboard, I no longer get line numbers on the left side. However, when I edit a file directly without opening the dashboard, I get line numbers. Expected behaviour: global line number setting is restored upon leaving the dashboard. What can be done to keep line numbers? Thanks in advance.
Hey dashboard-nvim is really awesome! I missed vim-startify's random quote every time I opened vim. So I made this, it has 323 programmer quotes (vim-startify is around 146 I think). It's a binary, so it won't effect load time or performance, with releases for linux, mac, and windows.
In case anyone reads this all you have to do to use it is
init.vim
/.vimrc
or after/plugin/dashboard.vim
let q= systemlist('pq')
let g:dashboard_custom_footer = q
Hello, I am experiencing several issues with telescope and I am not sure if the problem is from dashboard or telescope itself.
number and sign column are not visible after using telescope:
Steps to reproduce:
set number
and set signcolumn=yes
in init.vimPressing escape when telescope is on creates an empty buffer and closes dashboard-nvim
Expected behavior: Pressing escape should return me to the dashboard-nvim and not creates an empty buffer...
Pressing ctrl-j & ctrl-k does not bring my cursor up or down in telescope but instead write the ctrl character in the text box.
You can share your custom dashboard in here. i will add it to wiki demo page. Thanks.
I'm using neovim v0.4.4 and use dein.vim to install dashboard-nvim.
When I start neovim I will get output like this:
Error detected while processing /home/ds/.config/nvim/dein/.cache/init.vim/.dein/autoload/dashboard/header.vim: line 694: E15: Invalid expression: << trim END
Is it possible to add an option to re-center the dashboard buffer when neovim is resized?
Have a 'neovim' ascii header that I'd like to share!
let g:dashboard_custom_header = [
\ ' ███╗ ██╗ ███████╗ ██████╗ ██╗ ██╗ ██╗ ███╗ ███╗',
\ ' ████╗ ██║ ██╔════╝██╔═══██╗ ██║ ██║ ██║ ████╗ ████║',
\ ' ██╔██╗ ██║ █████╗ ██║ ██║ ██║ ██║ ██║ ██╔████╔██║',
\ ' ██║╚██╗██║ ██╔══╝ ██║ ██║ ╚██╗ ██╔╝ ██║ ██║╚██╔╝██║',
\ ' ██║ ╚████║ ███████╗╚██████╔╝ ╚████╔╝ ██║ ██║ ╚═╝ ██║',
\ ' ╚═╝ ╚═══╝ ╚══════╝ ╚═════╝ ╚═══╝ ╚═╝ ╚═╝ ╚═╝',
\]
Hi, https://github.com/Akin909/nvim-bufferline.lua does not work with this plugin
When using nvim from a terminal (ie open terminal and type nvim
) the dashboard is centred properly
But when using from a desktop shortcut nvim.desktop
:
Exec=konsole -e nvim
Terminal=false
or a neovim GUI (neovide or goneovim), it is not centred
See video:https://imgur.com/zpZJ6PF
Together with vim-better-whitespace the dashboard looks sad.
Hi! First, thanks for the awesome plugin!
I noticed that there's no way to override the commands used for the different shortcuts (if there's I wasn't able to find it).
For example, in order to find a work I prefer to use Ag
instead of Rg
.
Another example could be customizing the popup that appears when using fzf
.
Are there any plans on adding this possibilities?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.