emacs - set default window size
[dotfiles.git] / emacs.d / config.org
index f587ecd..d1eff00 100644 (file)
@@ -44,7 +44,7 @@ Set the emacs load path
 
 #+END_SRC       
 
-** General Setting
+** Window Setting
 
 Disable scroll bar, tool-bar and menu-bar
 
@@ -86,6 +86,13 @@ Setting scroll right/left
   ;  (global-set-key (kbd "C-.") 'scoll-right)
 #+END_SRC
 
+Set default window size
+#+BEGIN_SRC emacs-lisp :tangle yes :results silent
+  (setq initial-frame-alist
+        '((width . 120)
+          (height . 50)))
+#+END_SRC
+
 * Package Management Tools
 
 ** Use-package
@@ -727,8 +734,7 @@ Some global bindings on =Super=, on Mac, it is =Command=
 #+END_SRC
 
 ** =M-s= bindings for searching
- use the prefix =M-s= for searching in buffers
-
+use the prefix =M-s= for searching in buffers
 #+BEGIN_SRC emacs-lisp :tangle yes :results silent
   (defun sd/make-keymap (key bindings)
     (setq keymap (make-sparse-keymap))
@@ -741,7 +747,8 @@ Some global bindings on =Super=, on Mac, it is =Command=
                     ("\M-w" . save-buffer)
                     ("e" . revert-buffer)
                     ("s" . isearch-forward-regexp)
-                    ("r" . isearch-backward-regexp)))
+                    ("r" . isearch-backward-regexp)
+                    ("o" . occur)))
 
   ;; (define-key isearch-mode-map (kbd "s") 'isearch-repeat-forward)
   ;; (define-key isearch-mode-map (kbd "r") 'isearch-repeat-forward)
@@ -749,26 +756,10 @@ Some global bindings on =Super=, on Mac, it is =Command=
   (define-key isearch-mode-map (kbd "M-r") 'isearch-repeat-backward)
 
 
-
   (define-key minibuffer-local-map "\M-s" nil)
 
   (set-face-background 'ido-first-match "white")
 
-  (defhydra sd/search-buffer (:color red :columns nil)
-    "M-s"
-    ("w" save-buffer "save" :exit)
-    ("s" isearch-forward-regrexp "search-forward" :exit)
-    ("r" isearch-backward-regrexp "search-backward" :exit)
-    ("s" save-buffer "save" :exit)
-    ("s" save-buffer "save" :exit)
-    ("s" save-buffer "save" :exit)
-    ("s" save-buffer "save" :exit)
-    ("s" save-buffer "save" :exit)
-    ("s" save-buffer "save" :exit)
-    ("s" save-buffer "save" :exit)
-    ("s" save-buffer "save" :exit)
-    ("q" nil "quil")
-    ("f" nil))
 
 
   ;; (global-unset-key (kbd "M-s"))
@@ -802,6 +793,8 @@ Some global bindings on =Super=, on Mac, it is =Command=
 Occur search key bindings
 
 #+BEGIN_SRC emacs-lisp :tangle yes :results silent
+  (add-hook 'occur-hook (lambda () (switch-to-buffer-other-window "*Occur*")))
+  ;; auto select occur window
 
   (define-key occur-mode-map (kbd "C-n")
     (lambda ()
@@ -818,7 +811,6 @@ Occur search key bindings
       (occur-mode-goto-occurrence-other-window)
       (recenter)
       (other-window 1)))
-
 #+END_SRC
 
 
@@ -826,15 +818,6 @@ Occur search key bindings
 
 ** =M-g= as prefix key for launcher
 
-** others
-
-#+BEGIN_SRC emacs-lisp :tangle yes :results silent
-
-
-  ;; C-'    undefined
-  ;; C-.    undefined
-#+END_SRC
-
 * Org-mode Settings
 
 ** Org-mode Basic setting
@@ -887,6 +870,9 @@ use [[https://github.com/sabof/org-bullets][org-bullets]] package to show utf-8
                 (org-bullets-mode t))))
 
   (setq org-bullets-bullet-list '("⦿" "✪" "◉" "○" "►" "◆"))
+
+  ;; increase font size when enter org-src-mode
+  (add-hook 'org-src-mode-hook (lambda () (text-scale-increase 2)))
 #+END_SRC
 
 ** Worf Mode