(defvar files-keymap (make-sparse-keymap "Files")
"Keymap used to globally access file related functions")
(define-key mode-specific-map [?f] files-keymap)
(define-key files-keymap [??] 'describe-prefix-bindings)
(define-key files-keymap [?f] 'find-file-at-point)
(define-key files-keymap [?d] 'find-dired)
(define-key files-keymap [?D] 'find-grep-dired)
(define-key files-keymap [?s] 'grep-find)
(define-key files-keymap [?l] 'find-library)
(define-key files-keymap [?g] 'igrep)
(define-key files-keymap [?G] 'igrep-find)
(eval-after-load "dired"
'(progn
(require 'dired-x)
(require 'dired-sort-map)
(autoload 'wdired-change-to-wdired-mode "wdired")
(add-hook 'dired-load-hook
'(lambda ()
(define-key dired-mode-map "r" 'wdired-change-to-wdired-mode)
(define-key dired-mode-map
[menu-bar immediate wdired-change-to-wdired-mode]
'("Edit File Names" . wdired-change-to-wdired-mode))))))
(require 'crypt++)
(setq crypt-encryption-type 'gpg
crypt-confirm-password t crypt-encryption-file-extension "\\(Secure\\)$\\|\\(\\.enc\\|\\.crypt\\|\\.pgp\\|\\.gpg\\)$")
(crypt-rebuild-tables)
(defun global-change-directory (from to)
"Change directory of all buffers with default-directory FROM to TO."
(interactive "DGlobally change directory from: \nDTo: ")
(let ((bufs (buffer-list))
(from (expand-file-name from)))
(while bufs
(with-current-buffer (car bufs)
(when (equal from (expand-file-name default-directory))
(setq default-directory to)))
(setq bufs (cdr bufs)))))
(autoload 'diff-mode "diff-mode" "Diff major mode" t)
(add-to-list 'auto-mode-alist '("\\.\\(diffs?\\|patch\\|rej\\)\\'" . diff-mode))
(eval-after-load "diff"
'(progn
(require 'diff+)
(setq diff-switches "-u")
(setq diff-command "diff")
(add-hook 'diff-mode-hook (lambda () (font-lock-mode 1)))
))
(setq-default start-command "")
(setq dm-term-command "xterm")
(add-hook 'comint-output-filter-functions 'comint-strip-ctrl-m)
(require 'grep)
(require 'igrep)
(setq grep-find-use-xargs 'gnu
grep-command "grep -ne ")
(require 'ireplace)
(defun isearch-occur ()
"Invoke `occur' from within isearch."
(interactive)
(let ((case-fold-search isearch-case-fold-search))
(occur (if isearch-regexp isearch-string (regexp-quote isearch-string)))))
(define-key isearch-mode-map (kbd "C-o") 'isearch-occur)
(require 'color-occur)
(require 'color-moccur)
(add-hook 'minibuffer-setup-hook
(lambda ()
(when minibuffer-completing-file-name
(local-set-key [(control return)]
'minibuffer-make-directory))))
(defun minibuffer-make-directory ()
"*Create the directory named from the minibuffer contents.
Also create any nonexistent parent directories."
(interactive)
(let* ((file (minibuffer-contents))
(directory (if (equal (file-name-as-directory file) file)
file
(file-name-directory file))))
(make-directory directory t)))
(require 'bs)
(global-set-key (kbd "C-x C-b") 'bs-show)
(add-to-list 'bs-configurations
'("channels" nil nil "^[^#]" nil nil))
(add-to-list 'bs-configurations
'("targets" nil nil nil (lambda (buf)
(with-current-buffer buf
(not (erc-default-target)))) nil))
(add-to-list 'bs-configurations
'("dired" nil nil nil (lambda (buf)
(with-current-buffer buf
(not (eq major-mode 'dired-mode))))
nil))
(add-to-list 'bs-configurations
'("java" nil nil nil (lambda (buf)
(with-current-buffer buf
(not (eq major-mode 'jde-mode))))
nil))
(add-to-list 'bs-configurations
'("xml" nil nil nil (lambda (buf)
(with-current-buffer buf
(not (eq major-mode 'xml-mode))))
nil))
(if (fboundp 'switch-to-other-buffer)
(global-set-key [f2] 'switch-to-other-buffer)
(global-set-key [f2] "\C-xb\C-m")
)
(global-set-key [f12] 'kill-this-buffer)
(global-set-key [(control f12)] 'kill-buffer-and-window)
(global-set-key [(control *)] 'find-tag-at-point)
(autoload 'no-word "no-word" "word to txt")
(add-to-list 'auto-mode-alist '("\\.doc\\'" . no-word))
(setq auto-insert-query nil
auto-insert-directory (expand-file-name "templates/" emacs-init-dir))