- Install ctags-exuberant
- add stuff as listed in http://leonard.io/blog/2013/04/editing-scala-with-vim/ to ~/.ctags
- Install gnu global
- brew install global --with-exuberant-ctags
- add following line in bash export GTAGSCONF=/usr/local/share/gtags/gtags.conf
- edit gtags.conf, in the exuberant-ctags section, add following line :langmap=Scala:.scala:\
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function usage() { | |
cat <<EOF | |
Usage: $(basename $0) [-h|--help] | |
Description: | |
Install tensorflow, tensorflow-text and tf-models-official on macos. | |
Notice tensorflow-addon is deprecated: https://github.com/tensorflow/addons/issues/2807 | |
-h Show help. | |
-v Show tf versions. | |
EOF | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(require 'repeat) | |
(defun make-repeatable-command (cmd) | |
"Returns a new command that is a repeatable version of CMD. | |
The new command is named CMD-repeat. CMD should be a quoted | |
command. | |
This allows you to bind the command to a compound keystroke and | |
repeat it with just the final key. For example: | |
(global-set-key (kbd \"C-c a\") (make-repeatable-command 'foo)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(setq scifi-font-lock-keywords | |
'( | |
("library(name\\(\s?\\)=\\(\s?\\)['\"]\\([^']+\\)" (3 font-lock-keyword-face)) ;target name | |
("pants('\\([^']*\\)'" (1 font-lock-keyword-face t)) | |
) | |
) | |
(defvar scifi-mode-hook nil "* pants mode.") | |
(defun scifi-mode () "scifi" | |
(interactive) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. create ~/.ctags as follows(notice for regexps I used ^[ \t] to excactly match): | |
--langdef=Scala | |
--langmap=Scala:.scala | |
--regex-Scala=/^[ \t]*class[ \t]*([a-zA-Z0-9_]+)/class \1/c,classes/ | |
--regex-Scala=/^[ \t]*object[ \t]*([a-zA-Z0-9_]+)/object \1/o,objects/ | |
--regex-scala=/^[ \t]*trait[ \t]*([a-zA-Z0-9_]+)/trait \1/t,traits/ | |
--regex-Scala=/^[ \t]*case[ \t]*class[ \t]*([a-zA-Z0-9_]+)/case class \1/m,case-classes/ | |
--regex-Scala=/^[ \t]*abstract[ \t]*class[ \t]*([a-zA-Z0-9_]+)/abstract class \1/a,abstract-classes/ | |
--regex-Scala=/^[^\*\/]*def[ \t]*([a-zA-Z0-9_]+)[ \t]*.*[:=]/f \1/f,functions/ | |
#--regex-Scala=/^[^\*\/]*val[ \t]*([a-zA-Z0-9_]+)[ \t]*[:=]/\1/V,values/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun go-to-speedbar () | |
(interactive) | |
(let ((f-name (buffer-name))) | |
(sr-speedbar-open) | |
(sr-speedbar-select-window) | |
(goto-line 1) | |
(search-forward-regexp (concat f-name "$")) | |
(speedbar-expand-line) | |
)) | |
(global-set-key "\C-cs" 'go-to-speedbar) |