您可能已经在Windows计算机或设备上看到过记事本。(Notepad)您(Did)是否想知道它是什么以及它的作用?这是一个非常古老的应用程序,几十年来一直存在于Windows操作系统中。尽管它在所有Windows(Windows)版本中的外观基本相同,但最近在Windows 10中,它受到了微软(Microsoft)的更多关注。在本文中,我们将向您展示什么是记事本(Notepad)以及如何使用它。如果您想了解它,请继续阅读:
什么是记事本(Notepad)?记事本(Notepad)是干什么用的?
记事本(Notepad)是内置于Windows中的基本文本编辑器。它非常适合编写要保存为纯文本的相对较短的文本文档。然而,这并不是你能做的全部。如果您没有经常使用记事本(Notepad),或者从未使用过,您可能会对它的易用性感到惊讶。
记事本在(Notepad)Windows 10和更早版本的Microsoft操作系统(如Windows 7 )中的外观和工作方式基本相同。主要区别与您在不同操作系统中打开应用程序的方式有关,您可以在本教程中了解更多信息:Windows 中启动记事本的 11 种方法(所有版本)(11 ways to start Notepad in Windows (all versions))。当您打开记事本(Notepad)时,您会看到这个简洁的屏幕:
不需要更多,因为记事本(Notepad)的选项有限。在窗口顶部,您应该会看到File、Edit、Format、View和Help的菜单。让我们看看您可以使用记事本(Notepad)做什么。一切都应该令人放心地熟悉,但请记住,记事本(Notepad)只是一个文本编辑器。如果您尝试将图形粘贴到其中,它不起作用。
1.使用记事本(Notepad)创建(Create)、打开和保存文本文件
您在“文件(File)”菜单中的选项是“新建”、“新窗口”、“打开”、“保存”、“另存为”、“页面设置(New, New Windows, Open, Save, Save As, Page Setup)”和“打印(Print)” 。如您所见,其中许多命令也有键盘快捷键。您可能已经熟悉其中的一些,因为它们在几乎每个Windows应用程序中都是相同的。
在记事本(Notepad)中创建和保存文本文档很简单:打开记事本(Notepad),开始输入,然后按照您认为合适的方式编辑和格式化文本。完成后,使用“另存为(Save As)”命令保存您的工作。默认文件夹是Windows 10 中的OneDrive文件夹和(OneDrive)Windows 7中的(Windows 7)My Documents文件夹。您可以很容易地更改此设置:使用另存为(Save As)命令,浏览到您的首选文件夹,然后单击打开(Open)。记事本(Notepad)会记住您的选择。请记住,您的文件以.txt扩展名和纯文本格式保存。
2.使用记事本(Notepad)进行简单的文字编辑
编辑菜单提供了一些选择,但同样,使用过(Edit)Windows的任何人都应该熟悉此菜单上的所有内容。所有编辑(Edit)选项都有关联的键盘快捷键。请注意,大多数命令都是灰色的,直到在记事本(Notepad)窗口中选择了文本。
Edit菜单上的第一项是Undo/Redo,这在您编辑文档时很有用。这个地方出现什么取决于你一直在做什么。如果您刚刚使用过Undo命令或按下Ctrl + Z,您应该会在列表顶部看到Redo命令(及其键盘快捷键Ctrl + Y)。
菜单的其余部分 -剪切、复制、粘贴、(Cut, Copy, Paste,) 删除、查找、查找下一个、替换、转到、全选(Delete, Find, Find Next, Replace, Go To, Select All)和Time/Date,在几乎所有处理文档的Windows程序中都是标准的。(Windows)
3. 在记事本(Notepad)文档中搜索和替换文本
Find、Find Next和Replace用于搜索和替换文档中的文本,而Go To可用于浏览它。要搜索或替换一段文本,请根据需要选择查找(Find)选项(键盘快捷键Ctrl + F)或替换(Replace) (Ctrl + H)选项。这会使记事本打开一个框,您可以在其中在(Notepad)“查找内容”("Find what")字段中键入您要查找的文本。如果要替换文本,“替换(Replace)”窗口还会为您提供“替换为”("Replace with")字段。无论哪种方式,查找(Find)和替换(Replace)包括相同的几个搜索选项:
您可以决定搜索是否应“匹配大小写”("Match case")文本并选择方向(Direction)为Down或Up。Down表示从光标在文本文档中的位置开始搜索,直到文档结尾。另一方面,向上执行从光标位置向上直到文档开头的搜索。(Up,)不幸的是,除非您将光标放在文档的开头或结尾,否则这两个选项都不能确保对整个文档进行搜索。
幸运的是,通过选择“环绕”(Wrap around")设置,您可以确保从头到尾对整个文档执行搜索。当环绕(Wrap around)打开时,记事本(Notepad)也会使用您的其他搜索选项。但是,如果Direction设置为Down,当它到达文档的末尾时,记事本(Notepad)会自动从头开始继续搜索并且永不停止。同样,如果将Direction设置为Up,当搜索到达文档开头时,Wrap around会自动从文档末尾继续搜索。
Go To是一个不太熟悉的命令。您可以使用Go To跳转到文档中的特定编号行。转到(Go To)仅在关闭自动换行时才有效。(Word Wrap)如果Word Wrap已打开 *,Go To* 将显示为灰色。
4. 打开或关闭自动换行
格式(Format)菜单只为您提供两种选择:自动换行(Word Wrap)和字体(Font)。由于某些未知原因,记事本(Notepad)总是关闭自动换行。(Word Wrap)这意味着您键入的所有内容都以一行结束,直到您按Enter,这将开始另一行。
当您的输入接近记事本(Notepad)窗口的右边距时,您可以选择按Enter 键(Enter),但这会使行的长度根据您的窗口大小而定。如果您想查看您正在输入的内容而不必一直向右滚动,请打开自动换(Word Wrap)行。然后记事本(Notepad)应该像任何其他文字处理程序一样运行,并在您接近窗口的右边距时自动将文本换行到下一行。
在 Windows 7 中,状态栏(Status Bar)(您可以从查看(View)菜单启用或禁用)也与自动换(Word Wrap)行链接。如果关闭自动换(Word Wrap)行,您可以在窗口的下边框看到一条通知,显示光标当前在非自动换行文档中的位置。如果打开自动换(Word Wrap)行,则下边框为空白。在Windows 10中,状态栏(Status Bar)默认打开并显示行号和列号,无论您是否使用自动换(Word Wrap)行。
5.记事本(Notepad)放大缩小(仅限Windows 10)
如果您使用的是2020 年 5 月更新(Windows 10 with May 2020 Update)或更新版本的 Windows 10,记事本(Notepad)还有另一个很棒的功能:文本缩放。您可以使用此功能来增加或减小文本的大小,以便更容易在屏幕上看到。
要缩放文本,请从记事本(Notepad)窗口顶部打开“查看”菜单,选择“(View)缩放(Zoom)”,然后单击或点击“放大”(Zoom In)或“缩小”(Zoom Out)。重复相同的步骤以进一步增加或减少缩放级别。要返回正常缩放级别,请从同一菜单中选择“恢复默认缩放” 。("Restore Default Zoom")
此外,为了获得更快的体验,您可能需要记住,您还可以使用这些键盘快捷键来调整记事本(Notepad)中的缩放级别:
- Zoom In - Ctrl + Plus
- Zoom Out - Ctrl + Minus
- Restore Default Zoom - Ctrl + 0
6.更改文本文档的字体
字体(Font)选择是不言自明的:它为您提供了所有已安装字体的列表以及使用粗体、斜体等的选项。但是,与它在Microsoft Word等程序中的工作方式不同,字体的更改会立即影响整个文档。您不能在文档的某个部分使用一种字体,而在其他地方使用另一种字体。要么全有,要么全无。
在字体菜单中,有一个不太熟悉的选项可用,即标记为(Font)Script的下拉菜单。这使您可以选择标准“西方”样式字体中不可用的字符。选项包括西方、希腊语、土耳其语、波罗的海(在 Windows 7 中不可用)、中欧、西里尔文(Western, Greek, Turkish, Baltic (not available in Windows 7), Central European, Cyrillic,)和越南语(在 Windows 7 中不可用)(Vietnamese (not available in Windows 7))。选择一组,您应该会在其上方看到一些具有代表性的字符。默认选择西式套装,如有必要,您需要将其更改为另一套。(Western)
7.用记事本打印文本文件
如果您要在正在打印的文档中自定义任何其他内容,请打开“文件(File)”菜单,然后单击或点击“打印(Print)” 。如果您确实想自定义打印,请首先单击或点击“文件(File)”菜单中的“页面设置”。(Page Setup)
在更复杂的程序中,页面设置(Page Setup)提供了一长串选项。但是,在记事本中(Notepad,),您的选择很简单。您可以选择纸张尺寸和打印机存放纸张的位置、页面方向以及是否具有页眉和页脚(以及要包含在每个中的文本)。
默认情况下,在Windows 10中,没有打印页眉或页脚。在Windows 7中,页眉中的文本是文档的名称和打印日期,页脚中的文本是页码。如果要自定义页眉和页脚,请键入要用于它们的文本。请注意,您还可以使用一些代码来打印当前日期、时间、文档名称或页码。要查看所有代码,请单击或点击页面设置(Page Setup)窗口中的输入值(Input Values)链接,或访问此页面:在记事本中更改页眉和页脚命令(Changing Header and Footer Commands in Notepad)。
8.使用不同的编码保存文本文件
您还可以使用另存为(Save As)来更改文件的编码以匹配特定的字符集。在这里,我们罗马尼亚网站digitalcitizen.ro的一些文本已被剪切并粘贴到记事本(Notepad)中。
如果您尝试将其保存为ANSI编码,这是Windows 7和旧版本Windows 10记事本(Notepad)中的默认选项,您将收到一条消息,如果您将其保存为纯文本,所有格式都会丢失.
您必须从下拉列表中选择适当的编码。根据文件中字符的类型,这可能需要一些实验才能正确,但从Unicode开始是一个不错的选择。如果你不熟悉编码,本教程的第一部分应该帮助解释它:使 Windows 正确显示非英语语言的字符(设置非 Unicode 程序)(Make Windows correctly display characters from languages other than English (set non-Unicode programs))。
9. 将文档另存为 HTML 文件
您还可以使用记事本(Notepad)创建HTML文件。确保(Make)打开自动换(Word Wrap)行并以键入纯文本的方式键入HTML代码。(HTML)当需要保存您的工作时,请选择Save As,然后从选项列表中选择All Files。然后使用.htm(.htm)或.html扩展名保存您的文件。
您是否使用记事本(Notepad)进行(轻量)文本编辑?
记事本(Notepad)已经存在了很长时间,并且仍然是用于编写简单文本和HTML的有用的桌面应用程序。有时,这就是你所需要的。如果您需要的不仅仅是基础知识,写字板(WordPad)可能是更好的选择。它也内置于所有版本的Windows中!你经常使用记事本吗?(Notepad)如果你这样做了,请在下面的评论中告诉我们你觉得它是如何有用的。
What is Notepad? 9 things you can use it for! -
You've probably sеen Notepad on your Windows computer or device. Did you wonder about what it is and what it does? This is a very old app that has been present in Windows operating systems for decades. Although it keeps mostly the same appearance in all Windows versions, lately, in Windows 10, it has received more attention from Microsoft. In this article, we're going to show you what Notepad is and how to use it. If you want to learn about it, read on:
What is Notepad? What is Notepad used for?
Notepad is a basic text editor that's built into Windows. It is excellent for writing relatively short text documents that you want to save as plain text. However, that's not all you can do with it. If you have not used Notepad much, or ever, you may be surprised by how easy it is to work with.
Notepad looks and works mostly the same in Windows 10 and older versions of Microsoft's operating systems such as Windows 7. The main differences are related to how you open the application in different operating systems, and you can learn more about that in this tutorial: 11 ways to start Notepad in Windows (all versions). When you open Notepad, you get to see this no-frills screen:
Nothing more is needed, since Notepad has a limited set of options. At the top of the window, you should see menus for File, Edit, Format, View, and Help. Let's take a look at what you can do with Notepad. Everything should be reassuringly familiar, but keep in mind that Notepad is just a text editor. If you try to paste graphics into it, it does not work.
1. Create, open, and save text files with Notepad
The choices you have in the File menu are New, New Windows, Open, Save, Save As, Page Setup, and Print. As you can see, many of these commands have keyboard shortcuts as well. You might already be familiar with some of them since they are the same in nearly every Windows application.
Creating and saving text documents in Notepad is simple: open Notepad, start typing, and then edit and format the text as you see fit. Once you are finished, use the Save As command to save your work. The default folder is the OneDrive folder in Windows 10, and the My Documents folder in Windows 7. You can change this quite easily: use the Save As command, browse to your preferred folder, and click Open. Notepad will remember your choice. Keep in mind that your files are saved with a .txt extension and in plain text.
2. Use Notepad to make simple text edits
The Edit menu offers a few choices, but again, everything on this menu should be familiar to anyone who has used Windows. All the Edit choices have associated keyboard shortcuts. Note that most of the commands are greyed out until there is text selected in the Notepad window.
The first item on the Edit menu is Undo/Redo, which can be useful when you are editing the document. What appears in this place depends on what you have been doing. If you have just used the Undo command or pressed Ctrl + Z, you should see the Redo command at the top of the list (and its keyboard shortcut, Ctrl + Y).
The rest of the menu - Cut, Copy, Paste, Delete, Find, Find Next, Replace, Go To, Select All, and Time/Date, are standard in nearly all Windows programs that deal with documents.
3. Search and replace text in Notepad documents
Find, Find Next, and Replace are used to search and replace text in the document, while Go To can be used to navigate through it. To search for or replace a piece of text, select the Find option (keyboard shortcut Ctrl + F) or the Replace (Ctrl + H) option, depending on what you want. That makes Notepad open a box where you can type the text you're looking for in the "Find what" field. If you want to replace text, the Replace window also gives you a "Replace with" field. Either way, both Find and Replace include the same few search options:
You can decide whether the search should "Match case" the text and choose the Direction to be either Down or Up. Down means that the search is made starting from where your cursor is inside the text document until the end of the document. Up, on the other hand, performs the search from the cursor's position upwards, up to the beginning of the document. Unfortunately, neither option ensures that a search is done on the entire document unless you've placed the cursor at either the start or the end of the document.
Fortunately, you can ensure that your searches are performed on the entire document, from beginning to the end, by selecting the "Wrap around" setting. When Wrap around is on, Notepad uses your other search options too. However, if the Direction is set to Down, when it reaches the end of the document, Notepad automatically continues the search from the beginning and never stops. Similarly, if you set the Direction to Up, when the search reaches the beginning of the document, Wrap around automatically continues the search from the end of the document.
Go To is a less familiar command. You use Go To for jumping to a particular numbered line in the document. Go To only works if Word Wrap is turned off. If Word Wrap is on*, Go To* is greyed out.
4. Turn Word Wrap on or off
The Format menu offers you only two choices: Word Wrap and Font. For some unknown reason, Notepad has always come with Word Wrap turned off. This means everything you type ends up on one long line until you press Enter, which starts another long line.
You have the option of pressing Enter when your typing approaches the right margin of the Notepad window, but that makes the lines some arbitrary length depending on the size of your window. If you would like to see what you are typing without having to scroll all the way to the right, turn Word Wrap on. Then Notepad should behave just like any other word processing program and automatically wrap the text to the next line as you approach the right margin of your window.
In Windows 7, the Status Bar (which you can enable or disable from the View menu) is also linked with Word Wrap. If Word Wrap is off, you can see a notification on the lower border of your window, showing you where the cursor is currently located in a document that is not word-wrapped. If Word Wrap is on, the lower border is blank. In Windows 10, the Status Bar is on by default and shows line and column numbers regardless of whether you're using Word Wrap or not.
5. Zoom in and zoom out in Notepad (only in Windows 10)
If you're using Windows 10 with May 2020 Update or newer, Notepad also has another nifty feature: text zooming. You can use this feature to increase or decrease the size of the text so that it's easier to see on your screen.
To zoom text, open the View menu from the top of the Notepad window, select Zoom, and click or tap on Zoom In or Zoom Out. Repeat the same steps to further increase or decrease the zoom level. To go back to the normal zoom level, select "Restore Default Zoom" from the same menu.
Also, for a faster experience, you might want to remember that you can also use these keyboard shortcuts for adjusting the zoom level in Notepad:
- Zoom In - Ctrl + Plus
- Zoom Out - Ctrl + Minus
- Restore Default Zoom - Ctrl + 0
6. Change the font of the text document
The Font choice is self-explanatory: it offers you a list of all your installed fonts and the option to use bold, italic, and the like. However, unlike the way it works in programs like Microsoft Word, a change of font immediately affects the entire document. You cannot use one font in one part of the document and another font somewhere else. It is all or nothing.
In the Font menu, there is a less familiar option available, the drop-down menu labeled Script. This lets you choose characters that are not available in the standard "Western" style fonts. The choices are Western, Greek, Turkish, Baltic (not available in Windows 7), Central European, Cyrillic, and Vietnamese (not available in Windows 7). Choose a set, and you should see some representative characters above it. The Western set is selected by default, and you need to change it to another one if necessary.
7. Print text files with Notepad
If there is nothing else that you want to customize in the document that you're printing, open the File menu, and click or tap Print. If you do want to customize the print, first click or tap on Page Setup in the File menu.
In more sophisticated programs, Page Setup offers a long list of options. In Notepad, though, your choices are simple. You can choose the paper size and where your printer keeps the paper, the page orientation, and whether to have a header and footer (and the text to include in each).
By default, in Windows 10, there's no header or footer printed. In Windows 7, the text in the header is the name of the document and the date it was printed, and the text in the footer is the page number. If you want to customize the header and footer, type the texts you want to use for them. Note that you can also use some codes for printing the current date, time, name of the document, or page numbers. To see all the codes, click or tap on the Input Values link from the Page Setup window, or visit this page: Changing Header and Footer Commands in Notepad.
8. Save text files using different encodings
You can also use Save As to change the encoding of your file to match a particular character set. Here, a bit of text from our Romanian site digitalcitizen.ro has been cut and pasted into Notepad.
If you were to try to save this in ANSI encoding, which is the default option in the Notepad from Windows 7 and old versions of Windows 10, you would get a message that if you save it as plain text, all the formatting would be lost.
You have to choose the appropriate encoding from the drop-down list. This might take a little experimentation to get right, depending on the types of characters in the file, but starting with Unicode is a good bet. If you are not familiar with encoding, the first section of this tutorial should help explain it: Make Windows correctly display characters from languages other than English (set non-Unicode programs).
9. Save documents as HTML files
You can also use Notepad to create HTML files. Make sure that Word Wrap is turned on and type your HTML code the way you would type plain text. When it comes time to save your work, choose Save As, and select All Files from the list of choices. Then save your file with the .htm or .html extension.
Do you use Notepad for (light) text editing?
Notepad has been around for a long time and continues to be a useful desktop app for writing simple text and HTML. Sometimes, that is all you need. If you require more than just the basics, WordPad might be a better choice. It is built into all versions of Windows, too! Do you use Notepad regularly? If you do, please tell us how you find it useful in the comments below.