What is the difference between left arrow and enter key when comparing text files in Tortoise SVN? - tortoisesvn

I have two text files and I am trying to compare them using Tortoise SVN.
When I look the file with left arrow in notepad, the rows are all aligned but when I look at it in Notepad++, they are in next line.

It has to be a whitespace or EOL character.

Related

Any ideas on how to format these lines in vim?

I have the following lines that I've already formatted quite a bit, but I can't seem to figure out how to format these jagged lines so they are all in the correct position. I've been trying using macros and also using /s but it just seems the tabs or spaces after the word is a bit different for each. What might be a good way to format this here?
You can select the entire part you want to format and then use the normal command
'<,'>s/\([^: ]\+\)[ ]*:[ ]*\([^: ]*\)/\=printf('%-8s%8s%s%8s%8s',submatch(1),' ',':',' ',submatch(2))/g
which will pad the result evenly around the :.
You can select in vim using v then enter normal mode with esc followed by entering command mode with :. Paste the above line in command mode once the selection is made and hit enter.
Use vim-easy-align. And Select the text you need to align. Input ga*:. Done.

How to insert a character when editing a file using ISPF Edit via TN3270?

The editor in mvs3.8 TK4- is very different from the editors that I have used in Windows and Linux. I am trying to figure out how to insert a character between two characters in the editor. For example:
//HERC01C JOB (COBOL),
If i want to insert an O after C to //HERC01CO JOB (COBOL), the only ways i can do are by backspacing from the end of the line upto C and type everything after that again; or by moving all the characters to a position to the right using )1 command and the typing over everything form the beginning till C. Is there a way to add O here after C so that it will insert O and automatically move all the characters after that one place to the right?
I am presuming you are using the ISPF editor
enter nulls on in the command line. This will convert trailing spaces to nulls
if the line is full, you will need to split it
position cursor where you want to enter the new character
Make sure you are in insert mode the insert key swaps between insert and over-write modes.
Type the character.

mouse select copy from "vim" and "less" show different results

Case1: Open file1 in vi. Select a few lines(select copy is enabled). Paste in a different place.
Case 2: run the command less file1. From the console, select some lines. Paste in a different place.
In case2, I see that there are new lines introduced at where the line display shifts to new line. So, if the terminal width is 80 characters and my line is 100 characters, then 20 characters will be shown in the new line. If I copy from vim, all 100 characters are copied without any line-break. However, if I copy from "less" command, line-break is introduced after 80th character.
This messes up things like path.
Does "less" introduce line-break dynamically for lines longer than the display width?
less is not designed to handle mouse events. So when you select text while running it, the selection will be handled by the terminal behind, which doesn't give any sense to lines, paragraphs and so on; the text buffer is copied as it is displayed, that's all.
On the opposite, if you use vim with the right configuration, mouse events will be detected and treated by vim itself : the terminal will gracefully let vim handle them, for convenience. Then the line layout will be restored correctly when copying lines of text.

How to copy/paste text from vi to different applications

Is it possible to copy/paste text without using :vs? If I have two vi windows open, I can copy/paste text with a mouse. How can I do it with a keyboard?
I found two existing questions that are similar to this, but neither one answers my question.
how to copy codes in vi to clipboard
Copy and paste content from one file to another file in VI
I'm sure there are many ways, but I do it using marks and registers.
Marks
You can place a mark anywhere in a file using m followed by the name of the mark you want to use.
You can use any letter between a and z (capital and lowercase) to name your marks.
You can go to the line that contains a mark with the ' key.
For example, mx marks a line with mark x and 'x moves the cursor to the line containing mark x.
You can go to the exact location of a mark using the backtick key: `
To yank from the current cursor location to the line containing mark x, for example, you would enter y'x
Registers
In order to use the clipboard, you need to use registers, which represent places you can store the text you yank.
Just like you can use different marks for each character, you can name the registers you yank text to.
You refer to a register by using the " key when yanking/putting.
For example "ay'x would yank the text between the cursor and the line containing x to register a.
The clipboard is represented by a special register: either * or + depending on your environment.
To yank the text between the cursor and the line containing mark x to the clipboard, enter the following: "+y'x
This says: use buffer + (the clipboard) to store the text between the cursor and the line containing mark x.
Once you do this, your text will be in the clipboard. You can use CONTROL-V to paste it into other apps.
NOTE: In some environments, the clipboard is represented by the buffer named *.
This may sound overwhelming, but once you get used to it, it's VERY powerful.
I use this hundreds of times every day.
If you're editing a file that has several key points of interest, you can mark each part of the file with different marks and quickly move your cursor between the code you need to edit.
Likewise, if you have several pieces of text that you need to repeatedly copy, you can store each one in a different register to make your pasting more efficient.
You can copy/paste by using the + register (read more: Accessing the system clipboard)
"+gyywill yank a line, and put it into the + register. You can paste in your other window with "+p in normal mode, or Ctrl+r + while in insert mode.
If you don't wish to use split windows, there really is no other way to paste between windows apart from using the system clipboard.
#up exhausted the subject. I can just add that most of the combination related is with associated with system key combination find you in config for Gvim (eg. windows mapping for CTRL+C CTRL+V etc. is in mswin.vim)

How to delete selected text in the vi editor

I am using PuTTY and the vi editor. If I select five lines using my mouse and I want to delete those lines, how can I do that?
Also, how can I select the lines using my keyboard as I can in Windows where I press Shift and move the arrows to select the text? How can I do that in vi?
I am using PuTTY and the vi editor. If I select five lines using my mouse and I want to delete those lines, how can I do that?
Forget the mouse. To remove 5 lines, either:
Go to the first line and type d5d (dd deletes one line, d5d deletes 5 lines) ~or~
Type Shift-v to enter linewise selection mode, then move the cursor down using j (yes, use h, j, k and l to move left, down, up, right respectively, that's much more efficient than using the arrows) and type d to delete the selection.
Also, how can I select the lines using my keyboard as I can in Windows where I press Shift and move the arrows to select the text? How can I do that in vi?
As I said, either use Shift-v to enter linewise selection mode or v to enter characterwise selection mode or Ctrl-v to enter blockwise selection mode. Then move with h, j, k and l.
I suggest spending some time with the Vim Tutor (run vimtutor) to get more familiar with Vim in a very didactic way.
See also
This answer to What is your most productive shortcut with Vim? (one of my favorite answers on SO).
Efficient Editing With vim
Do it the vi way.
To delete 5 lines press: 5dd ( 5 delete )
To select ( actually copy them to the clipboard ) you type: 10yy
It is a bit hard to grasp, but very handy to learn when using those remote terminals
Be aware of the learning curves for some editors:
(source: calver at unix.rulez.org)
If you want to delete using line numbers you can use:
:startingline, last line d
Example:
:7,20 d
This example will delete line 7 to 20.
Highlighting with your mouse only highlights characters on the terminal. VI doesn't really get this information, so you have to highlight differently.
Press 'v' to enter a select mode, and use arrow keys to move that around. To delete, press x.
To select lines at a time, press shift+v.
To select blocks, try ctrl+v. That's good for, say, inserting lots of comment lines in front of your code :).
I'm OK with VI, but it took me a while to improve. My work mates recommended me this cheat sheet. I keep a printout on the wall for those odd moments when I forget something.
Happy hacking!
When using a terminal like PuTTY, usually mouse clicks and selections are not transmitted to the remote system. So, vi has no idea that you just selected some text. (There are exceptions to this, but in general mouse actions aren't transmitted.)
To delete multiple lines in vi, use something like 5dd to delete 5 lines.
If you're not using Vim, I would strongly recommend doing so. You can use visual selection, where you press V to start a visual block, move the cursor to the other end, and press d to delete (or any other editing command, such as y to copy).
If you want to remove all lines in a file from your current line number, use dG, it will delete all lines (shift g) mean end of file

Resources