At times there is a need for a powerful text editor (and sometimes exclusively for the console). Under Linux, there are two very popular and expanding applications: Vim and Emacs. They both support the myriad functions, which, with the possibility of adding what is missing (if you need more than just a set text). This article will cover the first couple of the editors. Worth mentioning that both have huge army of fans and frequently erupted holivary about the best of them.
Vim means Vi Improved, improved vi. Vim developed from 1988 - the first year, so it is understandable why this is such a monster (though Emacs will pomonstruoznee). In addition, there are versions for various operating systems - such as Linux, Win16, Win32, DOS, various Unix, BeOS and many others. In addition, Vim uses many users quite unusual approach to editing the text: there are two modes - command (as is clear from the title, then used different commands) and Paste (directly enter text). So the first step is to at least a little bit (a lot better) deal with the principle of work and remember, as is being done. Do not hope that the article could even disclose any significant portion of opportunities vim (he is too powerful), but the basis for further study will be laid, and if you enjoy editor, it would be easier to absorb various wisdom.
Important note. When editing upper and lower case letters have different meanings (although sometimes close).
To begin with, let's find somewhere for editing. The demonstration will take place on the text of GPL v3 (GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007). But if you have any other text, it is not scared.
$ Cp / usr/share/common-licenses/GPL-3 ~ / temp /
$ Vim ~ / temp/GPL-3
Now we have opened vim to the file content (by the way, what is displayed on the screen, called a buffer), but not hurry to press anything, because all perceived as a pressing team, the shift in the mode inserts performed by pressing keys i. Once you enter that you need, press Esc to return to the team (or core, it is normal) mode. Now you can customize the text. To move can be used as arrows, and h (left), j (down), k (top), l (right). The main advantage hjkl that its use does not need to carry hand on the arrows, as a result of this (with proper practice) speed increases. To go to the top line, use 0 (zero), and by the end - $. According to Enter should jump to a new line to the first character, which is not a gap. A movement to the next floor head w. (And) move the cursor to the beginning and end of sentence, respectively. To search applies / go that (so many console). To find the next suitable element, click n, and to search in the opposite direction -? That go.
Sample
/ License - cursor at the first appearance of the word License
n - the second
? License - again on the first.
A particularly rich opportunities provides the so-called repetition rate, which recruited before calling the team. For example, 8/License moves the cursor to 8 - e hit License words in the text, and 15) moves the cursor to the end of 15 - the first sentence, starting from this. This is available for many commands and can very much easier life.
To delete button is used d (short for Delete). For example, dl 1 removes the character to the right (the same right d), dw removes the current word, d Enter removes the line and following it, d $ removes the text before the end of the line, and dd - an entire line. d / the text removes provisions of the cursor to the first meeting article the. If the combine, you can get something like 4d5w, that removes 4 times in five words (that is 20 words, starting with the current).
Copying text applies similarly disposal. In order for something to copy, use y. Box execute commands p and P. A separate function "cut" with Vim not. Its function is removal. Each time you delete text, it is placed in the clipboard (more precisely, into the buffer by default as they may be large quantities). For instance, to 6 lines in the buffer, you need to perform "a6yy, and thence to insert -" ap. During all these operations data in the ring buffer remain unchanged. Once you've produced, you can undo your changes by clicking u.
Above all, in Vim is the so-called command-line mode. To press its use:. It is precisely disclosed some features of the editor. Unlike the keys in command mode, there are no restrictions on the number of teams. For example,: syn includes a backlight syntax that conveniently when editing configuration files or source codes. Above all, there are very powerful and extensive help system, which can cause a command: help section.
To replace text, the command: s
Sample
: 1,35 s / GPL / AAAAAAA / - replaces text in the file "GPL" text "AAAAAAA" in rows with the first of 35 - yu. A: 1, $ s / License / SSSSSS / replaces throughout the License at SSSSSS.
Here is a list of commands:
: shell - a shell of the launch command Vim;
: w - writes the contents of the buffer to a file without breaking the vi;
: w! -- Writes the contents of the buffer to a file without breaking the vi (for Read Only files);
: w abc - writes the contents of the buffer to file abc (if not it will be established, otherwise - overwritten), without leaving vi;
: 1,10 w abc - writes lines 1 - and on 10 - to file yu abc;
: 'a, $ w abc - writes the lines of the line marked "a", until the last line abc;
: e abc - download the file for editing abc instead of the current file. Returns mistake, if changes in this file have not been saved;
: e! abc - download the file for editing abc, not paying attention to not saved changes in the current file;
: e # - download the file for editing previous (command: e # next);
: f abc - changes the name of the current buffer vi on abc;
: q - leaves the editor, if no changes are not saved;
: q! -- Goes and destroys with all the changes are not saved;
: r abc - abc file reads in the current buffer vi and puts his cursor;
:! cmd - performs command (who, sort, ls, etc.).
In addition, there are teams for direct settings editor. They are established with the help: set
: set option - activates option;
: set option = value - appoints value for the option;
: set no option - deactivates option;
: set - shows the options set by the user;
: set all - shows all options - as set by the user, and the option "by default";
: set option? -- Shows the importance of options.
For example,
: set number - includes numbered lines;
: set nonumber - numbering off lines.
This, of course, well, but the settings are working only from the current session, and the editor had to restart when they enter again. To solve this problem, you can create a file with user preferences.
$ Vim ~ /. Vimrc
Now you can in practice and test their knowledge. To Vim correctly read it, you can just write without a team at the beginning of the colon. For example, something like:
set nowrap
set autoindent
syn on
colorscheme evening
set number
set spell
Save and exit. Thus, the setting (of course, we recorded an extremely primitive configuration) will be loaded each time before starting.
Of course, vim supports much more (taboos, macros, autocompletion in programming, etc.), but this material enough for the whole book, not a small article. Also on the Internet mass of resources devoted to this remarkable editor. Learn!
At the symposium otklanivaetsya your humble servant. Prior to future meetings!
1) "Get Money for Clicks" NameDrive.com - Fastest Growing Domain Parking Company in the World. 2) Search your domain name wishing to have! FREE DOMAINS - yourname.co.cc
DISSERTATION RYAN DEVLIN As experts in academic writing at EditaPaper, we understand the immense significance of a dissertation, especially for students like Ryan Devlin who are embarking on this pivotal journey. A dissertation is the culmination of years of dedicated research, critical thinking, and scholarly contributions – a true testament to one's intellectual prowess and passion for their field of study. Ryan Devlin's dissertation is a shining example of the remarkable achievements that can be attained through perseverance, innovative thinking, and a steadfast commitment to advancing human knowledge. Delving into the complexities of a topic deeply meaningful to him, Ryan has demonstrated an unwavering dedication to his academic pursuits, pushing the boundaries of his discipline and inspiring others along the way. At EditaPaper, we've had the privilege of witnessing firsthand the transformative power of a well-crafted dissertation. It is through such groundbreaking work...
Any competent PR Specialist you will say: if the information needed an excuse, any intrigue could unleash literally on level ground. That's what seems to have been the company "RosBusinessConsulting" (RBC), seeking to make public the fact that among its assets added popular among Russian Internet users pager QIP. Let me remind you that QIP considered one of the most common in post-Soviet space programs for instant messaging. QIP 100% compatible with ICQ, as passed on a protocol Oscar - a proprietary protocol, developed by Israeli company Mirabilis - creator program ICQ. QIP main difference between the official ICQ-client is the lack of advertising - is an advantage and believes most users program. Plus, of course, given the absolute "bezglyuchnost" and stability coupled with the ease of use. Here you need to recall that the developer of ICQ (and at the same time and the ideology of Internet pagers) company Mirabilis few years ago was acquired by telecommunicati...
ESSAY ABOUT IVARI PADAR: EXAMPLE IN ENGLISH Introduction Ivari Padar is a name that has been etching its way into the collective consciousness of those fascinated by individuals who dare to forge their own path. As the EditaPaper => vk.cc/cMZDnO academic writing team, we've been captivated by Padar's journey – a story that encompasses creativity, resilience, and a relentless pursuit of authenticity. In an age where conformity can often be the default, Padar's willingness to challenge the status quo and carve out a unique identity is both inspiring and thought-provoking. In this essay, we delve into the multifaceted life and accomplishments of Ivari Padar, uncovering the lessons and insights that make their story so compelling for students and lifelong learners alike. 10 Facts About Ivari Padar Ivari Padar is a multidisciplinary artist hailing from a small town in Eastern Europe, known for their innovative approach to blending traditional and contemporary art forms. Despi...
DEFINITION ESSAY LAURA ZENG As experts in academic writing at EditaPaper, we understand the significance of the definition essay for students across various disciplines. The definition essay is a crucial tool in developing critical thinking, research skills, and the ability to articulate complex ideas concisely. And when it comes to tackling this assignment, the name "Laura Zeng" is one that deserves special attention. Laura Zeng is a shining example of a student who has mastered the art of the definition essay. Her work not only demonstrates a deep understanding of the genre but also showcases her exceptional writing abilities and intellectual prowess. In this article, we will delve into the intricacies of the definition essay, explore Laura Zeng's approach, and provide valuable insights that can help students excel in this important academic task. The definition essay is a unique form of writing that requires students to thoroughly examine and explain the meaning of a s...
THESIS STATEMENT ANDJELA SIMUNOVIC As experts in academic writing at EditaPaper, we understand the crucial role a well-crafted thesis statement plays in the success of any research paper or dissertation. Today, we're thrilled to dive into the topic of Andjela Simunovic's pioneering work on thesis statements, which has profoundly influenced the way students and scholars approach this essential element of scholarly writing. Andjela Simunovic is a renowned professor of English literature and composition at the University of Belgrade, Serbia. With over two decades of experience guiding students through the complexities of academic writing, Simunovic has become a leading authority on the art of crafting effective thesis statements. Her groundbreaking research and insightful publications have transformed the way we understand and approach this foundational component of scholarly work. One of Simunovic's key contributions is her emphasis on the thesis statement as the cornerstone ...
Comments
Post a Comment