* Problem: can't indent correct!
@ 2012-11-22 2:33 DongJazz
0 siblings, 0 replies; only message in thread
From: DongJazz @ 2012-11-22 2:33 UTC (permalink / raw)
To: help-gnu-emacs
[-- Attachment #1.1: Type: text/plain, Size: 2457 bytes --]
Hello!
when i use GNU Emacs to edit with php file, the indent style like the screentshot emacs1.png.
I want to the source formated as the sceenshot emacs2.png or emacs3.png.
Can u help me?
Thanks!
attach: The content of .emacs:
(require 'erc)
;;设置tab宽度为4
(setq-default indent-tabs-mode nil)
(setq tab-width 4 c-basic-offset 4)
;;关闭启动画面
(setq inhibit-startup-message t)
;;php-mode安装
;;(add-to-list 'load-path "~/elisp")
(require 'php-mode)
;;autocoplete安装
(add-to-list 'load-path "~/.emacs.d/")
(require 'auto-complete-config)
(add-to-list 'ac-dictionary-directories "~/.emacs.d//ac-dict")
(ac-config-default)(require 'auto-complete)
(require 'auto-complete-config)
(global-auto-complete-mode t)
(setq ac-auto-start 2)
(setq ac-auto-show-menu nil)
(setq ac-dwim nil) ; To get pop-ups with docs even if a word is uniquely completed
;; (setq ac-ignores '("." "=" "@" "[" "]" "(" ")"))
(define-key ac-completing-map (kbd "C-n") 'ac-next)
(define-key ac-completing-map (kbd "C-p") 'ac-previous)
;;----------------------------------------------------------------------------
;; Use Emacs' built-in TAB completion hooks to trigger AC (Emacs >= 23.2)
;;----------------------------------------------------------------------------
(setq tab-always-indent 'complete) ;; use 'complete when auto-complete is disabled
(add-to-list 'completion-styles 'initials t)
;; hook AC into completion-at-point
(defun set-auto-complete-as-completion-at-point-function ()
(setq completion-at-point-functions '(auto-complete)))
(add-hook 'auto-complete-mode-hook 'set-auto-complete-as-completion-at-point-function)
(set-default 'ac-sources
'(ac-source-dictionary
ac-source-words-in-buffer
ac-source-words-in-same-mode-buffers
ac-source-words-in-all-buffer))
(dolist (mode '(magit-log-edit-mode log-edit-mode org-mode text-mode haml-mode
sass-mode yaml-mode csv-mode espresso-mode haskell-mode
html-mode nxml-mode sh-mode smarty-mode clojure-mode
lisp-mode textile-mode markdown-mode tuareg-mode
js3-mode css-mode less-css-mode))
(add-to-list 'ac-modes mode))
;; Exclude very large buffers from dabbrev
(defun sanityinc/dabbrev-friend-buffer (other-buffer)
(< (buffer-size other-buffer) (* 1 1024 1024)))
(setq dabbrev-friend-buffer-function 'sanityinc/dabbrev-friend-buffer)
;;autocomplete安装
[-- Attachment #1.2: Type: text/html, Size: 3518 bytes --]
[-- Attachment #2: emacs1.png --]
[-- Type: image/png, Size: 31921 bytes --]
[-- Attachment #3: emacs2.png --]
[-- Type: image/png, Size: 31842 bytes --]
[-- Attachment #4: emacs3.png --]
[-- Type: image/png, Size: 31827 bytes --]
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2012-11-22 2:33 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-22 2:33 Problem: can't indent correct! DongJazz
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.