Configuring vi / vim ?


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Configuring vi / vim ?
# 8  
Old 12-19-2014
The vi[m] command to show the non-default settings currently active, use the command:
Code:
:set

To see the current settings of all of your vi or vim options, use the command:
Code:
:set all

# 9  
Old 12-22-2014
Well, to quote Albert the Alligator from the old comic strip "Pogo", this just gets "curiosor and curiosor". I scp'd a file from another linux server and started editing it, and no longer get the auto indent/auto comment behavior. Not just in that file, but any other - including new ones created from scratch. This is the behavior I want, but I don't know why it started behaving this way. I have not knowingly done anything to change the behavior.

-- Edit -- and even as I posted the above - now I observe that only one files behaves 'properly'. The other 5 still 'auto comment'. If I open (create) a new file, it does not 'auto comment' until I save/exit (:qw). The next time I open it, it exhibits the 'auto comment' behavior.

Last edited by edstevens; 12-22-2014 at 10:25 AM..
# 10  
Old 12-22-2014
I'm lost. What is 'auto comment' behavior?

And, just for the fun of it, what is the output from the command:
Code:
set|grep EXINIT

# 11  
Old 12-23-2014
Quote:
Originally Posted by Don Cragun
I'm lost. What is 'auto comment' behavior?

And, just for the fun of it, what is the output from the command:
Code:
set|grep EXINIT

By "auto comment" I'm referring to the behavior described in my first post, wherein if I add a line following a commented line "#" in the first character) the new line is automatically commented. (sorry, it just occurred to me that I was assuming editing of shell scripts, and their comment character.)

The env command returned nothing.

I read some more 'auto detection of file type' and discovered that if I created my own .vimrc file (not relying solely on /etc/vimrc) and added "#!/bin/sh" (or similar) to the top of a file, then it would not behave this way. That explains the difference in behavior between different files on the new server, but not the difference in behavior between the new and old servers. Perhaps if I dug deeper I'd find a difference in the way the two systems were handling file type detection? This is all new to me. I've been using vi (vim) for many years and have never had to give a single thought to how this is configured. Wasn't even aware of it until I hit this issue and started trying to run it to ground.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Vim :f

Can someone please tell me what this does? :f word I thought that was the way to save files with a different name but after a quick google search I saw it was like this. :w filename (4 Replies)
Discussion started by: cokedude
4 Replies

2. Solaris

Very Importan - Vim Settings - Error while opening a File using vim

I downloaded vim.7.2 and compiled the vim source . Added the vim binary path to PATH (Because iam not the root of the box) when i load the file using vim it throws me an error Error detected while processing /home2/e3003091/.vimrc: line 2: E185: Cannot find color scheme darkblue line... (0 Replies)
Discussion started by: girija
0 Replies

3. UNIX for Dummies Questions & Answers

pico vs vim

I always used pico as a text editor in Terminal or SSH. But what is the advantages/disadvantages between vim and pico? (7 Replies)
Discussion started by: timgolding
7 Replies

4. UNIX and Linux Applications

vim in solaris 10

Hi I tried to install vim7.2 in solaris 10 x86 , installation completed but not able to get vim to be use. dependency binary: gtk+ , glib & ncurses install dependency binary package and then install vim7.2. #pkgadd -d vim-7.2-sol10-x86-local $ pkginfo SMCvim application SMCvim vim ... (4 Replies)
Discussion started by: bangbong
4 Replies

5. UNIX for Dummies Questions & Answers

Vim: help with substitution

What is the appropriate command should i use to insert a character(example A) in front of line 1 to line 200...Pls help (7 Replies)
Discussion started by: 793589
7 Replies

6. UNIX for Advanced & Expert Users

vim

Does anyone know the fast way to go to tab/2 distance in vim. I mean set four spaces. (1 Reply)
Discussion started by: mirusnet
1 Replies

7. UNIX and Linux Applications

Help with Vim

How do I use compilers and syntax highlighting in (g)Vim? Specifically, I need a Common Lisp compiler and a C++ compiler. Thanks in advance! (Note: Disregard my other topic.) (1 Reply)
Discussion started by: led3234
1 Replies

8. UNIX for Advanced & Expert Users

About Vim

Hello, what is the maximum size of a file that we can open using vim. (3 Replies)
Discussion started by: nagalenoj
3 Replies

9. UNIX for Dummies Questions & Answers

Need some help with vim

I use vim for writing code. I was using nano but found that vim is a much advanced editor. I am trying to achieve something like this: When trying a loop or a function, I generally type: function name() {} Now when I take my cursor one position to the left and press the return key, it give... (4 Replies)
Discussion started by: Legend986
4 Replies

10. Solaris

Vim 7.0

I want to install VIM 7.0 from sunfreeware.com onto a server. The security guys are giving me a hard time because they found this security vulnerability. http://xforce.iss.net/xforce/xfdb/6259 This vulnerability came out in 2001, and it looks like it was mostly for linux, but I cant be... (1 Reply)
Discussion started by: BG_JrAdmin
1 Replies
Login or Register to Ask a Question