* [gentoo-user] OT: .vimrc
@ 2007-11-21 16:29 James
2007-11-21 16:49 ` Kenneth Prugh
0 siblings, 1 reply; 4+ messages in thread
From: James @ 2007-11-21 16:29 UTC (permalink / raw
To: gentoo-user
Hello,
I'm not the swiftest (hack) around with finessing the (bash) shell
and customizations for c/c++ (command line) programming. What I'm
doing is trying to setup .vimrc so that when I edit a file
(*.c or *.cpp) my shell uses the entries in the (user's) .vimrc file.
However any other file I access via 'vi' I want it to ignore these
customizations or use a second config file for 'vim' customizations.
Ideas on how to accomplish this are welcome.
I've stumbled across ideas on how to make .vimrc really cool for writing
c/c++ programs. I have not found a comprehensive reference on all of the
possibilities and what works. A wiki would be very cool. I've been
testing a custom setup for .vimrc:
set ai " autoindent
set si " smartindent
set cindent " do c-style indenting
set tabstop=3 " tab spacing settings below are just to unify it
set softtabstop=3 " unify
set shiftwidth=3 " unify
set noexpandtab " real tabs please!
set nowrap " do not wrap lines
set smarttab " use tabs at the start of a line, spaces elsewhere
Additionally, I'm experimenting with QT4 so any suggestions
related to QT4 are also appreciated. Any comments, ideas or resources
I can look at, would be most appreciated.
James
--
gentoo-user@gentoo.org mailing list
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [gentoo-user] OT: .vimrc
2007-11-21 16:29 [gentoo-user] OT: .vimrc James
@ 2007-11-21 16:49 ` Kenneth Prugh
2007-11-21 18:20 ` [gentoo-user] " James
0 siblings, 1 reply; 4+ messages in thread
From: Kenneth Prugh @ 2007-11-21 16:49 UTC (permalink / raw
To: gentoo-user
On Wed, 21 Nov 2007 16:29:39 +0000 (UTC)
James <wireless@tampabay.rr.com> wrote:
> Hello,
>
>
> I'm not the swiftest (hack) around with finessing the (bash) shell
> and customizations for c/c++ (command line) programming. What I'm
> doing is trying to setup .vimrc so that when I edit a file
> (*.c or *.cpp) my shell uses the entries in the (user's) .vimrc file.
> However any other file I access via 'vi' I want it to ignore these
> customizations or use a second config file for 'vim' customizations.
> Ideas on how to accomplish this are welcome.
>
>
> I've stumbled across ideas on how to make .vimrc really cool for
> writing c/c++ programs. I have not found a comprehensive reference on
> all of the possibilities and what works. A wiki would be very cool.
> I've been testing a custom setup for .vimrc:
>
> set ai " autoindent
> set si " smartindent
> set cindent " do c-style indenting
> set tabstop=3 " tab spacing settings below are just to
> unify it set softtabstop=3 " unify
> set shiftwidth=3 " unify
> set noexpandtab " real tabs please!
> set nowrap " do not wrap lines
> set smarttab " use tabs at the start of a line, spaces
> elsewhere
>
>
> Additionally, I'm experimenting with QT4 so any suggestions
> related to QT4 are also appreciated. Any comments, ideas or resources
> I can look at, would be most appreciated.
>
>
> James
>
>
hmm, have you tried something like:
autocmd BufRead,BufNewFile *.cpp set ai(or whatever options you want?)
that's how I did some stuff wrt to python...
--
gentoo-user@gentoo.org mailing list
^ permalink raw reply [flat|nested] 4+ messages in thread
* [gentoo-user] Re: OT: .vimrc
2007-11-21 16:49 ` Kenneth Prugh
@ 2007-11-21 18:20 ` James
2007-11-21 18:40 ` Kenneth Prugh
0 siblings, 1 reply; 4+ messages in thread
From: James @ 2007-11-21 18:20 UTC (permalink / raw
To: gentoo-user
Kenneth Prugh <ken69267 <at> gmail.com> writes:
> autocmd BufRead,BufNewFile *.cpp set ai(or whatever options you want?)
Here's my .vimrc file:
autocmd BufRead,BufNewFile *.c set {ai, si, cindent, tabstop=3, softtabstop=3}
I get this error when I source the .vimrc file:
source /home/james/.vimrc
bash: autocmd: command not found
Any suggestions?
James
--
gentoo-user@gentoo.org mailing list
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [gentoo-user] Re: OT: .vimrc
2007-11-21 18:20 ` [gentoo-user] " James
@ 2007-11-21 18:40 ` Kenneth Prugh
0 siblings, 0 replies; 4+ messages in thread
From: Kenneth Prugh @ 2007-11-21 18:40 UTC (permalink / raw
To: gentoo-user
On Wed, 21 Nov 2007 18:20:19 +0000 (UTC)
James <wireless@tampabay.rr.com> wrote:
> Kenneth Prugh <ken69267 <at> gmail.com> writes:
>
> > autocmd BufRead,BufNewFile *.cpp set ai(or whatever options you
> > want?)
>
>
> Here's my .vimrc file:
>
> autocmd BufRead,BufNewFile *.c set {ai, si, cindent, tabstop=3,
> softtabstop=3}
>
>
> I get this error when I source the .vimrc file:
>
> source /home/james/.vimrc
> bash: autocmd: command not found
>
>
> Any suggestions?
>
>
> James
>
>
>
>
Indeed sourcing will error out..
Just launch vim again and it should be using those new settings...
--
gentoo-user@gentoo.org mailing list
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2007-11-21 18:45 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-21 16:29 [gentoo-user] OT: .vimrc James
2007-11-21 16:49 ` Kenneth Prugh
2007-11-21 18:20 ` [gentoo-user] " James
2007-11-21 18:40 ` Kenneth Prugh
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox