Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the Dollar sign ("$") at the end of every line in Vim

Tags:

I am relatively new to Vim. Whenever I start Vim using vim LearnRuby.rb, a dollar sign appears at every line.

Why?

like image 720
mu_sa Avatar asked Jul 31 '12 07:07

mu_sa


People also ask

What does dollar sign mean in Vim?

Vim range selection In addition to literal line numbers, you can use a period ( . ) to represent the current line, a dollar sign ( $ ) to represent the last line in the file buffer, and a percent sign ( % ) to represent the entire file.

How do you append to the end of the line in vi )?

Type A to add text to the end of a line. To see how this command works, position the cursor anywhere on a text line and type A . The cursor moves to the end of the line, where you can type your additions. Press Esc when you are finished.

How do you add a string at the end of each line in Vim?

On a character in the first line, press Ctrl-V (or Ctrl-Q if Ctrl-V is paste). Press jj to extend the visual block over three lines. Press $ to extend the visual block to the end of each line. Press A then space then type Hello world.

How do I scroll to the end in Vim?

Move cursor to end of file in vim In short press the Esc key and then press Shift + G to move cursor to end of file in vi or vim text editor under Linux and Unix-like systems.


2 Answers

:set nolist

will turn off special characters for the current buffer, such as tabs being presented as ^I and end of line characters showing up as $.

However, if it's doing that consistently when you run vim, you need to look into your .vimrc (or other startup file where applicable) and find out what's doing the set list that causes it.

like image 189
paxdiablo Avatar answered Sep 27 '22 22:09

paxdiablo


Open ~/.vimrc and check its contents
If you see a line like this:

set list

It means, it will display $ in every line to mark the end of line.
Either remove it or use :set nolist command in the vi editor.

like image 24
cppcoder Avatar answered Oct 01 '22 22:10

cppcoder