Ok. This is the first article on the Tech page. I would like to share some of the tidbits related to Technology that I am working on and the Techonology that is of my interest.
To start of things, I would like to share a problem I faced with the “Vi” Editor in Linux. A few days ago I was trying to open a log file using the Vim (Vi Improved) editor on my linux box. Now the log file size was like a few hundred Megabytes.
U see, analysing source code or anything becomes very easy (at least for me) using Vi. It has support for regular expressions, tags etc which make searching and navigation thru source an easy task.
Ok. So I open this huge log file using vim, do my analysis and close the file and Vi. Now when I tried to open the same log file again, Vi just wont open the file. Even if it did, it would take ages for Vi to startup and display the file.
After a lot of trial and error and googling around, I found the root cause of the problem. It was an issue with the .viminfo file. The viminfo file is used to store:
The command line history.
- The search string history.
- The input-line history.
- Contents of registers.
- Marks for several files.
- File marks, pointing to locations in files.
- Last search/substitute pattern
- The buffer list.
- Global variables
Now when I had opened, searched and analysed the log file, the viminfo file started growing in size. It went on to grow to about a few MBs in size. Hence the loading of vim was slow. The solution to this problem is as follows.
- Open the .vimrc file location in your home directory. (Remember, this file is a hidden file, hence you would need to do a `ls -a` to show all the files in home)
- Add the followling configuration lines into the .vimrc file.
set viminfo=’20,\”50
The above configuration line means that, read/write a .viminfo file, dont store more than 50 lines of registers
Check out the other pages under Tech
You can find information about Linux command – Find – on this page.






