Skip to content

Instantly share code, notes, and snippets.

@kozikow
Created September 5, 2016 14:08
Show Gist options
  • Save kozikow/1715596372ec34aaa52b66159a691abe to your computer and use it in GitHub Desktop.
Save kozikow/1715596372ec34aaa52b66159a691abe to your computer and use it in GitHub Desktop.
Helm settings emulating intellij
;;;; Helm ;;;;
(require 'helm)
(require 'helm-mode)
;; (require 'helm-config)
(helm-mode 1)
(global-set-key (kbd "M-A") 'helm-M-x)
;; (global-set-key (kbd (ht-get intellij-keymap-ht "GotoAction" "M-A")) 'helm-M-x)
(global-unset-key (kbd "M-1"))
(global-set-key (kbd "M-1") 'helm-find-files)
;; IntelliJ: Main menu -> View -> Recent Files
(global-unset-key (kbd "M-e"))
(global-set-key (kbd "M-e") 'helm-buffers-list)
;; (define-key c-mode-base-map (kbd "M-e") 'helm-buffers-list)
(define-key org-mode-map (kbd "M-e") 'helm-buffers-list)
(advice-add 'helm-buffers-list :after #'cd-to-buffer-directory)
(define-key helm-map (kbd "C-V") 'clipboard-yank)
(global-unset-key (kbd "C-M-s"))
;; (global-set-key (kbd "C-M-s") 'helm-imenu)
(semantic-mode 1)
(global-set-key (kbd "C-M-s") 'helm-semantic-or-imenu)
(global-set-key (kbd "<C-f12>") 'helm-semantic-or-imenu)
(global-unset-key (kbd "M-w"))
(global-set-key (kbd "M-w") 'kill-this-buffer)
(global-set-key (kbd "A-/") 'hippie-expand)
(global-set-key (kbd "s-/") 'hippie-expand)
;; InteliiJ: Main menu -> Navigate-> File
(global-unset-key (kbd "M-N"))
(global-set-key (kbd "M-N") 'helm-projectile-find-file)
;; (advice-add 'helm-projectile-find-file :before #'cd-to-buffer-directory)
(helm-projectile-on)
(setq projectile-completion-system 'helm)
(define-key helm-map (kbd "C-p") 'previous-history-element)
(define-key helm-map (kbd "C-n") 'next-history-element)
;; https://github.com/emacs-helm/helm/blob/master/helm-adaptive.el
;; http://emacs.stackexchange.com/questions/5311/is-there-any-way-to-order-helm-results-by-commonly-used
(global-unset-key (kbd "C-x C-f"))
(global-set-key (kbd "C-x C-f") 'helm-projectile-switch-project)
;; helm-split-window-in-side-p nil ; Use this function to to configure C-M-s.
;; Set on, open, set off.
(global-unset-key (kbd "M-f"))
(global-set-key (kbd "M-f") 'helm-occur)
(global-set-key (kbd "C-h m") 'helm-man-woman)
(global-set-key (kbd "C-h r") 'helm-info-emacs)
(global-set-key (kbd "<A-up>") #'senator-previous-tag)
(global-set-key (kbd "<s-up>") #'senator-previous-tag)
(global-set-key (kbd "<A-down>") #'senator-next-tag)
(global-set-key (kbd "<s-down>") #'senator-next-tag)
;; Resume the last search window. Similar to:
;; IntelliJ: Main Menu -> Window -> Active Tool Window -> Jump to Last Tool Window
(global-set-key (kbd "C-M-w") #'helm-resume)
(global-set-key (kbd "<C-f5>") 'helm-refresh)
;; (setq helm-split-window-in-side-p nil)
(setq helm-split-window-in-side-p t) ; open helm buffer inside current window, not occupy whole other window
(setq helm-move-to-line-cycle-in-source nil) ;; cycle cursor
(define-key helm-map (kbd "C-u") 'helm-previous-page)
(define-key helm-map (kbd "C-d") 'helm-next-page)
(define-key helm-map (kbd "M-C-m") 'helm-ff-run-rename-file)
(define-key helm-map (kbd "<M-backspace>") 'helm-ff-run-delete-file)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment