impor features from emacs-personal
→ https://gitlab.com/heckyel-ng/emacs-personal
This commit is contained in:
parent
e81fd91879
commit
532be54489
@ -1,3 +1,4 @@
|
||||
|
||||
(custom-set-variables
|
||||
;; custom-set-variables was added by Custom.
|
||||
;; If you edit it by hand, you could mess it up, so be careful.
|
||||
@ -10,7 +11,7 @@
|
||||
'(anzu-search-threshold 1000)
|
||||
'(package-selected-packages
|
||||
(quote
|
||||
(markdown-mode sublime-themes sml-modeline smart-mode-line-powerline-theme nlinum flycheck anzu))))
|
||||
(rainbow-mode scss-mode sass-mode less-css-mode ac-php smarty-mode php-mode pkgbuild-mode markdown-mode flycheck anzu sml-modeline smart-mode-line-powerline-theme smart-mode-line nlinum sublime-themes))))
|
||||
(custom-set-faces
|
||||
;; custom-set-faces was added by Custom.
|
||||
;; If you edit it by hand, you could mess it up, so be careful.
|
||||
|
9
init.el
9
init.el
@ -23,6 +23,7 @@
|
||||
;;;------------------------------
|
||||
;;; Features
|
||||
;;;------------------------------
|
||||
(require 'init-security)
|
||||
(require 'init-elpa)
|
||||
;; theme
|
||||
(require 'init-theme)
|
||||
@ -37,6 +38,14 @@
|
||||
(require 'init-flycheck)
|
||||
;; Languages
|
||||
(require 'init-markdown)
|
||||
(require 'init-python)
|
||||
(require 'init-pkgbuild)
|
||||
(require 'init-php)
|
||||
(require 'init-less)
|
||||
(require 'init-sass)
|
||||
(require 'init-scss)
|
||||
;; Plus
|
||||
(require 'init-rainbow)
|
||||
|
||||
;;; Loads custom file
|
||||
(when (file-exists-p custom-file)
|
||||
|
@ -9,6 +9,12 @@
|
||||
;;(when (eval-when-compile (version< "24.4" emacs-version))
|
||||
;; (electric-indent-mode 1))
|
||||
|
||||
;; Active auto-revert-mode that automatically reloads modified files out of Emacs.
|
||||
;; It is very useful to see logs (like auto-revert-tail-mode) among many other cases.
|
||||
(global-auto-revert-mode)
|
||||
(setq global-auto-revert-non-file-buffers t
|
||||
auto-revert-verbose nil)
|
||||
|
||||
;;----------------------------------------------------------------------------
|
||||
;; Show matching parens
|
||||
;;----------------------------------------------------------------------------
|
||||
@ -19,7 +25,6 @@
|
||||
;;----------------------------------------------------------------------------
|
||||
(set-default 'truncate-lines t)
|
||||
(setq show-trailing-whitespace nil)
|
||||
(setq site-lisp-path (file-name-as-directory (expand-file-name "site-lisp/" user-emacs-directory)))
|
||||
|
||||
;;----------------------------------------------------------------------------
|
||||
;; Some basic preferences
|
||||
|
@ -1,2 +1,12 @@
|
||||
(require-package 'flycheck)
|
||||
|
||||
;; Enable for only languages
|
||||
;;(add-hook 'emacs-lisp-mode-hook 'flycheck-mode)
|
||||
(add-hook 'c++-mode-hook 'flycheck-mode)
|
||||
(add-hook 'html-mode-hook 'flycheck-mode)
|
||||
(add-hook 'sh-mode-hook 'flycheck-mode)
|
||||
(add-hook 'js-mode-hook 'flycheck-mode)
|
||||
(add-hook 'php-mode-hook 'flycheck-mode)
|
||||
;; (add-hook 'after-init-hook 'global-flycheck-mode)
|
||||
|
||||
(provide 'init-flycheck)
|
||||
|
@ -8,7 +8,8 @@
|
||||
(tool-bar-mode 0)
|
||||
(set-scroll-bar-mode nil)
|
||||
(menu-bar-mode 0)
|
||||
(setq make-backup-files nil)
|
||||
(setq make-backup-files nil) ; stop creating backup~ files
|
||||
(setq auto-save-default nil) ; stop creating #autosave# files
|
||||
|
||||
;;----------------------------------------------------------------------------
|
||||
;; Editor configuration
|
||||
|
7
lisp/init-less.el
Normal file
7
lisp/init-less.el
Normal file
@ -0,0 +1,7 @@
|
||||
;;----------------------------------------------------------------------------
|
||||
;; Less Mode
|
||||
;;----------------------------------------------------------------------------
|
||||
(require-package 'less-css-mode)
|
||||
(add-to-list 'auto-mode-alist '("\\.less$" . less-css-mode))
|
||||
|
||||
(provide 'init-less)
|
64
lisp/init-php.el
Normal file
64
lisp/init-php.el
Normal file
@ -0,0 +1,64 @@
|
||||
(require-package 'php-mode)
|
||||
|
||||
(require-package 'smarty-mode)
|
||||
|
||||
;; From EmacsWiki: https://www.emacswiki.org/emacs/PhpMode
|
||||
(defun my/php-symbol-lookup ()
|
||||
(interactive)
|
||||
(let ((symbol (symbol-at-point)))
|
||||
(if (not symbol)
|
||||
(message "No symbol at point.")
|
||||
|
||||
(browse-url (concat "https://php.net/manual-lookup.php?pattern="
|
||||
(symbol-name symbol))))))
|
||||
|
||||
|
||||
(defun my/php-function-lookup ()
|
||||
(interactive)
|
||||
(let* ((function (symbol-name (or (symbol-at-point)
|
||||
(error "No function at point."))))
|
||||
(buf (url-retrieve-synchronously (concat "https://php.net/manual-lookup.php?pattern=" function))))
|
||||
(with-current-buffer buf
|
||||
(goto-char (point-min))
|
||||
(let (desc)
|
||||
(when (re-search-forward "<div class=\"methodsynopsis dc-description\">\\(\\(.\\|\n\\)*?\\)</div>" nil t)
|
||||
(setq desc
|
||||
(replace-regexp-in-string
|
||||
" +" " "
|
||||
(replace-regexp-in-string
|
||||
"\n" ""
|
||||
(replace-regexp-in-string "<.*?>" "" (match-string-no-properties 1)))))
|
||||
|
||||
(when (re-search-forward "<p class=\"para rdfs-comment\">\\(\\(.\\|\n\\)*?\\)</p>" nil t)
|
||||
(setq desc
|
||||
(concat desc "\n\n"
|
||||
(replace-regexp-in-string
|
||||
" +" " "
|
||||
(replace-regexp-in-string
|
||||
"\n" ""
|
||||
(replace-regexp-in-string "<.*?>" "" (match-string-no-properties 1))))))))
|
||||
|
||||
(if desc
|
||||
(message desc)
|
||||
(message "Could not extract function info. Press C-F1 to go the description."))))
|
||||
(kill-buffer buf)))
|
||||
|
||||
(require-package 'ac-php)
|
||||
|
||||
(defun my/php-mode-stuff ()
|
||||
(local-set-key (kbd "<f1>") 'my/php-function-lookup)
|
||||
(local-set-key (kbd "C-<f1>") 'my/php-symbol-lookup)
|
||||
;; New versions of PHP have this :)
|
||||
(php-enable-psr2-coding-style)
|
||||
(auto-complete-mode t)
|
||||
(require 'ac-php)
|
||||
(setq ac-sources '(ac-source-dictionary ac-source-abbrev ac-source-php ) )
|
||||
(ac-php-core-eldoc-setup ) ;enable eldoc
|
||||
(define-key php-mode-map (kbd "C-]") 'ac-php-find-symbol-at-point) ;goto define
|
||||
(define-key php-mode-map (kbd "C-t") 'ac-php-location-stack-back) ;go back
|
||||
)
|
||||
|
||||
(add-hook 'php-mode-hook 'my/php-mode-stuff)
|
||||
|
||||
(myemacs/elapsed-time)
|
||||
(provide 'init-php)
|
6
lisp/init-pkgbuild.el
Normal file
6
lisp/init-pkgbuild.el
Normal file
@ -0,0 +1,6 @@
|
||||
(require-package 'pkgbuild-mode)
|
||||
|
||||
(autoload 'pkgbuild-mode "pkgbuild-mode.el" "PKGBUILD mode." t)
|
||||
(setq auto-mode-alist (append '(("/PKGBUILD$" . pkgbuild-mode)) auto-mode-alist))
|
||||
|
||||
(provide 'init-pkgbuild)
|
10
lisp/init-python.el
Normal file
10
lisp/init-python.el
Normal file
@ -0,0 +1,10 @@
|
||||
;;----------------------------------------------------------------------------
|
||||
;; Python Mode
|
||||
;;----------------------------------------------------------------------------
|
||||
(add-hook 'python-mode-hook
|
||||
(lambda ()
|
||||
(setq indent-tabs-mode nil)
|
||||
(setq python-indent-guess-indent-offset nil)
|
||||
(setq python-indent-offset 4)))
|
||||
|
||||
(provide 'init-python)
|
10
lisp/init-rainbow.el
Normal file
10
lisp/init-rainbow.el
Normal file
@ -0,0 +1,10 @@
|
||||
;; rainbow-mode
|
||||
(require-package 'rainbow-mode)
|
||||
(add-hook 'css-mode-hook 'rainbow-mode)
|
||||
(add-hook 'sass-mode-hook 'rainbow-mode)
|
||||
(add-hook 'scss-mode-hook 'rainbow-mode)
|
||||
(add-hook 'less-mode-hook 'rainbow-mode)
|
||||
(add-hook 'web-mode-hook 'rainbow-mode)
|
||||
(add-hook 'html-mode-hook 'rainbow-mode)
|
||||
|
||||
(provide 'init-rainbow)
|
7
lisp/init-sass.el
Normal file
7
lisp/init-sass.el
Normal file
@ -0,0 +1,7 @@
|
||||
;;----------------------------------------------------------------------------
|
||||
;; Sass Mode
|
||||
;;----------------------------------------------------------------------------
|
||||
(require-package 'sass-mode)
|
||||
(add-to-list 'auto-mode-alist '("\\.sass\\'" . sass-mode))
|
||||
|
||||
(provide 'init-sass)
|
8
lisp/init-scss.el
Normal file
8
lisp/init-scss.el
Normal file
@ -0,0 +1,8 @@
|
||||
;;----------------------------------------------------------------------------
|
||||
;; Scss Mode
|
||||
;;----------------------------------------------------------------------------
|
||||
(require-package 'scss-mode)
|
||||
|
||||
(add-to-list 'auto-mode-alist '("\\.scss\\'" . scss-mode))
|
||||
|
||||
(provide 'init-scss)
|
12
lisp/init-security.el
Normal file
12
lisp/init-security.el
Normal file
@ -0,0 +1,12 @@
|
||||
;;----------------------------------------------------------------------------
|
||||
;; Security. Check https://ogbe.net/emacsconfig.html
|
||||
;;----------------------------------------------------------------------------
|
||||
(setq tls-checktrust t)
|
||||
(setq gnutls-verify-error t)
|
||||
(let ((trustfile "/etc/ssl/cert.pem"))
|
||||
(setq tls-program
|
||||
`(,(format "gnutls-cli --x509cafile %s -p %%p %%h" trustfile)
|
||||
,(format "openssl s_client -connect %%h:%%p -CAfile %s -no_ssl2 -ign_eof" trustfile)))
|
||||
(setq gnutls-trustfiles (list trustfile)))
|
||||
|
||||
(provide 'init-security)
|
Loading…
x
Reference in New Issue
Block a user