Linux 0 Basic Admission 1-5 Vim editor usage and Xmanager Remote Tools use

Source: Internet
Author: User
Tags save file



"Content of this section"



Introduction to VIM Main mode



Vim Command mode



Vim insertion Mode



VIM command line mode



Vim Visualization mode



Setting up the VIM development environment



Gedit A.txt &



Xmanager use of Remote Tools






Vim Editor mode switch:



Command mode, command line mode, edit mode



: INSERT





" Command mode , edit mode "



Character Manipulation                 



I insert before current character



I Line Header Insertion



A after the current character is inserted



A Line End Insertion



ESC exits the current mode



o Insert Next line



O Insert Previous Line



x Delete one word backwards descriptor Del



X forward Delete one word descriptor backspace



U undo one-Step operation



Ctrl+r Restore Previous action



Row Operations



Home key or ^ beginning of line



$ end of line with End key



DD Cut one line



NDD cut n rows, the cursor is in the first line of behavior, down n rows



YY Copy a row



NYY copy n rows, the first line of the cursor's behavior, copy the following n rows



P copy Line is pasted on the next line of the cursor



D + HOME (or ^) cut all characters from the previous bit to the beginning of the cursor



D + END (or $) clipping cursor to all characters at end of line



Word manipulation



DW Deletes a word and moves the cursor to the beginning of the word when it is deleted. In addition, if



The letter after the cursor is deleted when the cursor is not at the beginning of the line.



W positioning the first word, switching words



e position ending, toggle word



Yw/ye Copy a word



Point Operation



. Repeat the last command



[n] n times repeat last command



Quick Operation



D or d+$ Delete to the end of the line



d+^ Delete to the beginning of the line



y+$ copy cursor bit to tail



y+^ copy cursor previous to top



v mode



Enter v Mode Move the cursor selection area



Example: Multi-line Comment



1. Note:Ctrl + V enters column edit mode



2. Move the cursor down or up



3. Mark the beginning of the line to be annotated



4. And then press the uppercase I



5. Then insert an annotation , such as "#"



6. Press ESC again, and you'll be all commented.



VIM command line mode operation                     



: W Save



: Q did not make any changes, quit



: q! Modified, not saved, forced to quit



: Wq Save and exit with ZZ


: wq! Force Save and exit


Replace



:% s/a/b The first a in each line is replaced by B



:% s/a/b/g replaces all a in the text with a B






: N1,N2 s/a/b/g replaces N1 to N2 A is B



: Set Nu/nonu Show/Hide line numbers



/Forward Lookup



:/target n looks down, N looks up



Noh to highlight, or to find a group of characters



:!ifconfig Call System command



Edit file directory



If you accidentally open the directory, you can exit directly.



Navigate to a row in vim



GG positioning to the beginning of the first line



G navigates to the last row, beginning of line



NG navigates to N rows



: N navigates to the beginning of line n



Ngg to the beginning of n lines



read other files                   



: R/etc/ssh/sshd_config.bak #将sshd_config. bak content added to the file being edited



Vim opens multiple files :



[Email protected] ~]# Vim-o/etc/passwd/etc/hosts



#同时编辑2个文件 and display on top and bottom of the screen



[Email protected] ~]# Vim-o/etc/passwd/etc/hosts



#同时编辑2个文件, and display with left and right split screen



CTRL+WW #在文件之间进行切换



"Combat 1"






In Windows editing good kanji text document, upload to Linux under open garbled.



[Email protected] ~]# rpm-ivh/mnt/packages/lrzsz-0.12.20-36.el7.x86_64.rpm



RZ upload



SZ Download






[Email protected] ~]# rpm-qf ' which iconv '



Glibc-common-2.17-105.el7.x86_64



[Email protected] ~]# rpm-ihv/mnt/packages/glibc-common-2.17-105.el7.x86_64.rpm



transcoding via Iconv command



Input/output format specification:
-F,--from-code= name original text encoding
-O,--output=file output file
-L,--list enumeration of all known character sets



[[Email protected] ~] #iconv-F gb2312 c.txt-o C2.txt



[Email protected] ~]# Catc2.txt



#!/bin/bash



echo "Learning God It"



echo "Learning God It"



echo "Learning God It"



echo "Learning God It"



echo "Learning God It"






Troubleshoot problems with opening a serial on a company server script to Windows



This is because Windows and Linux handle carriage returns differently.



The Linux system handles carriage return "\ n" in Windows system to handle carriage return using "\ r \ n"











Method One: Open through Windows WordPad or in a Word document



Method Two:



[Email protected] ~]# rpm-ivh/mnt/packages/dos2unix-6.0.3-4.el7.x86_64.rpm



Warning:/mnt/packages/dos2unix-6.0.3-4.el7.x86_64.rpm:header V3 rsa/sha256 signature,key ID Fd431d51:nokey



Preparing ################### ############## [100%]



Updating/installing ...



1:dos2unix-6.0.3-4.el7 #################################[100%]



[[Email protected] ~] #unix2dos b.sh



Unix2dos:convertingfile b.sh to DOS format ...








"Use of Xmanager Remote Tools"



Set the IP address and port number of the connected server








Enter the user name and password for the authorization








Specify the type of server to be connected and how to encode it








Set the font, font size, color,








Specify local save file path








Temporary settings after connecting the terminal











Welcome to the lunch to read, the text if there is a problem, but also look feel free, thank you!









This article is from a "non-secure" blog, so be sure to keep this source http://renzhe27.blog.51cto.com/1735477/1765947



Linux 0 Basic Admission 1-5 Vim editor usage and Xmanager Remote Tools use


Related Article

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.