Skip to content

Commit

Permalink
dimanche 13 septembre (13/09/2020)
Browse files Browse the repository at this point in the history
  • Loading branch information
abgruszecki committed Sep 13, 2020
1 parent a241276 commit 4018009
Show file tree
Hide file tree
Showing 7 changed files with 104 additions and 12 deletions.
14 changes: 9 additions & 5 deletions bespoke-org-roam/packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@

(defconst bespoke-org-roam-packages
'(org-roam
org-roam-bibtex)
org-roam-bibtex
)
"The list of Lisp packages required by the bespoke-org-roam layer.
Each entry is either:
Expand Down Expand Up @@ -76,7 +77,8 @@ Each entry is either:
((kbd "<tab>") . org-roam)
((kbd "i") . org-roam-insert)
)
(spacemacs/set-leader-keys "<f2>" my-spacemacs/org-roam-prefix-map))
(spacemacs/set-leader-keys "<f2>" my-spacemacs/org-roam-prefix-map)
(spacemacs|hide-lighter org-roam-mode))

(add-to-list 'org-roam-capture-templates
'("z" "zasób" plain #'org-roam-capture--get-point "%?"
Expand All @@ -95,14 +97,16 @@ Each entry is either:
:file-name "%<%Y%m%d%H%M%S>-${slug}"
:head "#+title: ${title}\n#+roam_key:\n#+roam_tags: @zasób\n"
:unnarrowed t))

(org-roam-mode)
)

(defun bespoke-org-roam/init-org-roam-bibtex ()
(use-package org-roam-bibtex
:after org-roam
:hook (org-roam-mode . org-roam-bibtex-mode))
:hook (org-roam-mode . org-roam-bibtex-mode)
:config
(spacemacs|hide-lighter org-roam-bibtex-mode))

(org-roam-mode)
)

;;; packages.el ends here
42 changes: 42 additions & 0 deletions bespoke-scala-mode/funcs.el
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
;; Automatically insert asterisk in a comment when enabled
(defun my-scala/newline-and-indent-with-asterisk ()
(interactive)
(newline-and-indent)
(scala-indent:insert-asterisk-on-multiline-comment))

(defun my-scala/scala-join-line ()
"Adapt `scala-indent:join-line' to behave more like evil's line join.
`scala-indent:join-line' acts like the vanilla `join-line',
joining the current line with the previous one. The vimmy way is
to join the current line with the next.
Try to move to the subsequent line and then join. Then manually move
point to the position of the join."
(interactive)
(let (join-pos)
(save-excursion
(goto-char (line-end-position))
(unless (eobp)
(forward-line)
(call-interactively 'scala-indent:join-line)
(setq join-pos (point))))

(when join-pos
(goto-char join-pos))))

(defun my-scala/toggle-indent ()
(interactive)
(when (eq major-mode 'scala-mode)
(if (eq indent-line-function #'indent-relative)
(progn
(message "Toggle indent: Scala indent")
(setq indent-line-function #'scala-indent:indent-line))

(message "Toggle indent: relative to previous line")
(setq indent-line-function #'indent-relative))))

(defun my-sbt/sbt-do-reload ()
"Execute the sbt `reload' command for the project."
(interactive)
(sbt:command "reload"))
41 changes: 39 additions & 2 deletions bespoke-scala-mode/packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,51 @@

(defconst bespoke-scala-mode-packages
'(
sbt-mode
(scala-mode :location local)
))

(defun bespoke-scala-mode/init-sbt-mode ()
(use-package sbt-mode
:defer t
:config
;; WORKAROUND: https://github.com/ensime/emacs-sbt-mode/issues/31
;; allows for using SPACE in the minibuffer
(substitute-key-definition
'minibuffer-complete-word
'self-insert-command
minibuffer-local-completion-map)
;; sbt-supershell kills sbt-mode: https://github.com/hvesalai/emacs-sbt-mode/issues/152
(setq sbt:program-options '("-Dsbt.supershell=false"))
:init
(progn
(spacemacs/declare-prefix-for-mode 'scala-mode "mb" "sbt")
(spacemacs/declare-prefix-for-mode 'scala-mode "mg" "goto")
(spacemacs/set-leader-keys-for-major-mode 'scala-mode
"b." #'sbt-hydra
"bb" #'sbt-command
"bC" #'sbt-do-clean
"bc" #'sbt-do-compile
"bt" #'sbt-do-test
"br" #'sbt-do-run
"bR" #'my-sbt/sbt-do-reload
))))

(defun bespoke-scala-mode/init-scala-mode ()
(use-package scala-mode
:defer t
:commands
(scala-mode))
:commands (scala-mode)
:config
(progn
(evil-define-key 'insert scala-mode-map
(kbd "RET") #'my-scala/newline-and-indent-with-asterisk)
(evil-define-key 'normal scala-mode-map
"J" #'my-scala/scala-join-line)
(spacemacs/set-leader-keys-for-major-mode 'scala-mode
"T TAB" #'my-scala/toggle-indent)
)

)

(progn
(add-to-list 'auto-mode-alist
Expand Down
4 changes: 0 additions & 4 deletions bespoke/packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,4 @@ Each entry is either:
(spacemacs|hide-lighter evil-org-mode))
)

(defun bespoke/pre-init-scala-mode ()
)


;;; packages.el ends here
2 changes: 1 addition & 1 deletion local/om
Submodule om updated from 5b3d6f to 1a60e4
7 changes: 7 additions & 0 deletions snippets/sh-mode/find0
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# -*- mode: snippet -*-
#name : find0
#key : find0
#contributor : Aleksander Boruch-Gruszecki
# --

find $1 -print0 $0
6 changes: 6 additions & 0 deletions snippets/sh-mode/read0
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# -*- mode: snippet -*-
#name : read0
#key : read0
#contributor : Aleksander Boruch-Gruszecki
# --
read -d '' -r $0

0 comments on commit 4018009

Please sign in to comment.