X-Git-Url: http://47.100.26.94:8080/?a=blobdiff_plain;f=emacs.d%2Fconfig.org;h=a828265c05993f726d99d4983c301db0b0a62f7d;hb=b79d5b8f36d3f645e11aa130e4f85b331bde2d31;hp=e8b7f323a57eb3f254283d03937db2fb6c87dba1;hpb=cab4355b8cc0df6c4691b2b13fdcd831b40d1d8d;p=dotfiles.git diff --git a/emacs.d/config.org b/emacs.d/config.org index e8b7f32..a828265 100644 --- a/emacs.d/config.org +++ b/emacs.d/config.org @@ -729,33 +729,34 @@ let helm windows split inside current window #+END_SRC #+BEGIN_SRC emacs-lisp :tangle yes :results silent + (ivy-set-actions + 'projectile-switch-to-buffer + '(("j" ivy--switch-buffer-other-window-action "other window" ))) + + (ivy-set-actions + t + '(("q" (lambda (x) (ivy-quit-and-run (message "=="))) "exit"))) + (defun sd/swith-buffer-other-window () (interactive) - (ivy-set-action (cond ((eq (ivy-state-caller ivy-last) 'ivy-switch-buffer) - 'ivy--switch-buffer-other-window-action) - ((eq (ivy-state-caller ivy-last) 'counsel-recentf) - 'find-file-other-window) - ((eq (ivy-state-caller ivy-last) 'projectile-find-file) - 'projectile-find-file-other-window) - ((eq (ivy-state-caller ivy-last) 'counsel-projectile-find-file) - 'counsel-projectile-find-file-action-other-window) - (t - nil))) + (ivy-set-action (let ((last (ivy-state-caller ivy-last))) + (cond ((eq last 'ivy-switch-buffer) 'ivy--switch-buffer-other-window-action) + ((eq last 'counsel-recentf) 'find-file-other-window) + ((eq last 'projectile-find-file) 'projectile-find-file-other-window) + ((eq last 'counsel-projectile-find-file) 'counsel-projectile-find-file-action-other-window) + ((eq last 'projectile-switch-to-buffer) 'ivy--switch-buffer-other-window-action) + (t nil)))) (ivy-done) (ivy-shrink-after-dispatching)) (defun sd/exit-ivy-and-swith-to-buffer () "exit ivy complete, and call swith to buffer" (interactive) - (ivy--exhibit) - (ivy-set-action (lambda (buf) - (ivy-switch-buffer))) - (when (ivy-read-action) - (ivy-done)) - (ivy-shrink-after-dispatching)) + (ivy-quit-and-run + (ivy-switch-buffer))) (with-eval-after-load "ivy" - (define-key ivy-minibuffer-map (kbd "C-o") 'ivy-dispatching-done) + ;; (define-key ivy-minibuffer-map (kbd "C-o") 'ivy-dispatching-done) (define-key ivy-minibuffer-map (kbd "C-k") #'sd/swith-buffer-other-window) ;; (define-key ivy-minibuffer-map (kbd "M-o") nil) (define-key ivy-minibuffer-map (kbd "C-o") #'sd/exit-ivy-and-swith-to-buffer)) @@ -3185,45 +3186,8 @@ We can use [[https://www.gnu.org/software/emms/quickstart.html][Emms]] for multi :commands (bing-dict-brief)) #+END_SRC -* Key Bindings -Here are some global key bindings for basic editting -** Global key bingding -#+BEGIN_SRC emacs-lisp :tangle yes :results silent - (global-set-key (kbd "C-h") 'delete-backward-char) - (global-set-key (kbd "s-m") 'man) - (global-set-key (kbd "") 'toggle-frame-fullscreen) - (global-set-key (kbd "s-f") 'projectile-find-file) - (global-set-key (kbd "s-=") 'text-scale-increase) - (global-set-key (kbd "s--") 'text-scale-decrease) -#+END_SRC - -Refer [[https://github.com/fnwiya/dotfiles/blob/c9ca79f1b22c919d9f4c3a0f944ba8281255a594/setup/.emacs.d/loader-init/_90-kill-region-or-backward-kill-word.el][kill-region-or-backward-kill-word]] - -#+BEGIN_SRC emacs-lisp :tangle yes :results silent - (require 'utilities) - (global-set-key (kbd "C-w") 'sd/kill-region-or-backward-kill-word) -#+END_SRC - - -** Esc in minibuffer -Use =ESC= to exit minibuffer. Also I map =Super-h= the same as =C-g= -#+BEGIN_SRC emacs-lisp :tangle yes :results silent - (define-key minibuffer-local-map [escape] 'keyboard-escape-quit) - (define-key minibuffer-local-map [escape] 'keyboard-escape-quit) - (define-key minibuffer-local-ns-map [escape] 'keyboard-escape-quit) - (define-key minibuffer-local-isearch-map [escape] 'keyboard-escape-quit) - (define-key minibuffer-local-completion-map [escape] 'keyboard-escape-quit) - (define-key minibuffer-local-must-match-map [escape] 'keyboard-escape-quit) - (define-key minibuffer-local-must-match-filename-map [escape] 'keyboard-escape-quit) - (define-key minibuffer-local-filename-completion-map [escape] 'keyboard-escape-quit) - (define-key minibuffer-local-filename-must-match-map [escape] 'keyboard-escape-quit) - - ;; Also map s-h same as C-g - (define-key minibuffer-local-map (kbd "s-h") 'keyboard-escape-quit) -#+END_SRC - -** Project operations - =super= -*** Projectile +* Project operations - =super= +** Projectile #+BEGIN_SRC emacs-lisp :tangle yes :results silent (use-package projectile :ensure t @@ -3804,6 +3768,46 @@ Occur search key bindings *** TODO make expand-region hydra work with lispy selected +* Key Bindings +Here are some global key bindings for basic editting +** Global key bingding +#+BEGIN_SRC emacs-lisp :tangle yes :results silent + (global-set-key (kbd "C-h") 'delete-backward-char) + (global-set-key (kbd "s-m") 'man) + (global-set-key (kbd "") 'toggle-frame-fullscreen) + ;; project operation + (global-set-key (kbd "s-p") 'projectile-switch-project) + (global-set-key (kbd "s-p") 'projectile-switch-project) + (global-set-key (kbd "s-f") 'projectile-find-file) + (global-set-key (kbd "s-=") 'text-scale-increase) + (global-set-key (kbd "s--") 'text-scale-decrease) +#+END_SRC + +Refer [[https://github.com/fnwiya/dotfiles/blob/c9ca79f1b22c919d9f4c3a0f944ba8281255a594/setup/.emacs.d/loader-init/_90-kill-region-or-backward-kill-word.el][kill-region-or-backward-kill-word]] + +#+BEGIN_SRC emacs-lisp :tangle yes :results silent + (require 'utilities) + (global-set-key (kbd "C-w") 'sd/kill-region-or-backward-kill-word) +#+END_SRC + + +** Esc in minibuffer +Use =ESC= to exit minibuffer. Also I map =Super-h= the same as =C-g= +#+BEGIN_SRC emacs-lisp :tangle yes :results silent + (define-key minibuffer-local-map [escape] 'keyboard-escape-quit) + (define-key minibuffer-local-map [escape] 'keyboard-escape-quit) + (define-key minibuffer-local-ns-map [escape] 'keyboard-escape-quit) + (define-key minibuffer-local-isearch-map [escape] 'keyboard-escape-quit) + (define-key minibuffer-local-completion-map [escape] 'keyboard-escape-quit) + (define-key minibuffer-local-must-match-map [escape] 'keyboard-escape-quit) + (define-key minibuffer-local-must-match-filename-map [escape] 'keyboard-escape-quit) + (define-key minibuffer-local-filename-completion-map [escape] 'keyboard-escape-quit) + (define-key minibuffer-local-filename-must-match-map [escape] 'keyboard-escape-quit) + + ;; Also map s-h same as C-g + (define-key minibuffer-local-map (kbd "s-h") 'keyboard-escape-quit) +#+END_SRC + * Developing ** perspeen #+BEGIN_SRC emacs-lisp :tangle yes :results silent