| At line 1 changed 1 line. |
| aa |
| {{{ |
|
| ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
| ;; Localization |
| ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
|
| (set-language-environment "Czech") |
| (prefer-coding-system 'utf-8) |
| (setq-default ispell-program-name "aspell") |
|
| ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
| ;; The Calendar and the Diary |
| ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
|
| (setq load-path (cons (concat (getenv "WORK_PATH") "/emacs-lisp/emacs-cs-utils") load-path)) |
| (load "emacs-cs-utils-init") |
|
| (if (eq window-system 'w32) |
| (setq file-name-coding-system 'cp1250) |
| (set-keyboard-coding-system 'cp1250) |
| (set-selection-coding-system 'cp1250) |
| (set-clipboard-coding-system 'cp1250) |
| (setq w32-system-coding-system 'cp1250) |
| (setq w32-use-w32-font-dialog nil) ; use the standard font dialog |
| ) |
|
| (if (eq window-system 'x) |
| (progn |
| (setq x-select-enable-clipboard t) |
| (set-selection-coding-system 'utf-8) |
| ) |
| ) |
|
| ;; standardní ovládání |
|
| (global-set-key [insertchar] 'overwrite-mode) |
| (global-set-key [delete] 'delete-char) |
| (global-set-key [home] 'beginning-of-line) |
| (global-set-key [end] 'end-of-line) |
| (global-set-key [prior] 'scroll-down) |
| (global-set-key [next] 'scroll-up) |
| (global-set-key [C-prior] 'beginning-of-buffer) |
| (global-set-key [C-next] 'end-of-buffer) |
| (global-set-key [backspace] 'delete-backward-char) |
| (global-set-key (kbd "C--") 'undo) |
|
| (global-set-key "\C-cg" 'goto-line) |
| (global-set-key [kp-delete] 'delete-char) |
|
| ;; prohodí Enter (RET) a C-j -> Emacs pak po stisku Enteru odsazuje. |
| (global-set-key "\r" 'newline-and-indent) |
| (global-set-key "\C-j" 'newline) |
|
| (show-paren-mode t) ;; any matching parenthesis is highlighted |
| (setq make-backup-files nil) ;; Nemám rád adresáre zaplnené soubory s vlnkou. Stací mi bohate autosave. |
| (setq vc-cvs-stay-local nil) |
| (auto-compression-mode t) ;; Automatic opening of zipped files. |
| (setq visible-bell t) ;; Turn off the bell |
| (setq inhibit-startup-message t) ;; Dont show the GNU splash screen |
| (setq scroll-step 1 ;; FAQ 67: Only scroll one line when moving past screen |
| scroll-conservatively 10000) |
|
| ;; Recursive deletes and copies are allowed without asking. This is DANGEROUS! |
| (setq dired-recursive-deletes 'always |
| dired-recursive-copies 'always) |
|
| (if (fboundp 'menu-bar-mode) (menu-bar-mode -1)) |
| (if (fboundp 'tool-bar-mode) (tool-bar-mode -1)) |
|
| (setq next-line-add-newlines nil) |
| (fset 'yes-or-no-p 'y-or-n-p) ;; Make all "yes or no" prompts show "y or n" instead |
| (setq confirm-kill-emacs 'y-or-n-p) |
|
| (setq default-frame-alist ; spolecne nastaveni |
| (append (list '(foreground-color . "Wheat") |
| '(background-color . "DarkSlateGray") |
| '(border-color . "Orchid") |
| '(mouse-color . "Orchid") |
| '(cursor-color . "Orchid") |
| '(cursor-type . box) |
| '(vertical-scroll-bars . right) ;; scrollbar vpravo |
| ) |
| default-frame-alist) |
| ) |
|
| (cond |
| ((eq window-system 'x) |
| (setq default-frame-alist |
| (append default-frame-alist |
| (list '(width . 108) '(height . 49) '(top . 0) '(left . 0) |
| '(font . "-ADBE-Source Code Pro-normal-normal-normal-*-14-*-*-*-m-0-iso10646-1") |
| )))) |
|
| ((eq window-system 'w32) |
| (setq default-frame-alist |
| (append default-frame-alist |
| (list '(width . 134) '(height . 46) '(top . 1) '(left . 3) |
| '(font . "-outline-Source Code Pro-normal-normal-normal-mono-15-*-*-*-c-*-iso8859-1") |
| )))) |
| ) |
|
| (custom-set-faces |
| ;; ;; custom-set-faces was added by Custom -- don't edit or cut/paste it! |
| ;; ;; Your init file should contain only one such instance. |
| '(default ((t (:foreground "Wheat" :background "DarkSlateGray")))) |
| '(fringe ((t (:foreground "Wheat" :background "DarkSlateGray")))) |
| '(modeline ((t (:foreground "DarkSlateGray" :background "Wheat")))) |
| ) |
|
| (setq-default line-number-mode t ;; show line number |
| column-number-mode t) ;; show column number |
| (setq line-number-display-limit 1000000) |
| (transient-mark-mode t) ;; highlight selected regions |
| (when window-system ;; barevné odlisení syntaxe |
| (global-font-lock-mode t) |
| (setq font-lock-maximum-decoration t) |
| (setq-default font-lock-maximum-size nil) ;; Maximum size of a buffer for buffer fontification. |
| (remove-hook 'font-lock-mode-hook 'turn-on-fast-lock) |
| (remove-hook 'font-lock-mode-hook 'turn-on-lazy-lock)) |
| ;; font-lock-support-mode 'fast-lock-mode)) |
|
| ;(iswitchb-mode) ;; enables switching between buffers using substrings. |
| ;(setq iswitchb-buffer-ignore '("^ " "*scratch*" "*Completions*" "*Help*")) |
|
| ;; The following commands are usually disabled by default. Enable |
| ;; them... |
|
| (put 'eval-expression 'disabled nil) |
| (put 'downcase-region 'disabled nil) ; C-x C-l |
| (put 'upcase-region 'disabled nil) ; C-x C-u |
| (put 'narrow-to-page 'disabled nil) ; C-x n p |
| (put 'narrow-to-region 'disabled nil) ; C-x n n ... (widen) C-x n w |
|
| ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
| ;; klavesove zkratky k souborum |
| ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
|
| (set-register ?e (cons 'file (concat (getenv "WORK_PATH") "/emacs-lisp/.emacs.el"))) |
| ;; (set-register ?c '(file . "~/emacs-lisp/data/cstex.bz2")) |
| (set-register ?b (cons 'file (concat (getenv "WORK_PATH") "/Osobni/bookmark.html"))) |
|
| ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
| ;; local tools |
| ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
|
| ;; convert a buffer from dos ^M end of lines to unix end of lines |
| (defun dos2unix () |
| (interactive) |
| (goto-char (point-min)) |
| (while (search-forward "\r" nil t) (replace-match ""))) |
|
| ;; and vice versa |
| (defun unix2dos () |
| (interactive) |
| (goto-char (point-min)) |
| (while (search-forward "\n" nil t) (replace-match "\r\n"))) |
|
| (defun count-words-buffer () |
| "Count the number of words in current the buffer; |
| print a message in the minibuffer with the result." |
| (interactive) |
| (save-excursion |
| (let ((count 0)) |
| (goto-char (point-min)) |
| (while (< (point) (point-max)) |
| (forward-word 1) |
| (setq count (1+ count))) |
| (message "buffer contains %d words." count)))) |
|
| ;; compute the length of the marked region |
| (defun region-length () |
| "Count the length of the marked region" |
| (interactive) |
| (message (format "%d" (- (region-end) (region-beginning))))) |
|
|
| ;; Select everything |
| (defun select-all () |
| (interactive) |
| (set-mark (point-min)) |
| (goto-char (point-max))) |
|
| (defun insert-date () |
| "Insert date at point." |
| (interactive) |
| (insert (format-time-string "%a %b %e, %Y %l:%M %p"))) |
|
| ;; hodiny |
| (when window-system |
| (setq display-time-string-forms |
| '(dayname " " day "." month ".(" monthname ") " year |
| " " 24-hours ":" minutes ":" seconds (if mail " *Mail*"))) |
| (setq-default mode-line-modified '("%1*%1+")) |
| (setq-default mode-line-buffer-identification '("%24b")) |
| (setq-default mode-line-format |
| '("-" mode-line-mule-info mode-line-modified |
| mode-line-frame-identification |
| mode-line-buffer-identification |
| (-4 . " %p ") |
| (6 . (line-number-mode " %l")) |
| (column-number-mode "C%c ") |
| " %[(" mode-name mode-line-process |
| minor-mode-alist "%n" ")%] ")) |
| (setq-default frame-title-format '("GNU Emacs " emacs-version " " global-mode-string)) |
| (setq-default icon-title-format '("" "%b")) |
| (display-time)) |
|
| ;; fix localization bug |
| (if (eq window-system 'w32) |
| (setq dired-move-to-filename-regexp |
| (let* ((lc "\\(I\\|II\\|III\\|IV\\|V\\|VI\\|VII\\|VIII\\|IX\\|X\\|XI\\|XII\\)") |
| (le "\\(Jan\\|Feb\\|Mar\\|Apr\\|May\\|Jun\\|Jul\\|Aug\\|Sep\\|Oct\\|Nov\\|Dec\\)") |
| (s " ") |
| (yyyy "[0-9][0-9][0-9][0-9]") |
| (dd "[ 0-3][0-9]") |
| (mm "[0-1][0-9]") |
| (HH:MM "[ 0-2][0-9]:[0-5][0-9]") |
| (l "[A-Za-z\xa0-\xff]") |
| ; (czech (concat "\\(" lc "\\|" le "\\)" s dd s "\\(" HH:MM "\\|" s yyyy "\\)"))) |
| (czech (concat dd "." mm "." yyyy s "\\(" HH:MM "\\|" s yyyy "\\)")) |
| (western (concat l l l s dd s "\\(" HH:MM "\\|" s yyyy "\\)")) |
| ; (ftp (concat )) |
| ) |
| (concat s "\\(" czech "\\|" western "\\)" s))) |
| ) |
|
| ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
| ;; Packages |
| ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
|
| (setq load-path (cons (concat (getenv "WORK_PATH") "/emacs-lisp/various") load-path)) |
| (require 'ascii-table) |
| (require 'eperiodic) |
| (require 'setnu) |
| (setq setnu-line-number-format "%4d ") |
| (require 'visual-basic-mode) |
| (setq auto-mode-alist (append '(("\\.\\(frm\\|bas\\|cls\\)$" . visual-basic-mode)) auto-mode-alist)) |
|
|
| (setq bookmark-file (concat (getenv "WORK_PATH") "/emacs-lisp/bookmark.bmk")) |
|
| ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
| ;; Dictionary |
| ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
|
| ;; (custom-set-variables |
| ;; ; '(dictionary-coding-systems-for-dictionaries (quote (("mueller" . koi8-r) ("ancz" . cp1250) ("czan" . iso-8859-2)))) |
| ;; '(dictionary-server "localhost") |
| ;; '(dictionary-port 2628) |
| ;; ) |
|
| ;; (add-to-list 'load-path "~/emacs-lisp/dictionary") |
| ;; (load "dictionary-init") |
| ;; (global-set-key "\C-cn" 'dictionary-search) |
| ;; (global-set-key "\C-cm" 'dictionary-match-words) |
| ;; ;; global dictionary-mode |
| ;; ;(global-dictionary-tooltip-mode) |
| ;; ;; activate for all text-based modes |
| ;; ;(add-hook 'text-mode-hook 'dictionary-tooltip-mode) |
|
| ;; (defun StartDictionaryDaemon () |
| ;; "Starts Dictionary Server (RFC 2229)" |
| ;; (interactive) |
| ;; (start-process "jdictd-cs" "*Messages*" "~/emacs-lisp/dictd/jdictd-cs.bat")) |
|
| ;; (defun StopDictionaryDaemon () |
| ;; "Stops Dictionary Server (RFC 2229)" |
| ;; (interactive) |
| ;; (kill-process "jdictd-cs")) |
|
| ;; (global-set-key "\C-cd" 'StartDictionaryDaemon) |
| ;; (global-set-key "\C-ckd" 'StopDictionaryDaemon) |
|
| ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
| ;; Run Windows application associated with a file. |
| ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
| (cond |
| ((eq window-system `w32) ; Win32 |
|
| (require 'w32-browser) |
| (defun explorer-dired () |
| (interactive) |
| (let ((file-name (dired-get-file-for-visit))) |
| (if (file-exists-p file-name) |
| (w32-shell-execute "open" file-name nil 1)))) |
| ;;; map the "j" key within dired to launch the associated app |
| (eval-after-load "dired" |
| '(define-key dired-mode-map "j" 'explorer-dired) |
| ) |
| ) |
| ) |
|
| ;;;;;;;;;;;;;;;;;;;; |
| ;; (require 'find-this-file) |
| ;;;;;;;;;;;;;;;;;;;; |
|
| ;; (load-file "~/emacs-lisp/various/abook.el") |
|
| (defun maximize-frame (&optional frame) |
| "Maximize the selected FRAME." |
| (interactive) |
| (or frame |
| (setq frame (selected-frame))) |
| (let ((pixels-per-col (/ (float (frame-pixel-width)) |
| (frame-width))) |
| (pixels-per-row (/ (float |
| (frame-pixel-height)) (frame-height)))) |
| (set-frame-size frame |
| ;; truncate or round? |
| (truncate (/ |
| (x-display-pixel-width) pixels-per-col)) |
| ;; reduce size to account for the toolbar |
| (- (truncate (/ |
| (x-display-pixel-height) pixels-per-row)) 1)) |
| (set-frame-position frame 0 0))) |
|
| (global-set-key [f11] 'maximize-frame) |
|
| (add-hook 'dired-mode-hook |
| '(lambda () |
| (local-set-key [C-up] 'dired-up-directory) |
| )) |
|
| (global-set-key [(control x) (k)] 'kill-current-buffer) |
|
| (autoload 'pov-mode "pov-mode" "PoVray scene file mode" t) |
| (add-to-list 'auto-mode-alist '("\\.pov\\'" . pov-mode)) |
| (add-to-list 'auto-mode-alist '("\\.inc\\'" . pov-mode)) |
| (add-hook 'pov-mode-hook |
| (lambda() |
| (local-set-key (kbd "C-M-/") 'pov-complete-word) |
| ) |
| ) |
|
| (add-to-list 'load-path "/usr/share/emacs/site-lisp/") |
| (autoload 'maxima-mode "maxima" "Maxima mode" t) |
| (autoload 'imaxima "imaxima" "Frontend for maxima with Image support" t) |
| (autoload 'maxima "maxima" "Maxima interaction" t) |
| (autoload 'imath-mode "imath" "Imath mode for math formula input" t) |
| (setq imaxima-use-maxima-mode-flag t) |
| (add-to-list 'auto-mode-alist '("\\.ma[cx]" . maxima-mode)) |
| (add-to-list 'auto-mode-alist '("\\.wxm" . maxima-mode)) |
| (add-hook 'maxima-mode-hook |
| (lambda() |
| (local-set-key (kbd "C-M-/") 'maxima-complete) |
| ) |
| ) |
|
| ;; PL/SQL mode |
| (require 'plsql) |
| (setq auto-mode-alist |
| (append '(("\\.pls\\'" . plsql-mode) ("\\.pkg\\'" . plsql-mode) |
| ("\\.pks\\'" . plsql-mode) ("\\.pkb\\'" . plsql-mode) |
| ("\\.sql\\'" . plsql-mode) ("\\.PLS\\'" . plsql-mode) |
| ("\\.PKG\\'" . plsql-mode) ("\\.PKS\\'" . plsql-mode) |
| ("\\.PKB\\'" . plsql-mode) ("\\.SQL\\'" . plsql-mode) |
| ("\\.prc\\'" . plsql-mode) ("\\.fnc\\'" . plsql-mode) |
| ("\\.trg\\'" . plsql-mode) ("\\.vw\\'" . plsql-mode) |
| ("\\.PRC\\'" . plsql-mode) ("\\.FNC\\'" . plsql-mode) |
| ("\\.TRG\\'" . plsql-mode) ("\\.VW\\'" . plsql-mode)) |
| auto-mode-alist )) |
|
| (require 'groovy-mode) |
| (add-to-list 'auto-mode-alist '("\\.groovy$" . groovy-mode)) |
|
| ;; Melpa |
|
| (require 'package) |
| (add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t) |
|
| ;; CNTLM tunnel |
|
| (setq url-proxy-services |
| '(("http" . "127.0.0.1:3128") |
| ("https" . "127.0.0.1:3128"))) |
|
| ;; PlantUML mode for Emacs |
|
| (require 'plantuml-mode) |
| (setq plantuml-jar-path "/home/jirka/apps/PlantUML/plantuml.jar") |
| (setq plantuml-default-exec-mode 'jar) |
| (add-to-list 'auto-mode-alist '("\\.uml\\'" . plantuml-mode)) |
|
| ;; package-install |
| ;; groovy-mode, pov-mode, graphviz-dot-mode, w32-browser, plantuml-mode, confluence |
|
|
| }}} |