Mehr snippets und zeuch für emacs

This commit is contained in:
madmaurice 2017-05-18 20:07:04 +02:00
parent 42ba9e1f08
commit f84cf623d3
3 changed files with 53 additions and 2 deletions

View file

@ -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 <up>") 'windmove-up)
(global-set-key (kbd "C-x <down>") 'windmove-down)

View file

@ -0,0 +1,6 @@
# -*- mode: snippet -*-
# name: lstinput
# key: lstinput
# --
\lstinputlisting[$2,label=file:$1]{$1}
$0

View file

@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: verb
# key: verb
# --
\verb+$1+ $0