Hello,

"ranjith kumar" wrote :
>  Can someone tell me how add blow 2 lines at the begining of a file
> using vim substitution command (like ....1s/*/namespace f/ or
> %s/*/namespace f/)'
> line 1:  namespace family
> line 2 : {
> 
> 
> also at the end of the file I have to add  a new line containing '}]
> at the end of the file.

I think you'd better have a look at template-files expanders.
You have a non exhaustive list on vimtips:
   http://vim.wikia.com/wiki/Category:Automated_Text_Insertion

In case I haven't fully understood your need, and that you have a pre-existing 
file and want to surround its contents by "namespace { ...}", there also exist 
a few solutions that does that.
The keyword (for vim.wikia, vim.org, google, etc) is "surround". Regarding 
namespace and C++, I have my suite that provides a ,ns mapping to enclose the 
visual selection within a namespace.
   http://code.google.com/p/lh-vim/wiki/lhCpp
(for once the files have been committed recently, lh-cpp and mu-template need 
to be obtained from svn, lh-vim and searchinruntime can be obtained in the 
download section.)

HTH,

-- 
Luc Hermitte
http://lh-vim.googlecode.com/
http://hermitte.free.fr/vim/

-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Reply via email to