LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-25-2004, 10:16 AM   #1
LuderForChrist
Member
 
Registered: Jun 2004
Posts: 37

Rep: Reputation: 15
Way to many spaces


Im copying code from an eclipse platform, to vim 6.3 and when i copy it im getting way to many spaces before any text in the line. Each line gets more and more as it copies over as a large file.

Its like it tabs, the second copy line gets two tab and so on and so on.

Can I fix this?

thanks
 
Old 06-25-2004, 01:04 PM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390
Search for the following line:

set autoindent

in either /etc/vimrc (/etc/vim/vimrc) or ~/.vimrc.

If you remove it your problem will probably be solved.
 
Old 06-25-2004, 01:14 PM   #3
LuderForChrist
Member
 
Registered: Jun 2004
Posts: 37

Original Poster
Rep: Reputation: 15
sorry man, newbe totaly lost me
 
Old 06-25-2004, 03:20 PM   #4
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390
No need to be sorry, be glad you finaly found the path to glory

The editor you are using (vim 6.3) can be 'manipulated' to act a certain way. Just about everything you want can be set/unset.

2 files are generally used to do this:

/etc/vimrc or /etc/vim/vimrc, depending on the distro (redhad, suse, slack etc) you use.
This file is used to set global (all users, system wide) preferences for vim.

~/.vimrc
This file, which is in your home directory (~), is used to set personal preferences.

To edit the first one you need to become root, the second one should be edited by the owner of that file.

For now I'm only going to talk about 1 specific item that can be set. For more info about settings:
man vimtutor
man vim
http://www.vim.org/
files in /usr/share/vim/vim63/ (could be different depending on distro)

The behaviour you are describing looks like an 'indent' setting. This behaviour can be changed by changing either /etc/vimrc or ~/.vimrc. The setting I mentioned before (set autoindent) is probably the cause of the problem.

You could do 2 things:

1) Remove it from /etc/vimrc
2) 'Unset' it in your .vimrc file.

Assuming that you are not a programmer (yet) and are using vim for general editing, I recommend removing it from /etc/vimrc.

So, as root, open /etc/vimrc:

vi /etc/vimrc

Look for the autoindent line. I don't know how basic your vi knowledge is, so this might be a bit too simplefied

Make sure you are in 'command' mode: press <esc>
Search for autoindent, type the following /set autoindent<enter>

If autoindent is anywhere in the file, the cursor will jump to it (possibly highlighted).

To make sure you can return to the previous setting, don't remove it, but make it a 'comment'.
Goto the beginning of the line containing autoindent (either <home> or ^).
Switch to insert mode: i (you should be able to edit the line).
Insert a " to make it a comment line.

The entire line should now look something like this:
" set autoindent

Switch to command mode: <esc>
Save changes and quit: :wq
If vi complains about the file being readonly: :wq!

If you have troubles (with vi) and want to quit without saving anything: <esc><esc>:q!

This should get you going.

And, if unsure just ask.......

Last edited by druuna; 06-25-2004 at 03:23 PM.
 
Old 06-25-2004, 03:29 PM   #5
LuderForChrist
Member
 
Registered: Jun 2004
Posts: 37

Original Poster
Rep: Reputation: 15
great!!! thanks again
 
  


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
Is it possible to remove spaces Alex_jacobson Linux - General 4 01-16-2005 11:45 AM
cd to a directory with spaces? GT_Onizuka Linux - Newbie 3 08-28-2003 06:00 PM
dump name spaces mnauta Linux - General 4 05-29-2003 02:43 PM
spaces WindowsDefector Linux - Newbie 2 05-23-2002 03:03 AM
spaces in filenames ebone Linux - General 2 11-12-2001 12:56 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:08 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration