LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices


Reply
  Search this Thread
Old 04-20-2008, 06:46 PM   #1
wildcat22
Member
 
Registered: Nov 2003
Location: USA
Distribution: Ubuntu
Posts: 102

Rep: Reputation: 15
vim headaches


Hey Everyone,

Not sure if this might end up belonging in a Ubuntu specific thread, but here goes.

Despite the contradictory nature of it, I use vim to edit my ".emacs" file.

Naturally, I'm not as familiar with vim's ways.

The problem: I have a commented line in my ".emacs", this is one or more semicolons ( ; ), and I press return, and I get up to three semicolons on the next line.

My ".vimrc" is empty (or extremely minimal).

This is a major annoyance to me. Any ideas how to turn it off??

Last edited by wildcat22; 04-20-2008 at 08:49 PM.
 
Old 04-21-2008, 03:35 AM   #2
Su-Shee
Member
 
Registered: Sep 2007
Location: Berlin
Distribution: Slackware
Posts: 510

Rep: Reputation: 53
Well, that depends on what your return pressing should actually result in.

Insert a line break? Than you'll have to press "i" for insert first as you have to change between the different modes in vim - command mode, insert mode and so on.

I suggest reading a vim tutorial first for the handful of basic commands you actually need.

A minimal, more convenient .vimrc may contain the following lines:

Code:
set nocompatible
set bs=2                
set backup
set ruler
 
Old 04-21-2008, 06:19 AM   #3
wildcat22
Member
 
Registered: Nov 2003
Location: USA
Distribution: Ubuntu
Posts: 102

Original Poster
Rep: Reputation: 15
Alright, I may have sounded a bit too new there. I am fairly well exercised with vim. Plenty enough to know the difference and the ins and outs of Insert and Command mode. And my vimrc has exactly that in it.

This may have something to do with vims Lisp/Scheme mode, if such a thing exists. So, to reiterate, in Insert mode, I start a line with one or more semicolons, press return, and Automatically, the next line gets populated with at most 3 semicolons at the beginning. It would be a handy feature if all you did was write comments, and never wanted to code.
 
Old 04-21-2008, 04:21 PM   #4
Junior Hacker
Senior Member
 
Registered: Jan 2005
Location: North America
Distribution: Debian testing Mandriva Ubuntu
Posts: 2,687

Rep: Reputation: 61
When I use vim, I hit the escape key when I'm done one line, then hit the (o) key to start in insert mode on a new line below the one I'm on. To get a quick easy 30 minute tutorial on using vim, type: vimtutor in a terminal when a full version of vim is installed, not just vim-tiny.
 
Old 04-21-2008, 04:55 PM   #5
wildcat22
Member
 
Registered: Nov 2003
Location: USA
Distribution: Ubuntu
Posts: 102

Original Poster
Rep: Reputation: 15
As I stated, I'm more experienced than to need instructions on how to get to the next line.

Anyone, who's read my post, any other ideas? Even better, if you use Ubuntu, give it a shot?

Thanks

Last edited by wildcat22; 04-21-2008 at 07:45 PM.
 
Old 04-24-2008, 08:53 AM   #6
harryhaller
Member
 
Registered: Sep 2004
Distribution: Slackware-14.2
Posts: 468

Rep: Reputation: Disabled
Wildcat - I think this because of the syntax file.

Vim is inserting the semi-colon as a writing aid since it assumes you are continuing writing commentaries - you just have to backspace to delete the semi-colon and the next line won't have colon.

OR try the command :syntax off
 
Old 04-24-2008, 09:26 AM   #7
wildcat22
Member
 
Registered: Nov 2003
Location: USA
Distribution: Ubuntu
Posts: 102

Original Poster
Rep: Reputation: 15
Good thought - but IIRC the ":syntax on" is also responsible for syntax highlighting...

Will try it out though.
 
Old 04-24-2008, 03:26 PM   #8
wildcat22
Member
 
Registered: Nov 2003
Location: USA
Distribution: Ubuntu
Posts: 102

Original Poster
Rep: Reputation: 15
As it turns out, this has a lot to do with formatoptions (fo)

To turn it off on a per file basis:

Code:
 :set fo-=ro
As yet I'm not sure how to disable it entirely, as it seems to be intertwined with autocmd's, that depend on the type of buffer, and indentation and other syntactic sugar.
 
Old 04-24-2008, 07:01 PM   #9
wildcat22
Member
 
Registered: Nov 2003
Location: USA
Distribution: Ubuntu
Posts: 102

Original Poster
Rep: Reputation: 15
Ah Ha!

Finally, the Answer.

http://peox.net/articles/vimconfig.html

Disable plugins, and all will be happy.
 
  


Reply



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
VIM Users: Do you use VIM via console or gui? JMJ_coder Linux - General 48 04-16-2008 03:12 AM
LXer: Vim tips: Using Vim mappings and abbreviations LXer Syndicated Linux News 0 06-18-2006 01:54 PM
LXer: Cream for Vim - Making Vim more user friendly LXer Syndicated Linux News 0 06-17-2006 11:54 PM
X Headaches roc Slackware - Installation 3 07-14-2005 10:53 AM
QT headaches Pi Man Linux - Software 2 10-16-2004 11:20 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop

All times are GMT -5. The time now is 04:47 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