init.lua 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. local M = {}
  2. M.config = function()
  3. vim.g.dashboard_disable_at_vimenter = 0
  4. vim.g.dashboard_custom_header = O.dashboard.custom_header
  5. vim.g.dashboard_default_executive = 'telescope'
  6. vim.g.dashboard_custom_section = {
  7. a = {
  8. description = {' Find File '},
  9. command = 'Telescope find_files'
  10. },
  11. b = {
  12. description = {' Recently Used Files'},
  13. command = 'Telescope oldfiles'
  14. },
  15. c = {
  16. description = {' Load Last Session '},
  17. command = 'SessionLoad'
  18. },
  19. d = {
  20. description = {' Find Word '},
  21. command = 'Telescope live_grep'
  22. },
  23. e = {
  24. description = {' Settings '},
  25. command = ':e ' .. CONFIG_PATH .. '/lv-config.lua'
  26. },
  27. f = {
  28. description = {' Neovim Config Files'},
  29. command = 'lua require(\'telescope.builtin\').find_files({search_dirs = {"~/.config/nvim"}})'
  30. }
  31. -- e = {description = {' Marks '}, command = 'Telescope marks'}
  32. }
  33. vim.cmd(
  34. "let g:dashboard_session_directory = $HOME..'/.config/nvim/.sessions'")
  35. vim.cmd(
  36. "let packages = len(globpath('~/.local/share/nvim/site/pack/packer/start', '*', 0, 1))")
  37. vim.api.nvim_exec([[
  38. let g:dashboard_custom_footer = ['LuaJIT loaded '..packages..' plugins']
  39. ]], false)
  40. -- file_browser = {description = {' File Browser'}, command = 'Telescope find_files'},
  41. -- vim.g.dashboard_session_directory = CACHE_PATH..'/session'
  42. -- vim.g.dashboard_custom_footer = O.dashboard.footer
  43. end
  44. require('lv-utils').define_augroups({
  45. _dashboard = {
  46. -- seems to be nobuflisted that makes my stuff disapear will do more testing
  47. {
  48. 'FileType', 'dashboard',
  49. 'setlocal nocursorline noswapfile synmaxcol& signcolumn=no norelativenumber nocursorcolumn nospell nolist nonumber bufhidden=wipe colorcolumn= foldcolumn=0 matchpairs= '
  50. }, {
  51. 'FileType', 'dashboard',
  52. 'set showtabline=0 | autocmd BufLeave <buffer> set showtabline=2'
  53. }, {'FileType', 'dashboard', 'nnoremap <silent> <buffer> q :q<CR>'}
  54. }
  55. })
  56. return M