Skip to content

Instantly share code, notes, and snippets.

@coderplay
Last active January 21, 2017 18:30
Show Gist options
  • Save coderplay/c48fcf76516b3ff5dcc27dffa1666fd7 to your computer and use it in GitHub Desktop.
Save coderplay/c48fcf76516b3ff5dcc27dffa1666fd7 to your computer and use it in GitHub Desktop.
Intellij Configurations, good for Emacs guys
export PATH=/usr/local/sbin:$PATH
export JAVA_HOME="$(/usr/libexec/java_home -v 1.8)"
# GOLANG
export GOPATH=$HOME/software/gopath
export PATH=$PATH:$GOPATH/bin
# GNU TAR
export PATH=/usr/local/opt/gnu-tar/libexec/gnubin:$PATH
# SDETools
export PATH=/apollo/env/SDETools/bin:$PATH
# AWS
# export AWS_ACCESS_KEY=AKIAJI2KSY323TDJJN7A
# export AWS_SECRET_KEY=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
# Kubernetes
export PATH=$HOME/software/kubernetes/platforms/darwin/amd64:$PATH
export PATH=$HOME/software/activator/bin:$PATH
alias dev="ssh dev-dsk-minzho-2am3-i-52ef1289.us-west-2.amazon.com"
~/.emacs.d/personal/minzhou.el
```lisp
(setq mac-command-modifier 'meta)
(setq mac-option-modifier 'super)
(defun my-flymd-browser-function (url)
(let ((process-environment (browse-url-process-environment)))
(apply 'start-process
(concat "firefox " url)
nil
"/usr/bin/open"
(list "-a" "firefox" url))))
(setq flymd-browser-open-function 'my-flymd-browser-function)
```
~/.emacs.d/personal/init-cua.el
```lisp
(cua-mode t)
(setq cua-auto-tabify-rectangles nil) ;; Don't tabify after rectangle commands
(transient-mark-mode 1) ;; No region when it is not highlighted
(setq cua-keep-region-after-copy t) ;; Standard Windows behaviour
```
~/.emacs.d/personal/init-org.el
```lisp
(require 'org-bullets)
(add-hook 'org-mode-hook (lambda () (org-bullets-mode 1)))
```
~/.emacs.d/personal/init-helm.el
```lisp
(require 'helm-config)
(helm-mode 1)
(global-set-key (kbd "M-x") 'helm-M-x)
(global-set-key (kbd "M-y") 'helm-show-kill-ring)
(global-set-key (kbd "C-x r b") 'helm-filtered-bookmarks)
(global-set-key (kbd "C-x C-f") 'helm-find-files)
(global-set-key (kbd "C-c o") 'helm-occur)
(global-set-key (kbd "C-x b") 'helm-mini)
(global-set-key (kbd "M-/") 'helm-dabbrev)
(global-set-key (kbd "C-o") 'helm-semantic-or-imenu)
(global-set-key (kbd "C-h SPC") 'helm-all-mark-rings)
(global-set-key (kbd "C-c h x") 'helm-register)
(setq helm-buffers-fuzzy-matching t
helm-recentf-fuzzy-match t
helm-semantic-fuzzy-match t
helm-imenu-fuzzy-match t)
(eval-after-load "grep"
'(progn
(add-to-list 'grep-find-ignored-files "GPATH")
(add-to-list 'grep-find-ignored-files "GTAGS")
(add-to-list 'grep-find-ignored-directories "_darcs")))
(when (executable-find "ack")
(setq helm-grep-default-command "ack -Hn --no-group --no-color %e %p %f"
helm-grep-default-recurse-command "ack -H --no-group --no-color %e %p %f"))
(unless (boundp 'completion-in-region-function)
(define-key lisp-interaction-mode-map [remap completion-at-point] 'helm-lisp-completion-at-point)
(define-key emacs-lisp-mode-map [remap completion-at-point] 'helm-lisp-completion-at-point))
```
~/.emacs.d/personal/prelude-modules.el
```lisp
;;; Uncomment the modules you'd like to use and restart Prelude afterwards
;; Emacs IRC client
(require 'prelude-erc)
;; G(require 'prelude-ido) ;; Super charges Emacs completion for C-x C-f and more
(require 'prelude-helm) ;; Interface for narrowing and search
(require 'prelude-helm-everywhere) ;; Enable Helm everywhere
(require 'prelude-company)
;; (require 'prelude-key-chord) ;; Binds useful features to key combinations
;; (require 'prelude-mediawiki)
;; (require 'prelude-evil)
;;; Programming languages support
(require 'prelude-c)
(require 'prelude-clojure)
;; (require 'prelude-coffee)
;; (require 'prelude-common-lisp)
;; (require 'prelude-css)
(require 'prelude-emacs-lisp)
(require 'prelude-erlang)
;; (require 'prelude-elixir)
(require 'prelude-go)
;; (require 'prelude-haskell)
(require 'prelude-js)
;; (require 'prelude-latex)
(require 'prelude-lisp)
;; (require 'prelude-ocaml)
(require 'prelude-org) ;; Org-mode helps you keep TODO lists, notes and more
(require 'prelude-perl)
(require 'prelude-python)
(require 'prelude-ruby)
(require 'prelude-scala)
(require 'prelude-scheme)
(require 'prelude-shell)
;; (require 'prelude-scss)
;; (require 'prelude-web) ;; Emacs mode for web templates
(require 'prelude-xml)
(require 'prelude-yaml)
```
# /Applications/IntelliJ IDEA.app/Contents/bin
-server
-Xms1g
-Xmx4g
-XX:MaxPermSize=512m
-XX:ReservedCodeCacheSize=96m
-XX:+UseCompressedOops
-XX:+DoEscapeAnalysis
-XX:+UnlockExperimentalVMOptions
-XX:LargePageSizeInBytes=256m
-XX:ReservedCodeCacheSize=96m
-XX:+UseCodeCacheFlushing
-XX:ParallelGCThreads=8
-XX:+UseParNewGC
-XX:+UseConcMarkSweepGC
-XX:+DisableExplicitGC
-XX:+ExplicitGCInvokesConcurrent
-XX:+PrintGCDetails
-XX:+PrintFlagsFinal
-XX:+AggressiveOpts
-XX:+HeapDumpOnOutOfMemoryError
-XX:+CMSClassUnloadingEnabled
-XX:+CMSPermGenSweepingEnabled
-XX:CMSInitiatingOccupancyFraction=60
-XX:+CMSClassUnloadingEnabled
-XX:+CMSParallelRemarkEnabled
-XX:+UseAdaptiveGCBoundary
-XX:+UseSplitVerifier
-XX:CompileThreshold=10000
-XX:+UseCompressedStrings
-XX:+OptimizeStringConcat
-XX:+UseStringCache
-XX:+UseFastAccessorMethods
-XX:+UnlockDiagnosticVMOptions

