diff --git a/emacs/.emacs b/emacs/.emacs index c2abc11..10cebd9 100644 --- a/emacs/.emacs +++ b/emacs/.emacs @@ -58,7 +58,6 @@ (ensure-package-installed 'use-package) - ;; theme (use-package heroku-theme :ensure t) @@ -71,7 +70,9 @@ (use-package evil :ensure t :demand t - :config (evil-mode 1)) + :config + (evil-mode 1) + (setq evil-ex-substitute-global t)) ;; Auto-Complete (use-package auto-complete @@ -127,6 +128,45 @@ (setq-default tab-width 4) (setq-default LateX-indent-level 4) +;; Activate line numbers +(global-linum-mode t) + +;; compilation buffer +; Set buffer scrolling +(setq compilation-scroll-output 'first-error) + +; kill window if successfull +;(defun bury-compile-buffer-if-successful (buffer string) +; "Bury a compilation buffer if succeeded without warnings " +; (when (and +; (buffer-live-p buffer) +; (string-match "compilation" (buffer-name buffer)) +; (string-match "finished" string) +; (not +; (with-current-buffer buffer +; (goto-char (point-min)) +; (search-forward "warning" nil t)))) +; (run-with-timer 1 nil +; (lambda (buf) +; (bury-buffer buf) +; (switch-to-prev-buffer (get-buffer-window buf) 'kill)) +; buffer))) +;(add-hook 'compilation-finish-functions 'bury-compile-buffer-if-successful) +; set window height +(setq compilation-window-height 10) + +(defun my-compilation-hook () + (when (not (get-buffer-window "*compilation*")) + (save-selected-window + (save-excursion + (let* ((w (split-window-vertically)) + (h (window-height w))) + (select-window w) + (switch-to-buffer "*compilation*") + (shrink-window (- h compilation-window-height))))))) +(add-hook 'compilation-mode-hook 'my-compilation-hook) + + ;; Window movement (global-set-key (kbd "C-x ") 'windmove-up) (global-set-key (kbd "C-x ") 'windmove-down) diff --git a/emacs/.emacs.d/snippets/latex-mode/lstinput b/emacs/.emacs.d/snippets/latex-mode/lstinput new file mode 100644 index 0000000..50e9071 --- /dev/null +++ b/emacs/.emacs.d/snippets/latex-mode/lstinput @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: lstinput +# key: lstinput +# -- +\lstinputlisting[$2,label=file:$1]{$1} +$0 diff --git a/emacs/.emacs.d/snippets/latex-mode/verb b/emacs/.emacs.d/snippets/latex-mode/verb new file mode 100644 index 0000000..789d3a7 --- /dev/null +++ b/emacs/.emacs.d/snippets/latex-mode/verb @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: verb +# key: verb +# -- +\verb+$1+ $0 \ No newline at end of file