0 évaluation0% ont trouvé ce document utile (0 vote)
12 vues6 pages
Default font is just monaco, so please comment out the following line. Override M-w and C-w keys so that if no region selected, copy the current lin e.
Default font is just monaco, so please comment out the following line. Override M-w and C-w keys so that if no region selected, copy the current lin e.
Droits d'auteur :
Attribution Non-Commercial (BY-NC)
Formats disponibles
Téléchargez comme TXT, PDF, TXT ou lisez en ligne sur Scribd
Default font is just monaco, so please comment out the following line. Override M-w and C-w keys so that if no region selected, copy the current lin e.
Droits d'auteur :
Attribution Non-Commercial (BY-NC)
Formats disponibles
Téléchargez comme TXT, PDF, TXT ou lisez en ligne sur Scribd
(add-to-list 'load-path (expand-file-name "~/.emacs.d/auto-install")) (require 'auto-install) ;(setq auto-install-directory "~/.emacs.d/auto-install/") (add-to-list 'load-path (expand-file-name "~/.emacs.d/php-mode")) (load "~/.emacs.d/php-mode/php-mode.el") (require 'php-mode) ; color theme, a plugin to change the color settings of the editor (add-to-list 'load-path "~/.emacs.d/color-theme/") (require 'color-theme) (eval-after-load "color-theme" '(progn (color-theme-initialize) ; the next line set the color theme to use (color-theme-xemacs))) ; set aspell connector, need aspell to be installed on the system (eval-after-load "ispell" (progn (setq-default ispell-local-dictionary "british" ispell-silently-savep t))) (setq-default ispell-program-name "C:\\Aspell\\bin\\aspell.exe") ; set aspell as checker (require 'ispell) ; load flyspell, a on-the-fly spell checking plugin, requires aspell to function (setq ispell-extra-args '("--sug-mode=ultra")) (setq ispell-process-directory (expand-file-name "~/")) (load "~/.emacs.d/flyspell.el") (autoload 'flyspell-mode "flyspell" "On-the-fly spelling checker." t) (autoload 'flyspell-delay-command "flyspell" "Delay on command." t) (autoload 't ex-mode-flyspell-verify "flyspell" "" t) (add-hook 'LaTeX-mode-hook 'flyspell-mode) (add-hook 'flyspell-mode-hook '(lambda () (local-set-key (kbd "C-x a") 'ispell-word))) ; set smooth scrolling ;; scroll one line at a time (less "jumpy" than defaults) (setq mouse-wheel-scroll-amount '(2 ((shift) . 2))) ;; one line at a time (setq mouse-wheel-progressive-speed nil) ;; don't accelerate scrolling (setq mouse-wheel-follow-mouse 't) ;; scroll window under mouse (setq scroll-step 2) ;; keyboard scroll one line at a time ; setup autocomplete, a plugin to automatically complete the input (add-to-list 'load-path "~/.emacs.d/auto-complete") (require 'auto-complete-config) (add-to-list 'ac-dictionary-directories "~/.emacs.d/auto-complete/ac-dict") (ac-config-default) ; copy word shortcuts (defun get-point (symbol &optional arg) "get the point" (funcall symbol arg) (point) ) (defun copy-thing (begin-of-thing end-of-thing &optional arg) "copy thing between beg & end into kill ring" (let ((beg (get-point begin-of-thing 1)) (end (get-point end-of-thing arg))) (copy-region-as-kill beg end)) ) (defun paste-to-mark(&optional arg) "paste things to mark, or to the prompt in shell-mode" (let ((pasteMe (lambda() (if (string= "shell-mode" major-mode) (progn (goto-char (mark)) (yank) ))))) (if arg (if (= arg 1) nil (funcall pasteMe)) (funcall pasteMe)) )) (defun copy-word (&optional arg) "copy words at the point into kill-ring" (interactive "P") (setq cur_point (point)) (forward-word) (copy-thing 'backward-word 'forward-word arg) (paste-to-mark arg) (goto-char cur_point) ) (defun reverse-mark-word (&optional arg allow-extend) "Set mark ARG words backwards away from point. The place mark goes is the same place \\[forward-word] would move to with the same argument. Interactively, if this command is repeated or (in Transient Mark mode) if the mark is active, it marks the next ARG words after the ones already marked." (interactive "P\np") (cond ((and allow-extend (or (and (eq last-command this-command) (mark t)) (region-active-p))) (setq arg (if arg (prefix-numeric-value arg) (if (< (mark) (point)) -1 1))) (set-mark (save-excursion (goto-char (mark)) (backward-word arg) (point)))) (t (push-mark (save-excursion (backward-word (prefix-numeric-value arg)) (point)) nil t)))) (global-set-key (kbd "C-;") 'mark-word) (global-set-key (kbd "C-:") 'reverse-mark-word) ; select text in quote (defun select-text-in-quote () "Select text between the nearest left and right delimiters. " (interactive) (let (b1 b2) (skip-chars-backward "^<>({[\"¡®") (setq b1 (point)) (skip-chars-forward "^<>)¡±}]\"¡‾") (setq b2 (point)) (set-mark b1) ) ) (global-set-key (kbd "M-*") 'select-text-in-quote) ; select bigger blocks ;; by Nikolaj Schumacher, 2008-10-20. Released under GPL. (defun semnav-up (arg) (interactive "p") (when (nth 3 (syntax-ppss)) (if (> arg 0) (progn (skip-syntax-forward "^\"") (goto-char (1+ (point))) (decf arg)) (skip-syntax-backward "^\"") (goto-char (1- (point))) (incf arg))) (up-list arg)) ;; by Nikolaj Schumacher, 2008-10-20. Released under GPL. (defun extend-selection (arg &optional incremental) "Select the current word. Subsequent calls expands the selection to larger semantic unit." (interactive (list (prefix-numeric-value current-prefix-arg) (or (and transient-mark-mode mark-active) (eq last-command this-command)))) (if incremental (progn (semnav-up (- arg)) (forward-sexp) (mark-sexp -1)) (if (> arg 1) (extend-selection (1- arg) t) (if (looking-at "\\=\\(\\s_\\|\\sw\\)*\\_>") (goto-char (match-end 0)) (unless (memq (char-before) '(?\) ?\")) (forward-sexp))) (mark-sexp -1)))) (global-set-key (kbd "M-8") 'extend-selection) ; darkroom-mode for windows fullscreen, this is for Windows only, please google emacs darkroom-mode for the detailed installation instructions (add-to-list 'load-path "~/.emacs.d/darkroom-mode") (require 'darkroom-mode) (global-set-key (kbd "C-x q") 'darkroom-mode)