Questions tagged [text-editing]

Text editing is the process of selecting and preparing text [files].

Text editing is the process of selecting and preparing text [files]. The editing process can involve correction, condensation, organization, and other modifications performed with an intention of producing a correct, consistent, accurate and complete work.

505 questions
209
votes
5 answers

How do you reuse a visual mode selection?

Often when editing code, I'll select a block in visual mode and do a search and replace over the block. After I make the changes, however, it leaves visual mode. How do you do a new find and replace over the same selection?
labyrinth
  • 2,546
  • 2
  • 17
  • 15
133
votes
6 answers

How do I reverse selected lines order in Vim?

For example, if I have four lines as follows: the first line the second line the third line the fourth line I want to reverse them to the fourth line the third line the second line the first line How could I do this in Vim?
Jichao
  • 7,145
  • 12
  • 52
  • 62
127
votes
4 answers

Replace \r\n with newline in Notepad++

How do I replace the string "\r\n" with the same characters? Example: Hello World.\r\nHello World. replaced with: Hello World. Hello World.
C. Ross
  • 6,174
  • 16
  • 62
  • 82
121
votes
18 answers

Substitution in text file **without** regular expressions

I need to substitute some text inside a text file with a replacement. Usually I would do something like sed -i 's/text/replacement/g' path/to/the/file The problem is that both text and replacement are complex strings containing dashes, slashes,…
Andrea
  • 1,415
  • 3
  • 10
  • 8
118
votes
5 answers

How to write multi lines in one Excel cell?

I want to write multi-lines in one MS Excel cell. But whenever I press the Enter key, the cell editing ends and the cursor moves to next cell. How can I avoid this?
Wahid Bitar
  • 1,895
  • 7
  • 20
  • 22
99
votes
10 answers

How can I split a large file on Windows?

Is there a tool to split large text file (9 GB) into smaller files, so that I can open it and look through? Is there anything usable from the command line that comes with Windows (XP)? Or what's the best way to split it? Can I use 7-Zip to create…
stefanB
  • 1,133
  • 1
  • 9
  • 9
84
votes
4 answers

How can I filter a file for lines containing a string in Sublime Text 2?

I want to filter a file I'm editing in Sublime Text 2 for lines contain a certain string, if possible including regular expressions. Consider the following file: foo bar baz qux quuux baz When filtered for ba, the result should be: foo…
Daniel Beck
  • 109,300
  • 14
  • 287
  • 334
65
votes
8 answers

emacs: how to indent/unindent region of python code by 4 spaces?

I have a region of python code selected in emacs. What are the most efficient ways to indent and unindent every line in it by 4 spaces? Ideally I'd like something that's not context sensitive (eg. it'll allow me to indent passages within docstrings…
Ian Mackinnon
  • 5,606
  • 5
  • 29
  • 33
65
votes
4 answers

How to make cut/copy/paste in GVim on Ubuntu work with Ctrl+X,Ctrl+C,Ctrl+V?

By default, the cut/copy/paste short-cuts in GVim on Ubuntu are: Cut "+x Copy "+y Paste "+gP I would like to use control key combos in GVim, like I use in Firefox and othe gnome applications. How do I configure GVim to work like other…
pcapademic
  • 3,711
  • 3
  • 31
  • 30
61
votes
9 answers

How can I edit a file if there is no vi, vim, joe, etc?

Is there a way to edit a file if there are no vi, vim, joe, mcedit? In another words is there a way to edit a file using just the shell commands?
Eduard Florinescu
  • 2,946
  • 7
  • 34
  • 45
61
votes
5 answers

Ctrl+Backspace inserts a small box instead of erasing

When I press Ctrl+Backspace, sometimes a small square is inserted, instead of the entire word being erased. The problem only happens in some text boxes; in others the shortcut works like it should. Start menu search box: works Notepad: doesn’t…
ugh
61
votes
3 answers

Why does the same data take more space in a text file than in an Excel file?

I have around 100000 rows of data. If I store this data in a text file format, it takes more space than if I store it in an Excel file format. Why is that?
user734178
  • 499
  • 1
  • 4
  • 4
58
votes
6 answers

What is the closest thing to Windows notepad on the Mac?

What is the closest thing to Windows notepad on the Mac? I'm using Leopard.
Brian R. Bondy
  • 2,650
  • 2
  • 20
  • 12
52
votes
5 answers

Notepad++ inserting special Unicode characters in UTF-8

What's the best ways to enter special Unicode characters into a Notepad++ document? Do I have to rely on the operating system (Windows)? Looking for a see-and-click solution. I can bring up the ASCII Insertion Panel with Edit | Character Panel —…
Bob Stein
  • 1,383
  • 1
  • 16
  • 23
48
votes
3 answers

Turn Off Parenthesis Matching in Sublime Text 2

I have questions about turn off parenthesis matching. Does anyone know how to turn off parenthesis matching? example: When I type a (, it will automatically add ), becomes (). It's pretty nice for editing plain text. But quite annoying while editing…
Juanito Fatas
  • 659
  • 1
  • 5
  • 9
1
2 3
33 34