|
|
@ -1,15 +1,15 @@ |
|
|
* Editing |
|
|
* Editing |
|
|
|
|
|
** IEdit mode |
|
|
|
|
|
#+BEGIN_SRC emacs-lisp |
|
|
|
|
|
(use-package iedit |
|
|
|
|
|
:bind ("C-;" . iedit-mode)) |
|
|
|
|
|
#+END_SRC |
|
|
** Imenu |
|
|
** Imenu |
|
|
#+BEGIN_SRC emacs-lisp |
|
|
#+BEGIN_SRC emacs-lisp |
|
|
(use-package imenu |
|
|
(use-package imenu |
|
|
:bind |
|
|
:bind |
|
|
("C-S-s" . imenu)) |
|
|
("C-S-s" . imenu)) |
|
|
#+END_SRC |
|
|
#+END_SRC |
|
|
** IEdit mode |
|
|
|
|
|
#+BEGIN_SRC emacs-lisp |
|
|
|
|
|
(use-package iedit |
|
|
|
|
|
:bind ("C-;" . iedit-mode)) |
|
|
|
|
|
#+END_SRC |
|
|
|
|
|
** Spellcheck |
|
|
** Spellcheck |
|
|
#+BEGIN_SRC emacs-lisp |
|
|
#+BEGIN_SRC emacs-lisp |
|
|
(global-set-key (kbd "C-!") 'ispell-buffer) |
|
|
(global-set-key (kbd "C-!") 'ispell-buffer) |
|
|
@ -210,7 +210,6 @@ This handy function is a customized ripoff of custom-save-all |
|
|
#+BEGIN_SRC emacs-lisp |
|
|
#+BEGIN_SRC emacs-lisp |
|
|
(use-package autodisass-java-bytecode |
|
|
(use-package autodisass-java-bytecode |
|
|
:defer t) |
|
|
:defer t) |
|
|
|
|
|
|
|
|
(use-package meghanada |
|
|
(use-package meghanada |
|
|
:if (rlbr/high-mem (* 512 1024)) |
|
|
:if (rlbr/high-mem (* 512 1024)) |
|
|
:defer t |
|
|
:defer t |
|
|
@ -220,7 +219,6 @@ This handy function is a customized ripoff of custom-save-all |
|
|
(meghanada-mode t) |
|
|
(meghanada-mode t) |
|
|
(flycheck-mode +1) |
|
|
(flycheck-mode +1) |
|
|
(add-hook 'before-save-hook 'meghanada-code-beautify-before-save))) |
|
|
(add-hook 'before-save-hook 'meghanada-code-beautify-before-save))) |
|
|
|
|
|
|
|
|
:config |
|
|
:config |
|
|
(setq indent-tabs-mode nil) |
|
|
(setq indent-tabs-mode nil) |
|
|
(setq meghanada-server-remote-debug t) |
|
|
(setq meghanada-server-remote-debug t) |
|
|
@ -246,22 +244,18 @@ This handy function is a customized ripoff of custom-save-all |
|
|
" |
|
|
" |
|
|
("f" meghanada-compile-file) |
|
|
("f" meghanada-compile-file) |
|
|
("m" meghanada-restart) |
|
|
("m" meghanada-restart) |
|
|
|
|
|
|
|
|
("c" meghanada-compile-project) |
|
|
("c" meghanada-compile-project) |
|
|
("o" meghanada-optimize-import) |
|
|
("o" meghanada-optimize-import) |
|
|
("s" meghanada-switch-test-case) |
|
|
("s" meghanada-switch-test-case) |
|
|
("v" meghanada-local-variable) |
|
|
("v" meghanada-local-variable) |
|
|
("i" meghanada-import-all) |
|
|
("i" meghanada-import-all) |
|
|
|
|
|
|
|
|
("g" magit-status) |
|
|
("g" magit-status) |
|
|
|
|
|
|
|
|
("t" meghanada-run-task) |
|
|
("t" meghanada-run-task) |
|
|
("T" meghanada-typeinfo) |
|
|
("T" meghanada-typeinfo) |
|
|
("j" meghanada-run-junit-test-case) |
|
|
("j" meghanada-run-junit-test-case) |
|
|
("J" meghanada-run-junit-class) |
|
|
("J" meghanada-run-junit-class) |
|
|
("R" meghanada-run-junit-recent) |
|
|
("R" meghanada-run-junit-recent) |
|
|
("r" meghanada-reference) |
|
|
("r" meghanada-reference) |
|
|
|
|
|
|
|
|
("q" exit) |
|
|
("q" exit) |
|
|
("z" nil "leave")) |
|
|
("z" nil "leave")) |
|
|
:bind |
|
|
:bind |
|
|
@ -363,7 +357,6 @@ put executables in elpy-rpc-venv in path |
|
|
name |
|
|
name |
|
|
(string-join (list name (number-to-string number)) |
|
|
(string-join (list name (number-to-string number)) |
|
|
"~")))) |
|
|
"~")))) |
|
|
|
|
|
|
|
|
(defun rlbr/split-venv-with-number (name-number) |
|
|
(defun rlbr/split-venv-with-number (name-number) |
|
|
"Split a virtualenv name with either a ~ seperating the name and the number, or nothing" |
|
|
"Split a virtualenv name with either a ~ seperating the name and the number, or nothing" |
|
|
(let ((split-result (split-string name-number (regexp-quote "~"))) |
|
|
(let ((split-result (split-string name-number (regexp-quote "~"))) |
|
|
@ -382,7 +375,6 @@ put executables in elpy-rpc-venv in path |
|
|
(car (last split-result))) |
|
|
(car (last split-result))) |
|
|
ret))) |
|
|
ret))) |
|
|
ret)) |
|
|
ret)) |
|
|
|
|
|
|
|
|
(defun rlbr/get-venv-name (&optional library-root) |
|
|
(defun rlbr/get-venv-name (&optional library-root) |
|
|
"Generate venv name based off of the base-name of the library root" |
|
|
"Generate venv name based off of the base-name of the library root" |
|
|
(file-name-base |
|
|
(file-name-base |
|
|
@ -390,7 +382,6 @@ put executables in elpy-rpc-venv in path |
|
|
(if library-root |
|
|
(if library-root |
|
|
library-root |
|
|
library-root |
|
|
(elpy-library-root))))) |
|
|
(elpy-library-root))))) |
|
|
|
|
|
|
|
|
(defun rlbr/handle-name-conflicts (venv-name) |
|
|
(defun rlbr/handle-name-conflicts (venv-name) |
|
|
"Deal with potential name conflicts in venv" |
|
|
"Deal with potential name conflicts in venv" |
|
|
(let ((venv-conflicts) |
|
|
(let ((venv-conflicts) |
|
|
@ -405,7 +396,6 @@ put executables in elpy-rpc-venv in path |
|
|
(when venv-conflicts |
|
|
(when venv-conflicts |
|
|
(setcar venv-partition-name (1+ (apply 'max (mapcar #'car venv-conflicts))))) |
|
|
(setcar venv-partition-name (1+ (apply 'max (mapcar #'car venv-conflicts))))) |
|
|
(rlbr/join-venv-with-number venv-partition-name))) |
|
|
(rlbr/join-venv-with-number venv-partition-name))) |
|
|
|
|
|
|
|
|
(require 'vc) |
|
|
(require 'vc) |
|
|
(defun rlbr/setup-python-venv-dirlocals (&optional library-root venv-name) |
|
|
(defun rlbr/setup-python-venv-dirlocals (&optional library-root venv-name) |
|
|
"Setup .dir-locals file in library root and tell vc system to ignore .dir-locals file" |
|
|
"Setup .dir-locals file in library root and tell vc system to ignore .dir-locals file" |
|
|
@ -428,16 +418,13 @@ put executables in elpy-rpc-venv in path |
|
|
;; Otherwise prompt to ignore |
|
|
;; Otherwise prompt to ignore |
|
|
(when (y-or-n-p (format "Ignore .dir-locals.el in repo '%s' ?" vc-root)) |
|
|
(when (y-or-n-p (format "Ignore .dir-locals.el in repo '%s' ?" vc-root)) |
|
|
(vc-ignore ".dir-locals.el")))))))) |
|
|
(vc-ignore ".dir-locals.el")))))))) |
|
|
|
|
|
|
|
|
(defun rlbr/get-python-executable () |
|
|
(defun rlbr/get-python-executable () |
|
|
(read-file-name "Python interpreter to use: " (file-name-directory (executable-find "python")) |
|
|
(read-file-name "Python interpreter to use: " (file-name-directory (executable-find "python")) |
|
|
nil nil "python")) |
|
|
nil nil "python")) |
|
|
|
|
|
|
|
|
(defun emacs-default-venv () |
|
|
(defun emacs-default-venv () |
|
|
(unless (member "emacs-default-venv" (pyvenv-virtualenv-list)) |
|
|
(unless (member "emacs-default-venv" (pyvenv-virtualenv-list)) |
|
|
(pyvenv-create "emacs-default-venv" (rlbr/get-python-executable))) |
|
|
(pyvenv-create "emacs-default-venv" (rlbr/get-python-executable))) |
|
|
"emacs-default-venv") |
|
|
"emacs-default-venv") |
|
|
|
|
|
|
|
|
(defun rlbr/init-python-venv-in-library-root (&optional library-root) |
|
|
(defun rlbr/init-python-venv-in-library-root (&optional library-root) |
|
|
"Prompt to either create one or use default" (let ((venv-name (rlbr/get-venv-name)) |
|
|
"Prompt to either create one or use default" (let ((venv-name (rlbr/get-venv-name)) |
|
|
(library-root (if library-root library-root (elpy-library-root)))) |
|
|
(library-root (if library-root library-root (elpy-library-root)))) |
|
|
|