When attach a windows USB keyboard to MacBook. By default MacBook treat WIN key as command, alt as option. But from the layout perspective, they should exchanged.

System Settings -> Keyboard -> Keyboard -> Modifier Keys... -> USB Receiver 
Option Key : Command 
Command Key : Option
<!-- $HOME/Library/Preferences/IntelliJIdea2016.1/keymaps on Mac OSX -->
<keymap version="1" name="MinEmacs" parent="$default">
<action id="$Copy">
<keyboard-shortcut first-keystroke="meta c" />
<keyboard-shortcut first-keystroke="escape" second-keystroke="w" />
</action>
<action id="$Cut">
<keyboard-shortcut first-keystroke="shift delete" />
<keyboard-shortcut first-keystroke="meta x" />
</action>
<action id="$Delete">
<keyboard-shortcut first-keystroke="delete" />
<keyboard-shortcut first-keystroke="ctrl d" />
</action>
<action id="$Paste">
<keyboard-shortcut first-keystroke="meta p" />
<keyboard-shortcut first-keystroke="ctrl y" />
</action>
<action id="$Redo">
<keyboard-shortcut first-keystroke="shift ctrl z" />
<keyboard-shortcut first-keystroke="shift meta minus" />
</action>
<action id="$SelectAll">
<keyboard-shortcut first-keystroke="ctrl x" second-keystroke="h" />
</action>
<action id="$Undo">
<keyboard-shortcut first-keystroke="shift ctrl minus" />
<keyboard-shortcut first-keystroke="ctrl slash" />
</action>
<action id="ActivateDebugToolWindow">
<keyboard-shortcut first-keystroke="meta 5" />
</action>
<action id="ActivateFavoritesToolWindow">
<keyboard-shortcut first-keystroke="meta 2" />
</action>
<action id="ActivateFindToolWindow">
<keyboard-shortcut first-keystroke="meta 3" />
</action>
<action id="ActivateHierarchyToolWindow">
<keyboard-shortcut first-keystroke="meta 8" />
</action>
<action id="ActivateProjectToolWindow">
<keyboard-shortcut first-keystroke="meta 1" />
</action>
<action id="ActivateRunToolWindow">
<keyboard-shortcut first-keystroke="meta 4" />
</action>
<action id="ActivateStructureToolWindow">
<keyboard-shortcut first-keystroke="meta 7" />
</action>
<action id="ActivateTODOToolWindow">
<keyboard-shortcut first-keystroke="meta 6" />
</action>
<action id="ActivateTerminalToolWindow">
<keyboard-shortcut first-keystroke="ctrl x" second-keystroke="meta m" />
</action>
<action id="ActivateVersionControlToolWindow">
<keyboard-shortcut first-keystroke="meta 9" />
<keyboard-shortcut first-keystroke="shift meta 9" />
</action>
<action id="AutoIndentLines">
<keyboard-shortcut first-keystroke="ctrl meta i" />
<keyboard-shortcut first-keystroke="ctrl meta q" />
</action>
<action id="Back">
<mouse-shortcut keystroke="button4" />
<keyboard-shortcut first-keystroke="meta left" />
<keyboard-shortcut first-keystroke="ctrl meta left" />
</action>
<action id="CallHierarchy">
<keyboard-shortcut first-keystroke="ctrl meta h" />
</action>
<action id="CloseAllEditors">
<keyboard-shortcut first-keystroke="ctrl x" second-keystroke="ctrl c" />
</action>
<action id="CloseAllEditorsButActive">
<keyboard-shortcut first-keystroke="ctrl x" second-keystroke="1" />
</action>
<action id="CloseContent">
<keyboard-shortcut first-keystroke="ctrl f4" />
<keyboard-shortcut first-keystroke="ctrl x" second-keystroke="k" />
<keyboard-shortcut first-keystroke="ctrl x" second-keystroke="0" />
</action>
<action id="CodeCompletion">
<keyboard-shortcut first-keystroke="meta slash" />
</action>
<action id="CollapseAllRegions" />
<action id="CommentByLineComment">
<keyboard-shortcut first-keystroke="meta semicolon" />
</action>
<action id="CompileProject">
<keyboard-shortcut first-keystroke="shift meta m" />
</action>
<action id="Console.Execute">
<keyboard-shortcut first-keystroke="enter" />
<keyboard-shortcut first-keystroke="ctrl m" />
</action>
<action id="Console.Execute.Multiline" />
<action id="EditorBackwardParagraph">
<keyboard-shortcut first-keystroke="ctrl up" />
</action>
<action id="EditorChooseLookupItem">
<keyboard-shortcut first-keystroke="enter" />
<keyboard-shortcut first-keystroke="ctrl m" />
</action>
<action id="EditorCodeBlockEnd">
<keyboard-shortcut first-keystroke="ctrl close_bracket" />
<keyboard-shortcut first-keystroke="ctrl meta close_bracket" />
</action>
<action id="EditorCodeBlockStart">
<keyboard-shortcut first-keystroke="ctrl open_bracket" />
<keyboard-shortcut first-keystroke="ctrl meta open_bracket" />
</action>
<action id="EditorCutLineBackward">
<keyboard-shortcut first-keystroke="meta minus" second-keystroke="ctrl k" />
</action>
<action id="EditorCutLineEnd">
<keyboard-shortcut first-keystroke="ctrl k" />
</action>
<action id="EditorDecreaseFontSize">
<keyboard-shortcut first-keystroke="ctrl x" second-keystroke="minus" />
</action>
<action id="EditorDeleteLine" />
<action id="EditorDeleteToWordStart">
<keyboard-shortcut first-keystroke="ctrl back_space" />
<keyboard-shortcut first-keystroke="meta back_space" />
<keyboard-shortcut first-keystroke="escape" second-keystroke="back_space" />
</action>
<action id="EditorDown">
<keyboard-shortcut first-keystroke="down" />
<keyboard-shortcut first-keystroke="ctrl n" />
</action>
<action id="EditorDuplicate">
<keyboard-shortcut first-keystroke="meta d" />
</action>
<action id="EditorEnter">
<keyboard-shortcut first-keystroke="enter" />
<keyboard-shortcut first-keystroke="ctrl m" />
</action>
<action id="EditorEscape">
<keyboard-shortcut first-keystroke="ctrl g" />
<keyboard-shortcut first-keystroke="escape" second-keystroke="escape" />
</action>
<action id="EditorForwardParagraph">
<keyboard-shortcut first-keystroke="ctrl down" />
</action>
<action id="EditorIncreaseFontSize">
<keyboard-shortcut first-keystroke="ctrl x" second-keystroke="equals" />
</action>
<action id="EditorKillRegion">
<keyboard-shortcut first-keystroke="ctrl w" />
</action>
<action id="EditorKillRingSave">
<keyboard-shortcut first-keystroke="meta w" />
</action>
<action id="EditorKillToWordEnd">
<keyboard-shortcut first-keystroke="meta d" />
</action>
<action id="EditorKillToWordStart">
<keyboard-shortcut first-keystroke="meta delete" />
</action>
<action id="EditorLeft">
<keyboard-shortcut first-keystroke="left" />
<keyboard-shortcut first-keystroke="ctrl b" />
</action>
<action id="EditorLineEnd">
<keyboard-shortcut first-keystroke="end" />
<keyboard-shortcut first-keystroke="ctrl e" />
</action>
<action id="EditorLineStart">
<keyboard-shortcut first-keystroke="home" />
<keyboard-shortcut first-keystroke="ctrl a" />
<keyboard-shortcut first-keystroke="meta m" />
</action>
<action id="EditorMoveToPageBottom" />
<action id="EditorMoveToPageTop" />
<action id="EditorNextWord">
<keyboard-shortcut first-keystroke="ctrl right" />
<keyboard-shortcut first-keystroke="meta f" />
<keyboard-shortcut first-keystroke="escape" second-keystroke="ctrl f" />
</action>
<action id="EditorPageDown">
<keyboard-shortcut first-keystroke="ctrl v" />
</action>
<action id="EditorPageUp">
<keyboard-shortcut first-keystroke="page_up" />
<keyboard-shortcut first-keystroke="ctrl z" />
<keyboard-shortcut first-keystroke="meta v" />
</action>
<action id="EditorPreviousWord">
<keyboard-shortcut first-keystroke="ctrl left" />
<keyboard-shortcut first-keystroke="meta b" />
<keyboard-shortcut first-keystroke="escape" second-keystroke="ctrl b" />
</action>
<action id="EditorRight">
<keyboard-shortcut first-keystroke="right" />
<keyboard-shortcut first-keystroke="ctrl f" />
</action>
<action id="EditorScrollDown" />
<action id="EditorScrollToCenter">
<keyboard-shortcut first-keystroke="ctrl l" />
</action>
<action id="EditorScrollUp" />
<action id="EditorSelectWord">
<keyboard-shortcut first-keystroke="ctrl meta w" />
</action>
<action id="EditorSplitLine" />
<action id="EditorSwapSelectionBoundaries">
<keyboard-shortcut first-keystroke="ctrl x" second-keystroke="x" />
</action>
<action id="EditorTab" />
<action id="EditorTextEnd">
<keyboard-shortcut first-keystroke="ctrl x" second-keystroke="close_bracket" />
<keyboard-shortcut first-keystroke="shift meta period" />
</action>
<action id="EditorTextStart">
<keyboard-shortcut first-keystroke="ctrl x" second-keystroke="open_bracket" />
<keyboard-shortcut first-keystroke="shift meta comma" />
</action>
<action id="EditorToggleColumnMode">
<keyboard-shortcut first-keystroke="ctrl enter" />
</action>
<action id="EditorToggleStickySelection">
<keyboard-shortcut first-keystroke="ctrl space" />
<keyboard-shortcut first-keystroke="shift ctrl 2" />
</action>
<action id="EditorUp">
<keyboard-shortcut first-keystroke="up" />
<keyboard-shortcut first-keystroke="ctrl p" />
</action>
<action id="EmacsStyleIndent">
<keyboard-shortcut first-keystroke="tab" />
</action>
<action id="ExportToTextFile" />
<action id="FileStructurePopup">
<keyboard-shortcut first-keystroke="meta o" />
</action>
<action id="Find">
<keyboard-shortcut first-keystroke="ctrl meta s" />
<keyboard-shortcut first-keystroke="meta f3" />
<keyboard-shortcut first-keystroke="ctrl s" />
</action>
<action id="FindNext">
<keyboard-shortcut first-keystroke="f3" />
<keyboard-shortcut first-keystroke="ctrl s" />
</action>
<action id="FindPrevious">
<keyboard-shortcut first-keystroke="shift f3" />
<keyboard-shortcut first-keystroke="ctrl r" />
</action>
<action id="FindUsages">
<keyboard-shortcut first-keystroke="meta f7" />
<keyboard-shortcut first-keystroke="shift meta s" />
</action>
<action id="Forward">
<mouse-shortcut keystroke="button5" />
<keyboard-shortcut first-keystroke="meta right" />
<keyboard-shortcut first-keystroke="ctrl meta right" />
</action>
<action id="GotoChangedFile">
<keyboard-shortcut first-keystroke="shift meta g" />
</action>
<action id="GotoClass">
<keyboard-shortcut first-keystroke="shift meta g" />
</action>
<action id="GotoDeclaration">
<keyboard-shortcut first-keystroke="meta period" />
</action>
<action id="GotoFile">
<keyboard-shortcut first-keystroke="ctrl x" second-keystroke="ctrl f" />
</action>
<action id="GotoImplementation">
<keyboard-shortcut first-keystroke="ctrl t" />
</action>
<action id="GotoLine">
<keyboard-shortcut first-keystroke="meta g" second-keystroke="g" />
</action>
<action id="GotoNextError">
<keyboard-shortcut first-keystroke="f2" />
<keyboard-shortcut first-keystroke="ctrl x" second-keystroke="back_quote" />
</action>
<action id="GotoPreviousError">
<keyboard-shortcut first-keystroke="shift f2" />
<keyboard-shortcut first-keystroke="shift ctrl x" second-keystroke="back_quote" />
</action>
<action id="GotoTypeDeclaration">
<keyboard-shortcut first-keystroke="meta period" />
</action>
<action id="Graph.ZoomIn">
<keyboard-shortcut first-keystroke="add" />
<keyboard-shortcut first-keystroke="equals" />
<keyboard-shortcut first-keystroke="ctrl x" second-keystroke="ctrl equals" />
</action>
<action id="Graph.ZoomOut">
<keyboard-shortcut first-keystroke="subtract" />
<keyboard-shortcut first-keystroke="minus" />
<keyboard-shortcut first-keystroke="ctrl x" second-keystroke="ctrl minus" />
</action>
<action id="IntroduceField" />
<action id="IpnbRunCellInplaceAction" />
<action id="KotlinShellExecute" />
<action id="MethodDown">
<keyboard-shortcut first-keystroke="meta down" />
<keyboard-shortcut first-keystroke="ctrl meta e" />
</action>
<action id="MethodUp">
<keyboard-shortcut first-keystroke="meta up" />
<keyboard-shortcut first-keystroke="ctrl meta a" />
</action>
<action id="NextEditorTab">
<keyboard-shortcut first-keystroke="shift meta right" />
</action>
<action id="NextProjectWindow">
<keyboard-shortcut first-keystroke="ctrl x" second-keystroke="ctrl o" />
</action>
<action id="NextSplitter">
<keyboard-shortcut first-keystroke="ctrl x" second-keystroke="o" />
</action>
<action id="NextTab">
<keyboard-shortcut first-keystroke="ctrl x" second-keystroke="n" />
</action>
<action id="NextTemplateVariable">
<keyboard-shortcut first-keystroke="tab" />
<keyboard-shortcut first-keystroke="enter" />
<keyboard-shortcut first-keystroke="ctrl m" />
</action>
<action id="OptimizeImports">
<keyboard-shortcut first-keystroke="ctrl meta o" />
</action>
<action id="OverrideMethods" />
<action id="ParameterInfo">
<keyboard-shortcut first-keystroke="shift meta p" />
</action>
<action id="PasteMultiple">
<keyboard-shortcut first-keystroke="meta y" />
</action>
<action id="PlaybackLastMacro">
<keyboard-shortcut first-keystroke="ctrl x" second-keystroke="e" />
</action>
<action id="PreviousEditorTab">
<keyboard-shortcut first-keystroke="shift meta left" />
</action>
<action id="PreviousProjectWindow" />
<action id="PreviousTab">
<keyboard-shortcut first-keystroke="ctrl x" second-keystroke="p" />
</action>
<action id="QuickJavaDoc">
<keyboard-shortcut first-keystroke="ctrl q" />
<keyboard-shortcut first-keystroke="ctrl h" second-keystroke="i" />
</action>
<action id="RecentFiles" />
<action id="ReformatCode">
<keyboard-shortcut first-keystroke="ctrl meta back_slash" />
</action>
<action id="ReloadFromDisk">
<keyboard-shortcut first-keystroke="meta u" />
<keyboard-shortcut first-keystroke="escape" second-keystroke="u" />
</action>
<action id="Replace">
<keyboard-shortcut first-keystroke="shift meta 5" />
</action>
<action id="SafeDelete" />
<action id="SaveAll">
<keyboard-shortcut first-keystroke="ctrl x" second-keystroke="ctrl s" />
</action>
<action id="ScalaConsole.Execute" />
<action id="ShowNavBar">
<keyboard-shortcut first-keystroke="meta home" />
</action>
<action id="ShowProjectStructureSettings">
<keyboard-shortcut first-keystroke="shift ctrl meta s" />
</action>
<action id="ShowSettings">
<keyboard-shortcut first-keystroke="ctrl meta s" />
</action>
<action id="SmartTypeCompletion">
<keyboard-shortcut first-keystroke="shift ctrl space" />
<keyboard-shortcut first-keystroke="ctrl meta slash" />
</action>
<action id="SplitHorizontally">
<keyboard-shortcut first-keystroke="ctrl x" second-keystroke="2" />
</action>
<action id="SplitVertically">
<keyboard-shortcut first-keystroke="ctrl x" second-keystroke="3" />
</action>
<action id="StartStopMacroRecording">
<keyboard-shortcut first-keystroke="ctrl x" second-keystroke="shift 9" />
<keyboard-shortcut first-keystroke="ctrl x" second-keystroke="shift 0" />
</action>
<action id="SwitchApply">
<keyboard-shortcut first-keystroke="ctrl alt enter" />
</action>
<action id="SwitchDown">
<keyboard-shortcut first-keystroke="ctrl alt down" />
</action>
<action id="SwitchLeft">
<keyboard-shortcut first-keystroke="ctrl alt left" />
</action>
<action id="SwitchRight">
<keyboard-shortcut first-keystroke="ctrl alt right" />
</action>
<action id="SwitchUp">
<keyboard-shortcut first-keystroke="ctrl alt up" />
</action>
<action id="Switcher">
<keyboard-shortcut first-keystroke="ctrl x" second-keystroke="b" />
</action>
<action id="ToggleBookmark2" />
<action id="TypeHierarchy">
<keyboard-shortcut first-keystroke="ctrl t" />
</action>
<action id="Vcs.ShowMessageHistory" />
<action id="Vcs.UpdateProject" />
<action id="VcsShowNextChangeMarker">
<keyboard-shortcut first-keystroke="shift ctrl meta down" />
</action>
<action id="VcsShowPrevChangeMarker">
<keyboard-shortcut first-keystroke="shift ctrl meta up" />
</action>
<action id="ViewSource" />
<action id="com.vladsch.idea.multimarkdown.editor.actions.styling.ToggleCodeSpanAction" />
</keymap>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment