diff --git a/sources/tech/20200129 Use Emacs to get social and track your todo list.md b/sources/tech/20200129 Use Emacs to get social and track your todo list.md deleted file mode 100644 index 097f1919a3..0000000000 --- a/sources/tech/20200129 Use Emacs to get social and track your todo list.md +++ /dev/null @@ -1,162 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (lujun9972) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Use Emacs to get social and track your todo list) -[#]: via: (https://opensource.com/article/20/1/emacs-social-track-todo-list) -[#]: author: (Kevin Sonney https://opensource.com/users/ksonney) - -Use Emacs to get social and track your todo list -====== -Access Twitter, Reddit, chat, email, RSS, and your todo list in the -nineteenth in our series on 20 ways to be more productive with open -source in 2020. -![Team communication, chat][1] - -Last year, I brought you 19 days of new (to you) productivity tools for 2019. This year, I'm taking a different approach: building an environment that will allow you to be more productive in the new year, using tools you may or may not already be using. - -### Doing (almost) all the things with Emacs, part 2 - -[Yesterday][2], I talked about how to read email, access your addresses, and show calendars in Emacs. Emacs has tons and tons of functionality, and you can also use it for Twitter, chatting, to-do lists, and more! - -![All the things with Emacs][3] - -To do all of this, you need to install some Emacs packages. As you did yesterday, open the Emacs package manager with **Meta**+**x package-manager** (Meta is **Alt** on most keyboards or **Option** on MacOS). Now select the following packages with **i**, then install them by typing **x**: - - -``` -nnreddit -todotxt -twittering-mode -``` - -Once they are installed, open **~/.emacs.d/init.el** with **Ctrl**+**x Ctrl**+**x**, and add the following before the **(custom-set-variables** line: - - -``` -;; Todo.txt -(require 'todotxt) -(setq todotxt-file (expand-file-name "~/.todo/todo.txt")) - -;; Twitter -(require 'twittering-mode) -(setq twittering-use-master-password t) -(setq twittering-icon-mode t) - -;; Python3 for nnreddit -(setq elpy-rpc-python-command "python3") -``` - -Save the file with **Ctrl**+**x Ctrl**+**a**, exit Emacs with **Ctrl**+**x Ctrl**+**c**, then restart Emacs. - -#### Tweet from Emacs with twittering-mode - -![Twitter in Emacs][4] - -[Twittering-mode][5] is one of the best Emacs interfaces for Twitter. It supports almost all the features of Twitter and has some easy-to-use keyboard shortcuts. - -To get started, type **Meta**+**x twit** to launch twittering-mode. It will give a URL to open—and prompt you to launch a browser with it if you want—so you can log in and get an authorization token. Copy and paste the token into Emacs, and your Twitter timeline should load. You can scroll with the **Arrow** keys, use **Tab** to move from item to item, and press **Enter** to view the URL the cursor is on. If the cursor is on a username, pressing **Enter** will open that timeline in a web browser. If you are on a tweet's text, pressing **Enter** will reply to that tweet. You can create a new tweet with **u**, retweet something with **Ctrl**+**c**+**Enter**, and send a direct message with **d**—the dialog it opens has instructions on how to send, cancel, and shorten URLs. - -Pressing **V** will open a prompt to get to other timelines. To open your mentions, type **:mentions**. The home timeline is **:home**, and typing a username will take you to that user's timeline. Finally, pressing **q** will quit twittering-mode and close the window. - -There is a lot more functionality available in twittering-mode, and I encourage you to read the [full list][6] on its GitHub page. - -#### Track your to-do's in Emacs with Todotxt.el - -![todo.txt in emacs][7] - -[Todotxt.el][8] is a nice interface for the [todo.txt][9] to-do list manager. It has hotkeys for just about everything. - -To start it up, type **Meta**+**x todotxt**, and it will load the todo.txt file you specified in the **todotxt-file** variable (which you set in the first part of this article). Inside the buffer (window) for todo.txt, you can press **a** to add a new task and **c** to mark it complete. You can set priorities with **r**, and add projects and context to an item with **t**. When you are ready to move everything to **done.txt**, just press **A**. And you can filter the list with **/** or refresh back to the full list with **l**. And again, you can press **q** to exit. - -#### Chat in Emacs with ERC - -![Chatting with erc][10] - -One of Vim's shortcomings is that trying to use chat with it is difficult (at best). Emacs, on the other hand, has the [ERC][11] client built into the default distribution. Start ERC with **Meta**+**x erc**, and you will be prompted for a server name, username, and password. You can use the same information you used a few days ago when you set up [BitlBee][12]: server **localhost**, port **6667**, and the same username with no password. It should be the same as using almost any other IRC client. Each channel will be split into a new buffer (window), and you can switch between them with **Ctrl**+**x Ctrl**+**b**, which also switches between other buffers in Emacs. The **/quit** command will exit ERC. - -#### Read email, Reddit, and RSS feeds with Gnus - -![Mail, Reddit, and RSS feeds with Gnus][13] - -I'm sure many long-time Emacs users were asking, "but what about [Gnus][14]?" yesterday when I was talking about reading mail in Emacs. And it's a valid question. Gnus is a mail and newsreader built into Emacs, although it doesn't support [Notmuch][15] as a mail reader, just as a search engine. However, if you are configuring it for Reddit and RSS feeds (as you'll do in a moment), it's smart to add in mail functionality as well. - -Gnus was created for reading Usenet News and grew from there. So, a lot of its look and feel (and terminology) seem a lot like a Usenet newsreader. - -Gnus has its own configuration file in **~/.gnus** (the configuration can also be included in the main **~/.emacs.d/init.el**). Open **~/.gnus** with **Ctrl**+**x Ctrl**+**f** and add the following: - - -``` -;; Required packages -(require 'nnir) -(require 'nnrss) - -;; Primary Mailbox -(setq gnus-select-method -      '(nnmaildir "Local" -                  (directory "~/Maildir") -                  (nnir-search-engine notmuch) -      )) -(add-to-list 'gnus-secondary-select-methods -             '(nnreddit "")) -``` - -Save the file with **Ctrl**+**x Ctrl**+**s**. This tells Gnus to read mail from the local mailbox in **~/Maildir** as the primary source (**gnus-select-method**) and add a second source (**gnus-secondary-select-methods**) using the [nnreddit][16] plugin. You can also define multiple secondary sources, including Usenet News (nntp), IMAP (nnimap), mbox (nnmbox), and virtual collections (nnvirtual). You can learn more about all the options in the [Gnus manual][17]. - -Once you save the file, start Gnus with **Meta**+**x gnus**. The first run will install [Reddit Terminal Viewer][18] in a Python virtual environment, which is how it gets Reddit articles. It will then launch your browser to log into Reddit. After that, it will scan and load your subscribed Reddit groups. You will see a list of email folders with new mail and the list of subreddits with new content. Pressing **Enter** on any of them will load the list of messages for the group. You can navigate with the **Arrow** keys and press **Enter** to load and read a message. Pressing **q** will go back to the prior view when viewing message lists, and pressing **q** from the main window will exit Gnus. When reading a Reddit group, **a** creates a new message; in a mail group, **m** creates a new email; and **r** replies to messages in either view. - -You can also add RSS feeds to the Gnus interface and read them like mail and newsgroups. To add an RSS feed, type **G**+**R** and fill in the RSS feed's URL. You will be prompted for the title and description of the feed, which should be auto-filled from the feed. Now type **g** to check for new messages (this checks for new messages in all groups). Reading a feed is like reading Reddit groups and mail, so it uses the same keys. - -There is a _lot_ of functionality in Gnus, and there are a whole lot more key combinations. The [Gnus Reference Card][19] lists all of them for each view (on five pages in very small type). - -#### See your position with nyan-mode - -As a final note, you might notice [Nyan cat][20] at the bottom of some of my screenshots. This is [nyan-mode][21], which indicates where you are in a buffer, so it gets longer as you get closer to the bottom of a document or buffer. You can install it with the package manager and set it up with the following code in **~/.emacs.d/init.el**: - - -``` -;; Nyan Cat -(setq nyan-wavy-trail t) -(setq nyan-bar-length 20) -(nyan-mode) -``` - -### Scratching Emacs' surface - -This is just scratching the surface of all the things you can do with Emacs. It is _very_ powerful, and it is one of my go-to tools for being productive whether I'm tracking to-dos, reading and responding to mail, editing text, or chatting with my friends and co-workers. It takes a bit of getting used to, but once you do, it can become one of the most useful tools on your desktop. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/1/emacs-social-track-todo-list - -作者:[Kevin Sonney][a] -选题:[lujun9972][b] -译者:[lujun9972](https://github.com/lujun9972) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/ksonney -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/talk_chat_team_mobile_desktop.png?itok=d7sRtKfQ (Team communication, chat) -[2]: https://opensource.com/article/20/1/emacs-mail-calendar -[3]: https://opensource.com/sites/default/files/uploads/productivity_19-1.png (All the things with Emacs) -[4]: https://opensource.com/sites/default/files/uploads/productivity_19-2.png (Twitter in Emacs) -[5]: https://github.com/hayamiz/twittering-mode -[6]: https://github.com/hayamiz/twittering-mode#features -[7]: https://opensource.com/sites/default/files/uploads/productivity_19-3.png (todo.txt in emacs) -[8]: https://github.com/rpdillon/todotxt.el -[9]: http://todotxt.org/ -[10]: https://opensource.com/sites/default/files/uploads/productivity_19-4.png (Chatting with erc) -[11]: https://www.gnu.org/software/emacs/manual/html_mono/erc.html -[12]: https://opensource.com/article/20/1/open-source-chat-tool -[13]: https://opensource.com/sites/default/files/uploads/productivity_19-5.png (Mail, Reddit, and RSS feeds with Gnus) -[14]: https://www.gnus.org/ -[15]: https://opensource.com/article/20/1/organize-email-notmuch -[16]: https://github.com/dickmao/nnreddit -[17]: https://www.gnus.org/manual/gnus.html -[18]: https://pypi.org/project/rtv/ -[19]: https://www.gnu.org/software/emacs/refcards/pdf/gnus-refcard.pdf -[20]: http://www.nyan.cat/ -[21]: https://github.com/TeMPOraL/nyan-mode diff --git a/translated/tech/20200129 Use Emacs to get social and track your todo list.md b/translated/tech/20200129 Use Emacs to get social and track your todo list.md new file mode 100644 index 0000000000..fff71fcc19 --- /dev/null +++ b/translated/tech/20200129 Use Emacs to get social and track your todo list.md @@ -0,0 +1,165 @@ +[#]: collector: (lujun9972) +[#]: translator: (lujun9972) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Use Emacs to get social and track your todo list) +[#]: via: (https://opensource.com/article/20/1/emacs-social-track-todo-list) +[#]: author: (Kevin Sonney https://opensource.com/users/ksonney) + +使用 Emacs 进行社交并跟踪你的待办事项列表 +====== +访问 Twitter、Reddit、 交谈、电子邮件 、RSS 和你的待办事项列表,这是我们关于 2020 年使用开源提高效率的 20 个方法系列的第 19 个。 +![团队沟通、交谈 ][1] + +去年,我给你们带来了 2019 年的 19 天新生产力工具。今年,我将采取一种不同的方法:建立一个新的环境,让你使用已用或未用的工具在新的一年里更有效率,。 + +### 使用 Emacs 做(几乎)所有的事情,第 2 部分 + +[昨天 ][2],我谈到了如何在 Emacs 中读取电子邮件、访问电子邮件地址和显示日历。Emacs 功能繁多,你还可以将它用于 Twitter、 交谈、待办事项列表等等! + +[在 Emacs 中处理所有事情 ][3] + +要完成所有这些,您需要安装一些 Emacs 包。和昨天一样,用 `Meta+x package-manager` 打开 Emacs 包管理器 (Meta 在大多数键盘上是 **Alt**,在 MacOS 上是 **Option**)。然后通过 **i** 选择以下带有的软件包,然后输入 **x** 进行安装: + + +``` +nnreddit +todotxt +twittering-mode +``` + +安装之后,按下 `Ctrl+x ctrl+f` 打开 `~/.emacs.d/init.el`,并在 `(custom-set-variables` 行前加上: + + +``` +;; Todo.txt +(require 'todotxt) +(setq todotxt-file (expand-file-name "~/.todo/todo.txt")) + +;; Twitter +(require 'twittering-mode) +(setq twittering-use-master-password t) +(setq twittering-icon-mode t) + +;; Python3 for nnreddit +(setq elpy-rpc-python-command "python3") +``` + +按下 `Ctrl+x Ctrl+s` 保存文件,使用 `Ctrl+x Ctrl+c` 退出 Emacs,然后重启 Emacs。 + +#### 使用 twittering-mode 在 Emacs 中发推 + +![Emacs 中的 Twitter][4] + +[Twittering-mode][5] 是 Twitter 最好的 Emacs 接口之一。它几乎支持 Twitter 的所有功能,并且键盘快捷键也易于使用。 + +首先,输入 `Meta+x twit` 来启动 twitter-mode。它会提供一个 URL 并提示你启动浏览器来访问它,你登录该 URL 后就能获得授权令牌。将令牌复制并粘贴到 Emacs 中,您的 Twitter 时间线就会加载了。您可以使用**箭头**键滚动,使用 **Tab** 从一个项目移动到另一个项目,并按 **Enter** 访问光标所在的 URL。如果光标在用户名上,按 **Enter** 将在 web 浏览器中打开时间轴。如果你在一条 tweet 的文本上,按 **Enter** 将回复该 tweet。你可以用 **u** 创建一个新的 tweet,用 `Ctrl+c+Enter` 转发一些内容,然后用 **d** 发送一条直接消息——它打开的对话框中有关于如何发送、取消和缩短 url 的说明。 + +按 **V** 会打开一个提示让你跳转到其他时间线。输入 **:mentions** 打开你的提及。输入 **:home** 打开你的主时间线,输入用户名将进入该用户的时间线。最后,按 **q** 会退出 twittering-mode 并关闭窗口。 + +twitter-mode 还有更多功能,我鼓励你阅读它 GitHub 页面上的[完整功能列表 ][6]。 + +#### 在 Emacs 上使用 Todotxt.el 追踪你的待办事项 + +![Emacs 中的 todo.txt][7] + +[Todotxt.el][8] 是一个很棒的 [todo.txt][9] 待办列表管理器接口。它的快捷键几乎无所不包。 + +输入 `Meta+x todotxt` 启动它将加载 **todotxt-file** 变量中指定的 todo.txt 文件(本文的第一部分中设置了该文件)。 +在 todo.txt 的缓冲区(窗口*,您可以按 **a** 添加新任务并和按 **c** 标记它已被完成。你还可以使用 **r** 设置优先级,并使用 **t** 添加项目和上下文。 +完成事项后只需要按下 **A** 即可将任务移如 **done.txt**。你可以使用**/**过滤列表,也可以使用 **l** 刷新完整列表。同样,您可以按 **q** 退出。 + +#### 在 Emacs 中使用 ERC 进行交谈 + +![使用 ERC 与人交谈 ][10] + +Vim 的缺点之一是很难用它与人交谈。另一方面,Emacs 则将 [ERC][11] 客户端内置到默认发行版中。使用 `Meta+x ERC` 启动 ERC,系统将提示您输入服务器、用户名和密码。你可以使用几天前介绍设置 [BitlBee][12] 时使用的相同信息:服务器为 **localhost**,端口为 **6667**,相同用户名,无需密码。 +ERC 使用起来与其他 IRC 客户端一样。每个频道单独一个缓冲区(窗口),您可以使用 `Ctrl+x ctrl+b` 进行频道间切换,这也可以在 Emacs 中的其他缓冲区之间进行切换。`/quit` 命令将退出 ERC。 + +#### 使用 Gnus 阅读电子邮件,Reddit 和 RSS + +![Mail,Reddit,and RSS feeds with Gnus][13] + +我相信昨天在我提及在 Emacs 中阅读邮件时,许多 Emacs 的老用户会问,“怎么没有 [Gnus][14] 呢?” +这个疑问很合理。Gnus 是一个内置在 Emacs 中的邮件和新闻阅读器,尽管它这个邮件阅读器不支持以 [Notmuch][15] 作为搜索引擎。但是,如果你将其配置来阅读 Reddit 和 RSS feed( 稍后您将这样做),那么同时使用它来阅读邮件是个聪明的选择。 + +Gnus 是为阅读 Usenet 新闻而创建的,并从此发展而来。因此,它的很多外观和感觉(以及术语)看起来很像 Usenet 的新闻阅读器。 + +Gnus 以 `~/.gnus` 作为自己的配置文件。(该配置也可以包含在 `~/.emacs.d/init.el` 中)。使用 `Ctrl+x Ctrl+f` 打开 `~/.gnus`,并添加以下内容: + + +``` +;; Required packages +(require 'nnir) +(require 'nnrss) + +;; Primary Mailbox +(setq gnus-select-method +      '(nnmaildir "Local" +                  (directory "~/Maildir") +                  (nnir-search-engine notmuch) +      )) +(add-to-list 'gnus-secondary-select-methods +             '(nnreddit "")) +``` + +用 `Ctrl+x Ctrl+s` 保存文件。这分配置告诉 Gnus 从 `~/Maildir` 这个本地邮箱中读取邮件作为主源(参见 **gnus-select-method** 变量),并使用 [nnreddit][16] 插件添加辅源 (**gnus-secondary-select-methods** 变量)。你还可以定义多个辅助源,包括 Usenet 新闻 (nntp)、IMAP (nnimap)、mbox (nnmbox) 和虚拟集合 (nnvirtual)。您可以在 [Gnus 手册 ][17] 中了解更多有关所有选项的信息。 + +保存文件后,使用 `Meta+x Gnus` 启动 Gnus。第一次运行将在 Python 虚拟环境中安装 [Reddit 终端查看器 ][18],Gnus 通过它获取 Reddit 上的文章。然后它会启动浏览器来登录 Reddit。之后,它会扫描并加载你订阅的 Reddit 群组。你会看到一个有新邮件的邮件夹列表和一个有新内容的看板列表。在任一列表上按 **Enter** 将加载该组中的消息列表。您可以使用**箭头**键导航并按 **Enter** 加载和读取消息。在查看消息列表时,按 **q** 将返回到前一个视图,从主窗口按 **q** 将退出 Gnus。在阅读 Reddit 群组时,**a** 会创建一条新消息;在邮件组中,**m** 创建一个新的电子邮件;并且在任何一个视图中按 **r** 回复邮件。 + +您还可以向 Gnus 接口中添加 RSS feed,并像阅读邮件和新闻组一样阅读它们。要添加 RSS feed,输入 `G+R` 并填写 RSS feed 的 URL。会有提示让你输入 feed 的标题和描述,这些信息可以从 feed 中提取出来并填充进去。现在输入 **g** 来检查新消息(这将检查所有组中的新消息)。阅读 feed 就像阅读 Reddit 群组和邮件一样,它们使用相同的快捷键。 + +Gnus 中有_很多_功能,还有大量的键组合。[Gnus 参考卡 ][19] 为每个视图列出了所有这些键组合(以非常小的字体显示在 5 页纸上)。 + +#### 使用 nyan-mode 查看位置 + +As a final note,you might notice [Nyan cat][20] at the bottom of some of my screenshots。This is [nyan-mode][21],which indicates where you are in a buffer,so it gets longer as you get closer to the bottom of a document or buffer。You can install it with the package manager and set it up with the following code in **~/.emacs.d/init.el**: +最后,你可能会一些截屏底部注意到 [Nyan cat][20]。这是 [nyan-mode][21],它指示了你在缓冲区中的位置,因此当您接近文档或缓冲区的底部时,它会变长。您可以使用包管理器安装它,并在 `~/.emacs.d/init.el` 中使用以下代码进行设置: + + +``` +;; Nyan Cat +(setq nyan-wavy-trail t) +(setq nyan-bar-length 20) +(nyan-mode) +``` + +### Emacs 的皮毛 + +这只是 Emacs 所有功能的皮毛。Emacs_ 非常_强大,是我用来提高工作效率的必要工具之一,无论我是在追踪待办事项、阅读和回复邮件、编辑文本,还是与朋友和同事交流我都用它。这需要一点时间来适应,但是一旦你习惯了,它就会成为你桌面上最有用的工具之一。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/emacs-social-track-todo-list + +作者:[Kevin Sonney][a] +选题:[lujun9972][b] +译者:[lujun9972](https://github.com/lujun9972) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/ksonney +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/talk_chat_team_mobile_desktop.png?itok=d7sRtKfQ (Team communication, chat) +[2]: https://opensource.com/article/20/1/emacs-mail-calendar +[3]: https://opensource.com/sites/default/files/uploads/productivity_19-1.png (All the things with Emacs) +[4]: https://opensource.com/sites/default/files/uploads/productivity_19-2.png (Twitter in Emacs) +[5]: https://github.com/hayamiz/twittering-mode +[6]: https://github.com/hayamiz/twittering-mode#features +[7]: https://opensource.com/sites/default/files/uploads/productivity_19-3.png (todo.txt in emacs) +[8]: https://github.com/rpdillon/todotxt.el +[9]: http://todotxt.org/ +[10]: https://opensource.com/sites/default/files/uploads/productivity_19-4.png (Chatting with erc) +[11]: https://www.gnu.org/software/emacs/manual/html_mono/erc.html +[12]: https://opensource.com/article/20/1/open-source-chat-tool +[13]: https://opensource.com/sites/default/files/uploads/productivity_19-5.png (Mail, Reddit, and RSS feeds with Gnus) +[14]: https://www.gnus.org/ +[15]: https://opensource.com/article/20/1/organize-email-notmuch +[16]: https://github.com/dickmao/nnreddit +[17]: https://www.gnus.org/manual/gnus.html +[18]: https://pypi.org/project/rtv/ +[19]: https://www.gnu.org/software/emacs/refcards/pdf/gnus-refcard.pdf +[20]: http://www.nyan.cat/ +[21]: https://github.com/TeMPOraL/nyan-mode