[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/scala-mode b8e835f 161/217: scala-mode:goto-start-of-code
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/scala-mode b8e835f 161/217: scala-mode:goto-start-of-code close #90 |
Date: |
Sun, 29 Aug 2021 11:31:04 -0400 (EDT) |
branch: elpa/scala-mode
commit b8e835f41f49ba87ba4046bc2f73a313c9a18273
Author: Sam Halliday <sam.halliday@gmail.com>
Commit: Sam Halliday <sam.halliday@gmail.com>
scala-mode:goto-start-of-code close #90
---
README.md | 11 +++++++++++
scala-mode2.el | 8 ++++++++
2 files changed, 19 insertions(+)
diff --git a/README.md b/README.md
index 3a90d00..a86bd4a 100644
--- a/README.md
+++ b/README.md
@@ -459,6 +459,16 @@ not traversed. scala-mode2's imenu support depends heavily
on the
`scala-syntax:end-of-definition` and `scala-syntax:beginning-of-definition`
functions, and as such, it shares their limitations.
+## Jump to the code
+
+Some people find it useful to add the following function to their
+`scala-mode-hook` as it will jump the package and import boilerplate
+in most files:
+
+```elisp
+(scala-mode:goto-start-of-code)
+```
+
## Other features
- highlights only properly formatted string and character constants
- indenting a code line removes trailing whitespace
@@ -523,3 +533,4 @@ Contributors and valuable feedback:
- Tillmann Rendel
- Jim Powers
- Ivan Malison
+- Sam Halliday
diff --git a/scala-mode2.el b/scala-mode2.el
index 44ab399..8df7f99 100644
--- a/scala-mode2.el
+++ b/scala-mode2.el
@@ -78,6 +78,14 @@ If there is no plausible default, return nil."
forward-sexp-function 'scala-mode:forward-sexp-function))
;;;###autoload
+(defun scala-mode:goto-start-of-code ()
+ "Go to the start of the real code in the file: object, class or trait."
+ (interactive)
+ (let* ((case-fold-search nil))
+ (search-forward-regexp
"\\([[:space:]]+\\|^\\)\\(class\\|object\\|trait\\)" nil t)
+ (move-beginning-of-line nil)))
+
+;;;###autoload
(define-derived-mode scala-mode prog-mode "Scala"
"Major mode for editing scala code.
- [nongnu] elpa/scala-mode 49bd528 045/217: working on README, (continued)
- [nongnu] elpa/scala-mode 49bd528 045/217: working on README, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode d357a77 038/217: New 'scala-indent:align-parameters' customization variable, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode af0e387 053/217: Fixes #18: highlight escapes in strings after chars, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode bc446e7 120/217: sbt support is now in sbt-mode, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 597d421 145/217: Seems the imenu var needs to be set in a very local way., ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode c154f16 139/217: better join-line and fixup-whitespace, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode e277378 143/217: WIP on end-of-defun and beggining of defun which should make writing imenu functionality much easier., ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 811494f 155/217: Support nesting of classes in imenu index creation function., ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode d4885ac 159/217: Use [[:space:]] instead of literal space in syntax end/beggining of, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode c5ab657 160/217: Merge pull request #82 from IvanMalison/support_imenu, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode b8e835f 161/217: scala-mode:goto-start-of-code close #90,
ELPA Syncer <=
- [nongnu] elpa/scala-mode e8c8a51 169/217: Couple imenu-related issues (#95), ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 3989897 174/217: bump version (#111), ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 360b5ba 162/217: Merge pull request #92 from fommil/master, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 387e93c 178/217: revert 618f0fbef4d3d94156f834a66e36c79f07a54e02, fixes #118 (#119), ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode c71efcc 188/217: quoteids are now propertized as symbols (#137), ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 1d08e88 201/217: Merge pull request #154 from pgronkievitz/patch-1, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 265dadc 214/217: fix: `//`-comments filled incorrectly (`//` not acting as prefix), ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode b85fa5e 213/217: Merge pull request #167 from Kazark/trailing-comma, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode 6966328 216/217: Merge pull request #168 from Kazark/slash-slash, ELPA Syncer, 2021/08/29
- [nongnu] elpa/scala-mode e23875e 054/217: Fixed number literals not highlighting after foo_123, ELPA Syncer, 2021/08/29