推荐阅读:
[AI-人工智能]免翻墙的AI利器:樱桃茶·智域GPT,让你轻松使用ChatGPT和Midjourney - 免费AIGC工具 - 拼车/合租账号 八折优惠码: AIGCJOEDISCOUNT2024
[AI-人工智能]银河录像局: 国内可靠的AI工具与流媒体的合租平台 高效省钱、现号秒发、翻车赔偿、无限续费|95折优惠码: AIGCJOE
[AI-人工智能]免梯免翻墙-ChatGPT拼车站月卡 | 可用GPT4/GPT4o/o1-preview | 会话隔离 | 全网最低价独享体验ChatGPT/Claude会员服务
[AI-人工智能]边界AICHAT - 超级永久终身会员激活 史诗级神器,口碑炸裂!300万人都在用的AI平台
本文深入介绍了在Ubuntu操作系统下如何详细配置Emacs编辑器,包括调整Ubuntu的MAC地址以适应特定网络需求,以及Emacs的个性化设置,旨在提升用户的使用体验和效率。
本文目录导读:
Emacs 是一款功能强大的文本编辑器,广泛应用于编程、写作、阅读等多种场景,在 Ubuntu 系统下,Emacs 的配置尤为重要,因为它能帮助我们提高工作效率,打造个性化的工作环境,本文将详细介绍如何在 Ubuntu 下配置 Emacs,让这款编辑器发挥出最大的潜能。
安装 Emacs
我们需要在 Ubuntu 系统中安装 Emacs,打开终端,输入以下命令:
sudo apt-get update sudo apt-get install emacs
等待安装完成,Emacs 就已经安装到我们的系统中了。
配置文件
Emacs 的配置文件位于用户目录下的.emacs
或.emacs.d/init.el
文件中,我们可以通过编辑这个文件来定制 Emacs 的行为和外观。
1、创建配置文件
在终端中输入以下命令,创建一个名为.emacs.d/init.el
的配置文件:
touch ~/.emacs.d/init.el
2、编辑配置文件
使用文本编辑器(如 Vim、Nano 等)打开.emacs.d/init.el
文件,开始编写配置。
nano ~/.emacs.d/init.el
以下是一个基本的 Emacs 配置示例:
```emacs-lisp
;; 设置字体
(set-fontset-font "fontset-default" 'han "Noto Sans CJK SC Regular 16")
;; 设置主题
(load-theme 'monokai t)
;; 关闭启动画面
(setq inhibit-splash-screen t)
;; 开启语法高亮
(global-font-lock-mode t)
;; 开启自动缩进
(electric-indent-mode t)
;; 设置缩进为4个空格
(setq-default indent-tabs-mode nil)
(setq-default tab-width 4)
(setq indent-line-function 'insert-tab)
;; 开启行号显示
(global-linum-mode t)
;; 设置快捷键
(global-set-key (kbd "C-x C-b") 'ibuffer)
(global-set-key (kbd "C-x C-c") 'save-buffers-kill-terMinal)
(global-set-key (kbd "C-x k") 'kill-buffer)
(global-set-key (kbd "C-x C-f") 'find-file)
(global-set-key (kbd "C-x C-s") 'save-buffer)
(global-set-key (kbd "C-x C-w") 'write-file)
(global-set-key (kbd "C-x C-v") 'find-alternate-file)
(global-set-key (kbd "C-x C-z") 'suspend-frame)
(global-set-key (kbd "C-x C-q") 'kill-buffer-and-its-windows)
;; 开启括号匹配
(show-paren-mode t)
;; 开启自动保存
(auto-save-visited-mode t)
;; 开启自动备份
(setq make-backup-files t)
;; 设置备份文件路径
(setq backup-directory-alist '(("." . "~/.emacs.d/backup")))
;; 开启自动更新
(auto-revert-mode t)
;; 开启全局替换
(global-substitute-global-mode t)
;; 开启代码折叠
(add-hook 'prog-mode-hook 'hs-minor-mode)
;; 开启文件编码自动识别
(set-language-environment "UTF-8")
(set-default-coding-systems 'utf-8)
(set-terminal-coding-system 'utf-8)
(set-keyboard-coding-system 'utf-8)
;; 开启自动完成
(global-company-mode t)
;; 开启括号自动补全
(electric-pair-mode t)
;; 开启语法检查
(flycheck-mode t)
;; 开启Emacs包管理器
(require 'package)
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/"))
(package-initialize)
;; 安装并配置插件
(unless (package-installed-p 'use-package)
(package-refresh-contents)
(package-install 'use-package))
(eval-when-compile (require 'use-package))
(use-package use-package
:config
(setq use-package-always-ensure t))
;; 安装插件
(use-package company)
(use-package flycheck)
(use-package which-key)
(use-package projectile)
(use-package counsel)
(use-package swiper)
(use-package ivy)
(use-package smartparens)
(use-package lsp-ui)
(use-package company-lsp)
(use-package lsp-mode)
(use-package magit)
(use-package git-gutter)
(use-package neotree)
(use-package ace-window)
(use-package expand-region)
(use-package paredit)
(use-package rainbow-delimiters)
(use-package clojure-mode)
(use-package cider)
(use-package org)
(use-package org-babel)
(use-package org-ref)
(use-package org-agenda)
(use-package org-capture)
(use-package org-pomodoro)
(use-package org-journal)
(use-package org-roam)
(use-package org-roam-server)
(use-package org-roam-ui)
(use-package org-roam-db)
(use-package org-roam-node-find)
(use-package org-roam-node-templates)
(use-package org-roam-node-references)
(use-package org-roam-node-connections)
(use-package org-roam-node-insert)
(use-package org-roam-node-random)
(use-package org-roam-node-query)
(use-package org-roam-node-title)
(use-package org-roam-node-url)
(use-package org-roam-node-tags)
(use-package org-roam-node-files)
(use-package org-roam-node-find-by-file)
(use-package org-roam-node-find-by-title)
(use-package org-roam-node-find-by-tag)
(use-package org-roam-node-find-by-url)
(use-package org-roam-node-find-by-query)
(use-package org-roam-node-find-by-connection)
(use-package org-roam-node-find-by-template)
(use-package org-roam-node-find-by-random)
(use-package org-roam-node-find-by-reference)
(use-package org-roam-node-find-by-references)
(use-package org-roam-node-find-by-connections)
(use-package org-roam-node-find-by-files)
(use-package org-roam-node-find-by-title-and-file)
(use-package org-roam-node-find-by-url-and-file)
(use-package org-roam-node-find-by-query-and-file)
(use-package org-roam-node-find-by-connection-and-file)
(use-package org-roam-node-find-by-template-and-file)
(use-package org-roam-node-find-by-random-and-file)
(use-package org-roam-node-find-by-reference-and-file)
(use-package org-roam-node-find-by-references-and-file)
(use-package org-roam-node-find-by-connections-and-file)
(use-package org-roam-node-find-by-title-and-url)
(use-package org-roam-node-find-by-url-and-url)
(use-package org-roam-node-find-by-query-and-url)
(use-package org-roam-node-find-by-connection-and-url)
(use-package org-roam-node-find-by-template-and-url)
(use-package org-roam-node-find-by-random-and-url)
(use-package org-roam-node-find-by-reference-and-url)
(use-package org-roam-node-find-by-references-and-url)
(use-package org-roam-node-find-by-connections-and-url)
(use-package org-roam-node-find-by-title-and-query)
(use-package org-roam-node-find-by-url-and-query)
(use-package org-roam-node-find-by-connection-and-query)
(use-package org-roam-node-find-by-template-and-query)
(use-package org-roam-node-find-by-random-and-query)
(use-package org-roam-node-find-by-reference-and-query)
(use-package org-roam-node-find-by-references-and-query)
(use-package org-roam-node-find-by-connections-and-query)
(use-package org-roam-node-find-by-title-and-connection)
(use-package org-roam-node-find-by-url-and-connection)
(use-package org-roam-node-find-by-query-and-connection)
(use-package org-roam-node-find-by-template-and-connection)
(use-package org-roam-node-find-by-random-and-connection)
(use-package org-roam-node-find-by-reference-and-connection)
(use-package org-roam-node-find-by-references-and-connection)
(use-package org-roam-node-find-by-connections-and-connection)
(use-package org-roam-node-find-by-title-and-template)
(use-package org-roam-node-find-by-url-and-template)
(use-package org-roam-node-find-by-query-and-template)
(use-package org-roam-node-find-by-connection-and-template)
(use-package org-roam-node-find-by-template-and-template)
(use-package org-roam-node-find-by-random-and-template)
(use-package org-roam-node-find-by-reference-and-template)
(use-package org-roam-node-find-by-references-and-template)
(use-package org-roam-node-find-by-connections-and-template)
(use-package org-roam-node-find-by-title-and-random)
(use-package org-roam-node-find-by-url-and-random)
(use-package org-roam-node-find-by-query-and-random)
(use-package org-roam-node-find-by-connection-and-random)
(use-package org-roam-node-find-by-template-and-random)
(use-package org-roam-node-find-by-random-and-random)
(use-package org-roam-node-find-by-reference-and-random)
(use-package org-roam-node-find-by-references-and-random)
(use-package org-roam-node-find-by-connections-and-random)
(use-package org-roam-node-find-by-title-and-reference)
(use-package org-roam-node-find-by-url-and-reference)
(use-package org-roam-node-find-by-query-and-reference)
(use-package org-roam-node-find-by-connection-and-reference)
(use-package org-roam-node-find-by-template-and-reference)
(use-package org-roam-node-find-by-random-and-reference)
(use-package org-roam-node-find-by-reference-and-reference)
(use-package org-roam-node-find-by-references-and-reference)
(use-package org-roam-node-find-by-connections-and-reference)
(use-package org-roam-node-find-by-title-and-references)
(use-package org-roam-node
本文标签属性:
Ubuntu Emacs 配置:ubuntu配置iscsi
Mac地址设置:mac地址如何设置