Subj : 2wk vim challenge To : candycane From : Nelgin Date : Thu Aug 17 2023 22:58:20 Re: 2wk vim challenge By: candycane to Nelgin on Thu Aug 17 2023 22:13:50 > Yea! I only know a few commands off hand Most of those you can prefix with a number for example 9dd will delete 9 lines 10l will move the cursor left 10 spaces. 80i. will insert 80 dots. This is really useful if you have a wide terminal but want to make something that's 80 columns. If you want to insert hex characters or escape sequences CTRL-V CTRL-whatever. For example ^V^A will insert a CTRL-A (ascii 1) into your file. CTRL Vx followed by two hex characters will insert that hex value. Example ^vx80 will insert <88> to indicate the hex value. This is useful when using the ansi control commands to move the cursor forward without having to enter spaces. For search and replace :%s/this/that/g will replace eveything in the file. Use ^ to match the start of line so :%s/^abc/def/g will replace all entries on all lines that start with abc with def. You can use $ to match end of line :%s/the end$/almost the end, and some more/g :g/ can be used in a similar manner. You can use :set hlsearch or :set nohlsearch so when you use / to search, it'll highlight any matches or not. One last time, if you are using a dark background terminal and can't see blue on black, try :set bg=dark and it'll change the colors to make them easier to see. To make some of these permanent, you can create a .vimrc file in your home directory with a list of comamnds like set hlsearch set bg=dark and they'll be loaded by default. Hmm what else can I tell you vi file +nn where nn is a line number, it'll take you right to that line. Syntex error in line 746 vi file +746 You can use :nn to jump to a line number so :65 will take you to line 65. You can write part of a file to a new file. for example :5-10w newfile or :w.+50 extract.txt will go from the current line (.) and write the next 50 to a new file. :0 or :$ take you to the top or bottom of the file. Yes, I've been using vi since 1988 and I still have a ton to learn myself!! let me know if you want me to post more stuff, I'd be happy to do so. .