【问题标题】:Must have Emacs extensions?必须有 Emacs 扩展?
【发布时间】:2010-09-29 17:24:46
【问题描述】:

我正在尝试http://emacspeak.sourceforge.net,因为它已经在 Windows 上运行。我想使用 emacs 而不是纯文本编辑器,并且想知道每个人都离不开哪些扩展/包?我使用最多的语言是 Perl、Java 和一些 C/C++。

【问题讨论】:

    标签: emacs emacspeak


    【解决方案1】:

    EMACS Starter Kit 中有一个非常棒的初始设置。如果您喜欢使用纯文本,请查看Org-Mode。无论如何,探索EMACS Wiki

    【讨论】:

      【解决方案2】:

      我喜欢color theme,当然还有我使用的语言的模式。

      【讨论】:

      • 我也使用了一段时间的颜色主题——但在 cperl 模式下发现了一些奇怪的减速。关闭颜色主题就摆脱了它(可能是一些复杂的第三方交互;谁知道呢!)。
      【解决方案3】:

      我喜欢能够让我的编辑器完全按照我的意愿行事。因此,我编写了一堆软件包来将事情调整到离他们生命不远的地方。我将在帖子底部列出一些。没有我将无法生活的标准套餐包括:

      • gnus
      • tnt - AOL IM 客户端(我帮助维护)
      • 胡言乱语
      • git-emacs
      • 驼色
      • swbuff(和我的 swbuff-advice 扩展)
      • 干了

      以下是我写的一些我永远无法没有的东西(这就是我写它们的原因):

      • whole-line-or-region - 未定义区域时剪切并粘贴整行
      • cua-lite - 轻量级 CUA 包
      • dired-single - 将 dired 限制为一个可重复使用的缓冲区
      • 流浪汉 - 流浪汉替代品,还没有准备好迎接黄金时段

      此外,正如 Charlie 所提到的,只要您感到无聊,就可以仔细阅读 EmacsWiki。你总能找到新的尝试。我阅读了 gnu.emacs.sources 以了解人们必须提供的最新和最棒的内容。

      【讨论】:

        【解决方案4】:

        我过大的 .emacs 文件中的一些位:

        (setq inhibit-startup-message t)
        
        ;; window maximized
        (when (fboundp 'w32-send-sys-command)
         (w32-send-sys-command #xf030))
        
        ;; http://www.emacswiki.org/cgi-bin/wiki/DiredPlus
        (load "dired+")
        (load "w32-browser") ;; open file on current line (etc.)
        
        ;; dired stuff to open files a la Windows from Howard Melman
        (defun dired-execute-file (&optional arg)
          (interactive "P")
          (mapcar #'(lambda (file)
              (w32-shell-execute "open" (convert-standard-filename file)))
                  (dired-get-marked-files nil arg)))
        
        (defun dired-mouse-execute-file (event)
          "In dired, execute the file or goto directory name you click on."
          (interactive "e")
          (set-buffer (window-buffer (posn-window (event-end event))))
          (goto-char (posn-point (event-end event)))
          (if (file-directory-p (dired-get-filename))
              (dired-find-file)
            (dired-execute-file)))
        (global-set-key [?\C-x mouse-2] 'dired-mouse-execute-file)
        
        
        ;; push current-line onto kill-ring
        ;; http://www.dotemacs.de/dotfiles/SteveMolitor.emacs.html
        (defun push-line ()
          "Select current line, push onto kill ring."
          (interactive)
          (save-excursion
            (copy-region-as-kill (re-search-backward "^") (re-search-forward "$"))))
        (global-set-key "\C-cp" 'push-line)
        
        
        ;; default groups for ibuffer
        ;; http://www.shellarchive.co.uk/content/emacs_tips.html#sec17
        (setq ibuffer-saved-filter-groups
              (quote (("default"
                       ("dired" (mode . dired-mode))
                       ("perl" (mode . cperl-mode))
                       ("java" (mode . java-mode))
                       ("planner" (or
                                   (name . "^\\*Calendar\\*$")
                                   (name . "diary")))
                       ("emacs" (or
                     (mode . help-mode)
                     (mode . occur-mode)
                     (mode . Info-mode)
                     (mode . bookmark-bmenu-mode)
                     (name . "^\\*Apropos\\*$")
                     (name . "^.emacs$")
                     (name . "el$")
                                 (name . "^\\*scratch\\*$")
                                 (name . "^\\*Messages\\*$")
                     (name . "^\\*Completions\\*$")))
                   ("vb" (or
                      (mode . visual-basic-mode)
                      (mode . vb-project)))
                   ("BugTracker" (name . ".*btnet.*"))
                       ("gnus" (or
                                (mode . message-mode)
                                (mode . bbdb-mode)
                                (mode . mail-mode)
                                (mode . gnus-group-mode)
                                (mode . gnus-summary-mode)
                                (mode . gnus-article-mode)
                                (name . "^\\.bbdb$")
                                (name . "^\\.newsrc-dribble")))))))
        
        ;; ibuffer, I like my buffers to be grouped
        (add-hook 'ibuffer-mode-hook
                  (lambda ()
                    (ibuffer-switch-to-saved-filter-groups
                     "default")))
        
        
        ;; http://www.emacswiki.org/cgi-bin/wiki/CPerlMode
        ;; http://www.khngai.com/emacs/perl.php
        ;; Use cperl-mode instead of the default perl-mode
        (add-to-list 'auto-mode-alist '("\\.\\([pP][Llm]\\|al\\)\\'" . cperl-mode))
        (add-to-list 'interpreter-mode-alist '("perl" . cperl-mode))
        (add-to-list 'interpreter-mode-alist '("perl5" . cperl-mode))
        (add-to-list 'interpreter-mode-alist '("miniperl" . cperl-mode))
        
        ;; daily-tip (or whenever Emacs is launched)
        ;; http://emacs.wordpress.com/2007/06/21/tip-of-the-day/
        (defun totd ()
          (interactive)
          (random t) ;; seed with time-of-day
          (with-output-to-temp-buffer "*Tip of the day*"
            (let* ((commands (loop for s being the symbols
                                   when (commandp s) collect s))
                   (command (nth (random (length commands)) commands)))
              (princ
               (concat "Your tip for the day is:\n"
                       "========================\n\n"
                       (describe-function command)
                       "\n\nInvoke with:\n\n"
                       (with-temp-buffer
                         (where-is command t)
                         (buffer-string)))))))
        
        ;; swap slashes and backslashes in current line -- useful for converting paths to be Windows-readable
        ;;http://www.xsteve.at/prg/emacs/.emacs.txt
        (defun xsteve-exchange-slash-and-backslash ()
          "Exchanges / with \ and in the current line or in the region when a region-mark is active."
          (interactive)
          (save-match-data
            (save-excursion
              (let ((replace-count 0)
                    (eol-pos (if mark-active (region-end) (progn (end-of-line) (point))))
                    (bol-pos (if mark-active (region-beginning) (progn (beginning-of-line) (point)))))
                (goto-char bol-pos)
                (while (re-search-forward "/\\|\\\\" eol-pos t)
                  (setq replace-count (+ replace-count 1))
                  (cond ((string-equal (match-string 0) "/") (replace-match "\\\\" nil nil))
                        ((string-equal (match-string 0) "\\") (replace-match "/" nil nil)))
                  (message (format "%d changes made." replace-count)))))))
        
        (global-set-key (kbd "M-\\") 'xsteve-exchange-slash-and-backslash)
        

        查看:dotfiles.org/.emacs

        EmacsWiki: Category DotEmacs

        SO: What's in YOUR .emacs?

        上面没有提到的其他一些包: Elscreen - W3m(基于 emacs 的友好文本浏览器)

        【讨论】:

        • 窗口最大化(toggle-frame-maximized),甚至(toggle-frame-fullscreen)
        猜你喜欢
        • 2011-03-02
        • 1970-01-01
        • 1970-01-01
        • 2014-11-24
        • 2012-10-23
        • 2019-10-29
        • 1970-01-01
        • 2011-11-12
        • 1970-01-01
        相关资源
        最近更新 更多