LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-07-2015, 11:08 AM   #1
Duglas
Member
 
Registered: Mar 2009
Distribution: Debian
Posts: 69

Rep: Reputation: 2
What is the "~" after the last line in Vim?


What is the "~" for, after the last line in Vim?
I have written some Bash scripts in Vim, and in some of them, the "~" after the last line has been changed to an "@".
I am able to fix the issue by copying the old file over to a new file.
However I would like an explanation on what the "~" is for, and why it got changed.
 
Old 09-07-2015, 11:25 AM   #2
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4885Reputation: 4885Reputation: 4885Reputation: 4885Reputation: 4885Reputation: 4885Reputation: 4885Reputation: 4885Reputation: 4885Reputation: 4885Reputation: 4885
The ~ after the last line is not part of the text file and merely there to indicate where the file ends. I have never seen this switched to an @ character, though.
 
Old 09-10-2015, 02:04 AM   #3
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,308

Rep: Reputation: 2744Reputation: 2744Reputation: 2744Reputation: 2744Reputation: 2744Reputation: 2744Reputation: 2744Reputation: 2744Reputation: 2744Reputation: 2744Reputation: 2744
I agree with TobiSGD re '~'.
I can generate this
Code:
sds
dssd
sdsd
d
sd
s
d
d

@
@                                                                                                                                   
@
by simply ensuring that the "last line" is longer than will fit in entirely into the current terminal size of the vim session.
In actual fact, its just a long bunch of 'a' chars.

If you setup a longish line, then resize the height of the session using drag/drop on the bottom of the window, you'll see what I mean.

HTH
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Fedora shows 'man vim' but when execute 'vim' got "bash: vim: command not found..." ? flash_os Linux - Newbie 19 01-03-2015 11:56 PM
[SOLVED] grep text from a line in between "start" and "end" word deepakdeore2004 Programming 7 08-07-2013 09:45 AM
[SOLVED] Correlation between "free -m" shared line & "/proc/meminfo" shmem RHEL 6.2 - Anyone? xenner Linux - General 3 11-15-2012 05:36 PM
[SOLVED] sql: put "beginning of line" and "end of line" within a charset... masavini Programming 7 09-19-2012 08:03 AM
[SOLVED] how can I search "$" in vim ,which is not the end of line but the real char '$'. e3399 Linux - Newbie 1 12-01-2010 10:01 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:48 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration