updated logo, fixed keybinding errors in config, added screenshot to readme

This commit is contained in:
Abraham Raji 2019-07-24 17:53:55 +05:30
parent 5a7d76b956
commit a7bf56d6d9
3 changed files with 137 additions and 111 deletions

View File

@ -1,6 +1,9 @@
#+STARTUP: showall
* Emacs Setup
Init.el file point to the config.org file. All of the actual
[[Imgur][https://i.imgur.com/vunwoQ7.png]]
All the init.el file does is point to the config.org file. All of the actual
configuration is done in the config.org file. The main purpose of
this is repo is to setup emacs the way I want it on a fresh install.
That being said I hope you find something worthwhile here

View File

@ -91,7 +91,7 @@ This is one of the things people usually want to change right away. Bydefault, E
#+BEGIN_SRC emacs-lisp
(use-package doom-themes
:ensure t)
(load-theme 'doom-peacock t)
(load-theme ' doom-city-lights t)
(setq sml/no-confirm-load-theme t)
; Global settings (defaults)
(setq doom-themes-enable-bold t ; if nil, bold is universally disabled
@ -105,12 +105,48 @@ As you may have seen when you start-up Emacs you are welcomed with a pretty bori
(use-package dashboard
:config
(dashboard-setup-startup-hook)
;;(setq dashboard-startup-banner "~/.emacs.d/img/dashLogo.png")
(setq dashboard-items '((recents . 5)
(projects . 5)))
(page-break-lines-mode -1)
;; configure initial-buffer-choice to show Dashboard in frames created with emacsclient -c
(setq initial-buffer-choice (lambda () (get-buffer "*dashboard*")))
;; To customize which widgets are displayed, you can use the following snippet
(setq dashboard-items '((recents . 10)
(projects . 10)))
;; Set the banner
(setq dashboard-startup-banner "~/.emacs.d/img/dashLogo.png")
(setq dashboard-banner-logo-title "Hey, Abraham!"))
;; Set the title
(setq dashboard-banner-logo-title "Hey, Abraham!")
;; Content is not centered by default. To center, set
(setq dashboard-center-content t)
;; To show navigator below the banner:
(setq dashboard-set-navigator t)
(setq dashboard-set-file-icons t)
;; Format: "(icon title help action face prefix suffix)"
(setq dashboard-navigator-buttons
`(;; line1
((,(all-the-icons-octicon "mark-github" :height 1.1 :v-adjust 0.0)
"Github"
"Browse Github"
(lambda (&rest _) (browse-url "https://github.com/avronr")))
(,(all-the-icons-faicon "gitlab" :height 1.1 :v-adjust 0.0)
"Gitlab"
"Browse Gitlab"
(lambda (&rest _) (browse-url "https://gitlab.com/avronr")))
("" "Homepage" "Show Homepage" (lambda (&rest _)(browse-url "https://avronr.gitlab.io/")))))))
#+END_SRC
* auto-complete
- Lets you use the auto-complete package
#+BEGIN_SRC emacs-lisp
(use-package auto-complete
:ensure t)
(require 'auto-complete)
(require 'auto-complete-config)
(global-auto-complete-mode t)
(add-to-list 'ac-modes 'org-mode)
(ac-config-default)
#+END_SRC
* Web Development
I do quite a bit of web-development and have snippets, automatic indentation and autocompletion is a big help . =web-mode.el= is an autonomous emacs major-mode for editing web templates. It also takes care of basic stuff like syntax highlighting, auto pairing tags, removing white spaces etc. Web-mode is feature rich and as extensible as Emacs itself. For more details visit this [[http://web-mode.org/][link]]
#+BEGIN_SRC emacs-lisp
@ -232,18 +268,92 @@ Unlike autocomplete which suggests words / symbols, snippets are pre-prepared te
(yas-global-mode))
(add-to-list 'auto-mode-alist '("\\.c\\'" . web-mode))
#+END_SRC
* Hydra
This is a package for GNU Emacs that can be used to tie related commands into a family of short bindings with a common prefix - a Hydra.
Imagine that you have bound C-c j and C-c k in your config. You want to call C-c j and C-c k in some (arbitrary) sequence. Hydra allows you to:
- Bind your functions in a way that pressing C-c jjkk3j5k is equivalent to pressing C-c j C-c j C-c k C-c k M-3 C-c j M-5 C-c k. Any key other than j or k exits this state.
* auto-complete
- Lets you use the auto-complete package
#+BEGIN_SRC emacs-lisp
(use-package auto-complete
:ensure t)
(require 'auto-complete)
(require 'auto-complete-config)
(global-auto-complete-mode t)
(add-to-list 'ac-modes 'org-mode)
(ac-config-default)
#+END_SRC
- Assign a custom hint to this group of functions, so that you know immediately after pressing C-c that you can follow up with j or k.
If you want to quickly understand the concept, see [the video demo](https://www.youtube.com/watch?v=_qZliI1BKzI).
#+BEGIN_SRC emacs-lisp
(use-package hydra
:ensure hydra
:init
(global-set-key
(kbd "C-x t")
(defhydra toggle (:color blue)
"toggle"
("a" abbrev-mode "abbrev")
("s" flyspell-mode "flyspell")
("d" toggle-debug-on-error "debug")
("c" fci-mode "fCi")
("f" auto-fill-mode "fill")
("t" toggle-truncate-lines "truncate")
("w" whitespace-mode "whitespace")
("q" nil "cancel")))
(global-set-key
(kbd "C-x j")
(defhydra gotoline
( :pre (linum-mode 1)
:post (linum-mode -1))
"goto"
("t" (lambda () (interactive)(move-to-window-line-top-bottom 0)) "top")
("b" (lambda () (interactive)(move-to-window-line-top-bottom -1)) "bottom")
("m" (lambda () (interactive)(move-to-window-line-top-bottom)) "middle")
("e" (lambda () (interactive)(end-of-buffer)) "end")
("c" recenter-top-bottom "recenter")
("n" next-line "down")
("p" (lambda () (interactive) (forward-line -1)) "up")
("g" goto-line "goto-line")
))
(global-set-key
(kbd "C-c t")
(defhydra hydra-global-org (:color blue)
"Org"
("t" org-timer-start "Start Timer")
("s" org-timer-stop "Stop Timer")
("r" org-timer-set-timer "Set Timer") ; This one requires you be in an orgmode doc, as it sets the timer for the header
("p" org-timer "Print Timer") ; output timer value to buffer
("w" (org-clock-in '(4)) "Clock-In") ; used with (org-clock-persistence-insinuate) (setq org-clock-persist t)
("o" org-clock-out "Clock-Out") ; you might also want (setq org-log-note-clock-out t)
("j" org-clock-goto "Clock Goto") ; global visit the clocked task
("c" org-capture "Capture") ; Don't forget to define the captures you want http://orgmode.org/manual/Capture.html
("l" (or )rg-capture-goto-last-stored "Last Capture"))
))
(defhydra hydra-multiple-cursors (:hint nil)
"
Up^^ Down^^ Miscellaneous % 2(mc/num-cursors) cursor%s(if (> (mc/num-cursors) 1) \"s\" \"\")
------------------------------------------------------------------
[_p_] Next [_n_] Next [_l_] Edit lines [_0_] Insert numbers
[_P_] Skip [_N_] Skip [_a_] Mark all [_A_] Insert letters
[_M-p_] Unmark [_M-n_] Unmark [_s_] Search
[Click] Cursor at point [_q_] Quit"
("l" mc/edit-lines :exit t)
("a" mc/mark-all-like-this :exit t)
("n" mc/mark-next-like-this)
("N" mc/skip-to-next-like-this)
("M-n" mc/unmark-next-like-this)
("p" mc/mark-previous-like-this)
("P" mc/skip-to-previous-like-this)
("M-p" mc/unmark-previous-like-this)
("s" mc/mark-all-in-region-regexp :exit t)
("0" mc/insert-numbers :exit t)
("A" mc/insert-letters :exit t)
("<mouse-1>" mc/add-cursor-on-click)
;; Help with click recognition in this hydra
("<down-mouse-1>" ignore)
("<drag-mouse-1>" ignore)
("q" nil)
("<mouse-1>" mc/add-cursor-on-click)
("<down-mouse-1>" ignore)
("<drag-mouse-1>" ignore))
#+END_SRC
* lorem Ipsum
Inserts lorem ipsum text in your emacs buffer. This text has been used since the 16th Century as a dummy text when you are preparing the layout of some presentation but dont have the final text yet, or want to demonstrate the layout without distracting the reader with actual content. The lorem ipsum text originated from “de Finibus Bonorum et Malorum” (The Extremes of Good and Evil) by Marcus Tullius Cicero, written in 45 BC but it has been so transformed along the years that now, it is relatively meaningless.
Three functions are available:
@ -375,92 +485,6 @@ TimeMachine lets us step through the history of a file as recorded in git. Visit
(use-package git-timemachine
:ensure t)
#+END_SRC
* Hydra
This is a package for GNU Emacs that can be used to tie related commands into a family of short bindings with a common prefix - a Hydra.
Imagine that you have bound C-c j and C-c k in your config. You want to call C-c j and C-c k in some (arbitrary) sequence. Hydra allows you to:
- Bind your functions in a way that pressing C-c jjkk3j5k is equivalent to pressing C-c j C-c j C-c k C-c k M-3 C-c j M-5 C-c k. Any key other than j or k exits this state.
- Assign a custom hint to this group of functions, so that you know immediately after pressing C-c that you can follow up with j or k.
If you want to quickly understand the concept, see [the video demo](https://www.youtube.com/watch?v=_qZliI1BKzI).
#+BEGIN_SRC emacs-lisp
(use-package hydra
:ensure hydra
:init
(global-set-key
(kbd "C-x t")
(defhydra toggle (:color blue)
"toggle"
("a" abbrev-mode "abbrev")
("s" flyspell-mode "flyspell")
("d" toggle-debug-on-error "debug")
("c" fci-mode "fCi")
("f" auto-fill-mode "fill")
("t" toggle-truncate-lines "truncate")
("w" whitespace-mode "whitespace")
("q" nil "cancel")))
(global-set-key
(kbd "C-x j")
(defhydra gotoline
( :pre (linum-mode 1)
:post (linum-mode -1))
"goto"
("t" (lambda () (interactive)(move-to-window-line-top-bottom 0)) "top")
("b" (lambda () (interactive)(move-to-window-line-top-bottom -1)) "bottom")
("m" (lambda () (interactive)(move-to-window-line-top-bottom)) "middle")
("e" (lambda () (interactive)(end-of-buffer)) "end")
("c" recenter-top-bottom "recenter")
("n" next-line "down")
("p" (lambda () (interactive) (forward-line -1)) "up")
("g" goto-line "goto-line")
))
(global-set-key
(kbd "C-c t")
(defhydra hydra-global-org (:color blue)
"Org"
("t" org-timer-start "Start Timer")
("s" org-timer-stop "Stop Timer")
("r" org-timer-set-timer "Set Timer") ; This one requires you be in an orgmode doc, as it sets the timer for the header
("p" org-timer "Print Timer") ; output timer value to buffer
("w" (org-clock-in '(4)) "Clock-In") ; used with (org-clock-persistence-insinuate) (setq org-clock-persist t)
("o" org-clock-out "Clock-Out") ; you might also want (setq org-log-note-clock-out t)
("j" org-clock-goto "Clock Goto") ; global visit the clocked task
("c" org-capture "Capture") ; Don't forget to define the captures you want http://orgmode.org/manual/Capture.html
("l" (or )rg-capture-goto-last-stored "Last Capture"))
))
(defhydra hydra-multiple-cursors (:hint nil)
"
Up^^ Down^^ Miscellaneous % 2(mc/num-cursors) cursor%s(if (> (mc/num-cursors) 1) \"s\" \"\")
------------------------------------------------------------------
[_p_] Next [_n_] Next [_l_] Edit lines [_0_] Insert numbers
[_P_] Skip [_N_] Skip [_a_] Mark all [_A_] Insert letters
[_M-p_] Unmark [_M-n_] Unmark [_s_] Search
[Click] Cursor at point [_q_] Quit"
("l" mc/edit-lines :exit t)
("a" mc/mark-all-like-this :exit t)
("n" mc/mark-next-like-this)
("N" mc/skip-to-next-like-this)
("M-n" mc/unmark-next-like-this)
("p" mc/mark-previous-like-this)
("P" mc/skip-to-previous-like-this)
("M-p" mc/unmark-previous-like-this)
("s" mc/mark-all-in-region-regexp :exit t)
("0" mc/insert-numbers :exit t)
("A" mc/insert-letters :exit t)
("<mouse-1>" mc/add-cursor-on-click)
;; Help with click recognition in this hydra
("<down-mouse-1>" ignore)
("<drag-mouse-1>" ignore)
("q" nil)
("<mouse-1>" mc/add-cursor-on-click)
("<down-mouse-1>" ignore)
("<drag-mouse-1>" ignore))
#+END_SRC
* Windmove
Windmove is a library built into GnuEmacs starting with version 21. It lets you move point from window to window using Shift and the arrow keys. This is easier to type than C-x o and, for some users, may be more intuitive.
#+BEGIN_SRC emacs-lisp
@ -547,7 +571,7 @@ This is a habit of mine. Whenever a find some good material on a paricular topic
#+END_SRC
- Setting keybinding for eshell
#+BEGIN_SRC emacs-lisp
(global-set-key (kbd "C-x e") 'eshell)
(global-set-key (kbd "C-c s") 'eshell)
#+END_SRC
* Parentheses
- When programming I like my editor to try to help me with keeping parentheses balanced.
@ -716,12 +740,9 @@ Asterisk can be boring to look at.
#+END_SRC
- Fancy Font
#+BEGIN_SRC emacs-lisp
;; Set default Font
(setq-default dotspacemacs-default-font '("Liberation Mono"
:size 12
:weight normal
:width normal
:powerline-scale 1.1))
;; set a default font
(when (member "Liberation Mono" (font-family-list))
(set-face-attribute 'default nil :font "Liberation Mono"))
#+END_SRC
* Org-mode
@ -876,7 +897,6 @@ Flashes the cursor's line when you scroll
)
#+END_SRC
* Cursor position
Show the current line and column for your cursor.
We are not going to have =relative-linum-mode= in every major mode, so this is useful.
@ -955,3 +975,6 @@ Sometimes I use kivy.
#+BEGIN_SRC emacs-lisp
(add-hook 'python-mode-hook 'flycheck-mode)
#+END_SRC

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.7 KiB

After

Width:  |  Height:  |  Size: 31 KiB