Emacs Init.el

Source: Internet
Author: User

;; ----------Package Management (When (>= emacs-major-version -) (Require'Package )(package-Initialize) (Add-to-list'package-archives'("Melpa"."http://melpa.org/packages/") (t)); CL-Common Lisp Extension (Require'cl);; Loop for Common Lisp extension;; Add Packages (DefVar my/packages'(;; ---auto-completion---company ;;---Better Editor---Evil Evil-leader Smooth-scrolling Hungry-Delete swiper counsel Smartparens Popwin;;---Themes---Monokai-theme;;---Window jump--window-numbering)"Default Packages") (setq Package-selected-packages my/packages) (Defun my/packages-installed-p () (Loop forPkginchmy/Packages When ( the package-installed-p pkg)) Do(return nil) finally (return T))) (Unless (My/packages-installed-p) (Message"%s" "Refreshing package Database ...") ( package-refresh-contents) (Dolist (Pkg my/packages) (if ( not) (package-installed-P pkg)) ( Package-InstallPKG))))  (Global-company-mode1) (Add-hook'After-init-hook'global-company-mode) (Setq Company-dabbrev-downcase Nil) (Require'hungry-delete)(global-hungry-delete-mode) (Global-set-key (KBD"m-p")'Ace-window)(Window-numbering-mode1);; ---Leader Key----(Require'Evil-leader)(global-evil-leader-mode) (Evil-leader/set-leader"<SPC>") (Evil-leader/set-Key"<SPC>"  'Counsel-m-x  "FF" 'Find-file  "FS" 'Save-buffer  "RF" 'Recentf-open-files  "BB" 'Switch-to-buffer  "P" 'Scroll-down  "N" 'scroll-up  "BB" 'Switch-to-buffer  "1"  'select-window-1  "2"  'select-window-2  "3"  'select-window-3  "4"  'select-window-4  "WR" 'Split-window-right  "WB" 'Split-window-below  "WM" 'delete-other-windows) (Require'evil)(Evil-mode1), the above is set to start Emacs load into Evil (global-set-key"\c-s" 'swiper)(Load-theme'Monokai 1)(Global-set-key (KBD"M-x")'Smex);; ------Common Set-----(Global-hl-line-mode1) (Add-hook'Emacs-lisp-mode-hook'show-paren-mode) (Tool-bar-mode-1) (Menu-bar-mode-1) (scroll-bar-mode-1) (Window-divider-mode-1);;( SETQ inhibit-splash-Screen t);;( SETQ-default Cursor-type'bar)(Setq initial-frame-alist (quote (fullscreen. maximized))); Turn off the Start Help screen (setq inhibit-splash-screen1);;( Global-hl-line-mode T) (Setq Make-backup-files Nil) (Global-linum-mode1);; Recent open files (Require'recentf)(Recentf-mode1) (setq recentf-max-menu-itemTen) (Delete-selection-mode1);; The following code can be Emacs to automatically load externally modified files. (Global-auto-revert-mode1);; You can use the following code to close your own production of the saved files (we have closed the Emacs automatic production of backup files, now is to turn off AutoSave files). (Setq auto-save-default nil);; -----------dired Mode-----------------;;+create a directory;; g refresh directory;; C copy;;D delete;; R renaming;; D mark Delete;; u cancel mark;; x perform all the marks;; Here are a few things that can be optimized. The first is to delete the directory when Emacs will ask whether to delete or copy recursively, which is also a bit of trouble we can use the following configuration to set it as the default recursive delete directory (for security reasons, perhaps you need to maintain this behavior.) All configurations in the article must be configured as needed. (Setq dired-recursive-deletes'Always )(Setq dired-recursive-copies'Always );; The second is that every time you enter a carriage return into a new directory, a new buffer will be created. This makes our buffer list filled with a lot of meaningless records. We can use the following code to let Emacs reuse a unique buffer as the dired Mode display private buffer. (Put'Dired-find-alternate-file'disabled nil);; Active loading dired Mode; (Require'dired);; (Defined-key Dired-mode-map (kbd"RET")'dired-find-alternate-file);; lazy loading ( with-eval-after-load'dired(Define-key Dired-mode-map (kbd"RET")'dired-find-alternate-file));; Enable Dired-X allows you to use the new shortcut key every time you enter dired mode c-x C-J can go to the path where the current folder is located. (Require'dired-x)

Emacs Init.el

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.