add views to tab bar and into menu and dashboard and move view functions to own file

add commentary function for org-mode with list function to create strings
This commit is contained in:
2021-01-27 01:57:52 +01:00
parent 15ee156a36
commit d8336fbbae
7 changed files with 831 additions and 119 deletions

View File

@@ -92,6 +92,55 @@
)
)
(use-package tab-bar
:config
(tab-bar-mode)
(tab-bar-rename-tab "Default")
(defun my-tab-view-elisp ()
(if (tab-bar--tab-index-by-name "ELisp IDE")
(tab-bar-switch-to-tab "ELisp IDE")
(tab-bar-new-tab)
(tab-bar-rename-tab "ELisp IDE")
(switch-to-buffer "*scratch*")
(my-view-elisp)))
(defun my-tab-view-python ()
(if (tab-bar--tab-index-by-name "Python IDE")
(tab-bar-switch-to-tab "Python IDE")
(tab-bar-new-tab)
(tab-bar-rename-tab "Python IDE")
(if (get-buffer "*scratch-python*")
(switch-to-buffer "*scratch-python*")
(switch-to-buffer "*scratch-python*")
(insert "#!/usr/bin/env python\n")
(insert "\"\"\"\n")
(insert "\"\"\"\n"))
(python-mode)
(my-view-python)))
(defun my-tab-view-shell ()
(if (tab-bar--tab-index-by-name "Shell IDE")
(tab-bar-switch-to-tab "Shell IDE")
(tab-bar-new-tab)
(tab-bar-rename-tab "Shell IDE")
(switch-to-buffer "*scratch-shell*")
(shell-script-mode)
(my-view-shell)))
(defun my-tab-view-org-pdf ()
(if (tab-bar--tab-index-by-name "Org PDF")
(tab-bar-switch-to-tab "Org PDF")
(tab-bar-new-tab)
(tab-bar-rename-tab "Org PDF")
(switch-to-buffer "*scratch-org*")
(org-mode)
(my-view-org-pdf)))
(defun my-tab-view-gnuplot ()
(if (tab-bar--tab-index-by-name "Gnuplot IDE")
(tab-bar-switch-to-tab "Gnuplot IDE")
(tab-bar-new-tab)
(tab-bar-rename-tab "Gnuplot IDE")
(switch-to-buffer "*scratch-gnuplot*")
(gnuplot-mode)
(my-view-gnuplot))))
(use-package awesome-tray
:defer 0.2
:config
@@ -170,9 +219,15 @@
`(( ;; views
("" "Custom Views:" "custom views" nil default "" "")
(,(all-the-icons-fileicon "elisp" :height 1.0 :v-adjust -0.1)
"ELisp" "my-view-elisp" (lambda (&rest _) (my-view-elisp)))
"ELisp" "my-view-elisp" (lambda (&rest _) (my-tab-view-elisp)))
(,(all-the-icons-alltheicon "python" :height 1.0 :v-adjust 0.0)
"Python" "my-view-python" (lambda (&rest _) (my-view-python)))
"Python" "my-view-python" (lambda (&rest _) (my-tab-view-python)))
(,(all-the-icons-alltheicon "script" :height 1.0 :v-adjust 0.0)
"Shell" "my-view-shell" (lambda (&rest _) (my-tab-view-shell)))
(,(all-the-icons-octicon "file-media" :height 1.0 :v-adjust 0.0)
"Gnuplot" "my-view-gnuplot" (lambda (&rest _) (my-tab-view-gnuplot)))
(,(all-the-icons-octicon "file-pdf" :height 1.0 :v-adjust 0.0)
"Org PDF" "my-view-org-pdf" (lambda (&rest _) (my-tab-view-org-pdf)))
)
( ;; major modes
("" "Major Modes:" "major modes" nil default "" "")