newbie questions

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

newbie questions

development-5
hi,

VIM is totally alien to me =) born and raised on editplus I am seriously
fascinated and happy I finally arrived at VIM =)

Few questions.

First, how do I save my preferences for font, for all file types, and
particular highlighting/line numbers and such for some file types?

In my particular situation, I have a sort of library of
functions/classes/subroutines(I use asp), is there any way to setup a script
of some sort that would open a function file after double click on the
function's name in the editor split window?

the library directory is either parallel to the directory in which I am
editing a script at the moment, or I may be editing a function file already
in the library directory, in which case the file will need to open the
function file in same directory on double click.

Is it at all possible?

Or perhaps a function key to open the library file of the function that
cursor is on?


TIA


Reply | Threaded
Open this post in threaded view
|

Re: newbie questions

John (Eljay) Love-Jensen
> do I save my preferences for font, for all file types, and particular
highlighting/line numbers and such for some file types?

Put font preferences in ~/.gvimrc (since font preferences don't make sense
in ~/.vimrc).

Put highlight preferences in ~/.vim/after/syntax/syncolor.vim

> In my particular situation, I have a sort of library of
functions/classes/subroutines(I use asp), is there any way to setup a script of
some sort that would open a function file after double click on the function's
name in the editor split window?

I believe so.  If there is, I'm not familiar with it myself.  But it sounds
very useful.

> Is it at all possible?

Yes.

> Or perhaps a function key to open the library file of the function that cursor
is on?

Yes, I believe that has also been done.  Again, I'm not familiar with the
details.

HTH,
--Eljay


Reply | Threaded
Open this post in threaded view
|

Re: newbie questions

Tim Chase-2
In addition to Eljay's worthy suggestions...

> Put highlight preferences in ~/.vim/after/syntax/syncolor.vim

you can create your own colorscheme, as detailed in the help under

        :help new-color-scheme

(note for help-maintainer(s)...perhaps a link from ":help
colorscheme" to the help on creating your own colorscheme would
be a helpful addition?  Or maybe there already is in versions
later than my 6.0 here at work)

>> In my particular situation, I have a sort of library of
>> functions/classes/subroutines(I use asp), is there any way
>> to setup a script of some sort that would open a function
>> file after double click on the function's name in the editor
>> split window?

This sounds a bit like the stuff "tags" were created to do.  An
auxilary program called "ctags" (or "jtags") will scan a variety
of languages (most are C-ish like C/C++/Java, though "Exuberant
ctags" also does Fortran & Eiffel and others:
http://ctags.sf.net  There's also a "ptags.py" for Python and a
"ptags" for Perl) and spit out a file named "tags".  You can then
use control+] to jump to the definition of the term under the
cursor, pushing forward in the tag-stack, and use control+T to
pop off that tag-stack, returning to where you were before.  It
does require keeping the tags file in synch, but that's only when
new functions/globals are defined.  There are a number of other
bits of vim for handling tag functionality, and you can learn
about them in the help under

        :help tagsrch.txt
        :help 29.1

Hope this gives you some ideas of what Vim can do for you.

-tim




Reply | Threaded
Open this post in threaded view
|

Re: newbie questions

Charles E Campbell Jr
In reply to this post by development-5
Quoting [hidden email]:

> hi,
>
> VIM is totally alien to me =) born and raised on editplus I am seriously
> fascinated and happy I finally arrived at VIM =)

And, what's more, the Vim logo is GREEN!  Must be alien! :)

> First, how do I save my preferences for font, for all file types, and
> particular highlighting/line numbers and such for some file types?

You have two initialization files, .vimrc and .gvimrc.  Basically, .vimrc
applies to both vim and gvim; the latter only affects gvim.  These files should
go in your home directory (fire up vim, type  :echo $HOME  to see where vim
thinks that is)

I suggest putting into your .vimrc: (as a minimal example)

  set nocp
  if version >= 600
    filetype plugin indent on
  endif

>
> In my particular situation, I have a sort of library of
> functions/classes/subroutines(I use asp), is there any way to setup a script
> of some sort that would open a function file after double click on the
> function's name in the editor split window?

If you had tags, you could also put in your .vimrc:

  set mouse=a
  nnoremap <2-leftmouse> <leftmouse>:exe "ta ".expand("<cword>")<cr>

If you'd like vim to split and tag, use  ..."sta "...  instead of ..."ta "...
Not having used asp, I'll let someone else address whether or not exuberant
ctags or something else can be used to generate tags files for asp.

Regards,
Chip Campbell

Reply | Threaded
Open this post in threaded view
|

Re: newbie questions

Charles E Campbell Jr
In reply to this post by Tim Chase-2
Quoting Tim Chase <[hidden email]>:

> In addition to Eljay's worthy suggestions...
>
> > Put highlight preferences in ~/.vim/after/syntax/syncolor.vim
>
> you can create your own colorscheme, as detailed in the help under
>
> :help new-color-scheme

The hicolors plugin,

 http://vim.sourceforge.net/scripts/script.php?script_id=1081,

has a built-in colorscheme editor.  There's also Mkcolorscheme.  In fact, I
suggest that you should nose around http://vim.sf.net/ a bit if you haven't
already.

Regards,
Chip Campbell

Reply | Threaded
Open this post in threaded view
|

Re: newbie questions

Don Stefani
In reply to this post by development-5
Hello,

I love it, someone even more new than me!
I will say, be prepared, vim may ruin you!
You will get hooked, and you will now judge all other editors by vim.


I bought the book:
http://www.bookpool.com/ss?qs=vim&x=0&y=0
I find this very helpful.
Good help on regexp for searching, etc.
And since vim is free yet is so cool, the book is a small but
nice way to put someting back.

Anyway...

I tweek my colorschemes by copying one I like and messing with it unitl
it fits my needs.

have fun,

dstefani

On 8/29/05, [hidden email] <[hidden email]> wrote:

> hi,
>
> VIM is totally alien to me =) born and raised on editplus I am seriously
> fascinated and happy I finally arrived at VIM =)
>
> Few questions.
>
> First, how do I save my preferences for font, for all file types, and
> particular highlighting/line numbers and such for some file types?
>
> In my particular situation, I have a sort of library of
> functions/classes/subroutines(I use asp), is there any way to setup a script
> of some sort that would open a function file after double click on the
> function's name in the editor split window?
>
> the library directory is either parallel to the directory in which I am
> editing a script at the moment, or I may be editing a function file already
> in the library directory, in which case the file will need to open the
> function file in same directory on double click.
>
> Is it at all possible?
>
> Or perhaps a function key to open the library file of the function that
> cursor is on?
>
>
> TIA
>
>
>