Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (tool-bar-mode 0) ; отключаем тулбар
- (menu-bar-mode 0) ; отключаем строку меню
- (scroll-bar-mode 0) ; отключаем скролы
- (add-to-list 'load-path "~/.emacs.d/")
- (add-to-list 'load-path "~/.emacs.d/themes/")
- (add-to-list 'custom-theme-load-path "~/.emacs.d/themes")
- (setq inhibit-startup-message t
- inhibit-startup-echo-area-message t) ;отключаем стартовый экран
- (cua-mode 1) ; включение более привычных сочетаний клавишь
- (require 'package)
- ;; Задаём список репозиториев.
- (setq package-archives '(;; ("ELPA" . "http://tromey.com/elpa/")
- ;; ("gnu" . "http://elpa.gnu.org/packages/")
- ;; ("marmalade" . "http://marmalade-repo.org/packages/")
- ("MELPA" . "http://melpa.milkbox.net/packages/")))
- (package-initialize)
- ;-----------------------------------------------------------------------------
- (defun reverse-input-method (input-method)
- "Build the reverse mapping of single letters from INPUT-METHOD."
- (interactive
- (list (read-input-method-name "Use input method (default current): ")))
- (if (and input-method (symbolp input-method))
- (setq input-method (symbol-name input-method)))
- (let ((current current-input-method)
- (modifiers '(nil (control) (meta) (control meta))))
- (when input-method
- (activate-input-method input-method))
- (when (and current-input-method quail-keyboard-layout)
- (dolist (map (cdr (quail-map)))
- (let* ((to (car map))
- (from (quail-get-translation
- (cadr map) (char-to-string to) 1)))
- (when (and (characterp from) (characterp to))
- (dolist (mod modifiers)
- (define-key local-function-key-map
- (vector (append mod (list from)))
- (vector (append mod (list to)))))))))
- (when input-method
- (activate-input-method current))))
- (defadvice read-passwd (around my-read-passwd act)
- (let ((local-function-key-map nil))
- ad-do-it))
- (reverse-input-method "russian-computer") ; хоткеи при русской раскладке
- ;;----------------------------------------------------------------------
- ;(setq show-paren-style 'expression) ;подсветка лисп выражений
- (setq make-backup-files nil) ; Don't want any backup files
- (setq auto-save-list-file-name nil) ; Don't want any .saves files
- (setq auto-save-default nil) ; Don't want any auto saving
- ;; номера строк
- ;; http://code.google.com/p/dea/source/browse/trunk/my-lisps/linum%2B.el
- (require 'linum+)
- (setq linum-format "%d")
- (global-linum-mode 1)
- ;; built-in работа с фалами
- (require 'ido)
- (ido-mode t)
- (setq ido-enable-flex-matching t)
- ;; built-in рабоа с буферами
- (require 'bs)
- (setq bs-configurations
- '(("files" "^\\*scratch\\*" nil nil bs-visits-non-file bs-sort-buffer-interns-are-last)))
- (global-set-key (kbd "<f2>") 'bs-show)
- ;; http://www.emacswiki.org/emacs/AutoComplete Автодополнение
- (add-to-list 'load-path "~/.emacs.d/auto-complete")
- (require 'auto-complete-config)
- (ac-config-default)
- (add-to-list 'ac-dictionary-directories "/home/balamyt/.emacs.d/auto-complete/dict")
- (add-to-list 'ac-modes 'web-mode) ;дружим с вебмодом
- ;; http://www.emacswiki.org/emacs/SrSpeedbar браузер файлов
- (require 'sr-speedbar)
- (global-set-key (kbd "<f12>") 'sr-speedbar-toggle)
- ;;Снипеты
- ;; http://www.emacswiki.org/emacs/Yasnippet
- (add-to-list 'load-path "~/.emacs.d/elpa/yasnippet")
- (require 'yasnippet)
- (yas-global-mode 1)
- ;(yas/load-directory "~/.emacs.d/yasnippet/snippets")
- ;; Options -> Set default font
- (add-to-list 'default-frame-alist '(font . "Consolas-11"))
- (set-default-font "Consolas-11")
- ;** Projectile
- ; https://github.com/bbatsov/projectile
- ;
- ; | Combo | Function | Description |
- ; |-----------+----------------------------+----------------------------|
- ; | C-c p f | projectile-find-file | Shows project files |
- ; | C-c p g | projectile-grep | Runs grep on project files |
- ; | C-c p r | projectile-replace | Interactive query replace |
- ; | C-c p R | projectile-regenerate-tags | Regenerates tags |
- ; | C-c p C-h | | Help
- ;** Tags
- (global-set-key (kbd "<f3>") 'visit-tags-table)
- ; закрывание парных кавычек и скобочек
- (require 'autopair)
- (autopair-global-mode)
- ;устанавливаем мод для php
- ;(add-to-list 'auto-mode-alist '("\\.php\\'" . php-mode))
- ;;; Web-mode --------------------------------------------------------
- (require 'web-mode)
- ; с какими файлами ассоциировать web-mode
- (add-to-list 'auto-mode-alist '("\\.erb\\'" . web-mode))
- (add-to-list 'auto-mode-alist '("\\.djhtml\\'" . web-mode))
- (add-to-list 'auto-mode-alist '("\\.html\\'" . web-mode))
- (setq web-mode-engines-alist
- '(("php" . "\\.phtml\\'")
- ; ("php" . "\\.php\\'")
- ("blade" . "\\.blade\\."))
- )
- ; настройка отступов
- (setq web-mode-markup-indent-offset 2)
- (setq web-mode-css-indent-offset 2)
- (setq web-mode-code-indent-offset 2)
- ; сниппеты и автозакрытие парных скобок
- (setq web-mode-extra-snippets '(("erb" . (("name" . ("beg" . "end"))))
- ))
- (setq web-mode-extra-auto-pairs '(("erb" . (("open" "close")))
- ))
- ; подсвечивать текущий элемент
- (setq web-mode-toggle-current-element-highlight t)
- (setq web-mode-enable-current-element-highlight t)
- (set-face-background 'web-mode-current-element-highlight-face "#007")
- ;подсветка текущей строки
- (require 'highlight-current-line)
- (highlight-current-line-on t)
- (set-face-background 'highlight-current-line-face "#1B1B1B")
- ;; автодополение для веб-мода
- (setq web-mode-ac-sources-alist
- '(("css" . (ac-source-words-in-buffer ac-source-css-property))
- ("html" . (ac-source-words-in-buffer ac-source-abbrev))
- ("php" . (ac-source-words-in-buffer
- ac-source-words-in-same-mode-buffers
- ac-source-dictionary))))
- (global-font-lock-mode 1)
- (setq font-lock-maximum-decoration 1)
- ;подсветка синтаксиса
- (set-face-attribute 'web-mode-html-tag-face nil :foreground "#7CFF5D") ; цвет тегов
- (set-face-attribute 'web-mode-doctype-face nil :foreground "#67C66F") ; цвет доктайпа
- (set-face-attribute 'web-mode-html-tag-bracket-face nil :foreground "#1D5382") ; цвет <> у тегов
- (set-face-attribute 'web-mode-html-attr-name-face nil :foreground "#9B0A00") ; цвет имен атрибутов тегов
- (set-face-attribute 'web-mode-html-attr-value-face nil :foreground "#15550B") ; цвет значения атрибутов тегов
- (set-face-attribute 'web-mode-html-attr-equal-face nil :foreground "#9B0A00") ; цвет равно
- (set-face-attribute 'web-mode-html-tag-custom-face nil :foreground "#999") ;
- ;(set-face-attribute 'web-mode-attr-tag-custom-face nil :foreground "#888")
- ;;; JS
- (require 'json-mode)
- (require 'js2-mode)
- ;(require 'ac-js2)
- ;(require 'coffee-mode)
- (require 'tern)
- (require 'tern-auto-complete)
- (add-hook 'js-mode-hook (lambda () (tern-mode t)))
- (eval-after-load 'tern
- '(progn
- (require 'tern-auto-complete)
- (tern-ac-setup)))
- ; хоткеи web-mod
- (global-unset-key (kbd "C-]"))
- (global-set-key (kbd "C-]") 'web-mode-fold-or-unfold) ;сворачивание кода
- (global-set-key (kbd "C-M-v") 'indent-region) ;выравнивание кода
- (global-set-key (kbd "C-M-q") 'kill-buffer-and-window) ;закрыть буфер и окно
- (global-set-key (kbd "C-q") 'kill-buffer) ;закрыть буфер не закрывая окна
- (global-set-key (kbd "C-a") 'mark-whole-buffer) ;выделить все
- ;отключаем стрелочки перевода строчки
- (global-visual-line-mode t)
- (setq longlines-wrap-follows-window-size t)
- (global-set-key [(control meta l)] 'toggle-truncate-lines) ;отключение перевода строки на краю экрана
- ;php yasnipet
- ;(require 'php-auto-yasnippets)
- ; web-mod end-----------------------------------------
- (setq scroll-conservatively 50) ;плавность прокрутки
- (setq scroll-margin 10) ;плавность прокрутки
- ; навигация по проекту
- (require 'projectile)
- ; для нормальной вставвки из других приложений
- (custom-set-variables
- '(interprogram-paste-function (quote x-cut-buffer-or-selection-value) t)
- '(x-select-enable-clipboard t))
- (windmove-default-keybindings 'meta) ;переключение между окнами по мета+стрелки
- (fset 'yes-or-no-p 'y-or-n-p) ;сокращения yes и no
- ; глобальная подсветка
- ;(global-hl-line-mode 1)
- ;(require 'tomorrow-night-paradise-theme)
- ;(load-theme tomorrow-night-paradise t) ; подключаем тему
- ;(require 'evenhold-theme)
- ;(load-theme evenhold t) ; подключаем тему
- (require 'waher-theme)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement