Re: Customizing vim: How to change the char before commands

2007-03-22 Thread A.J.Mechelynck

Some user wrote:


Tim Chase-2 wrote:

I'm new to Vim. I want to change the character before commands. For
example
saving is done by:

:w 

Can it be made slightly easier by just pressing 'g' or some other key
that's
not taken? I don't know why every command has to be pre-pended by a
difficult to reach character like colon. In an old text editor (I think
one
by Borland), you could save by pressing just one key, i.e. F2. 

yes, the Borland IDE used to use  to save.


This isn't a flame.. I just want to do simple commands like save, quit,
save
and quit, etc. with fewer than four keys. One key like 'g' or F2 or
something would be awesome. Ctrl + key would be nice too. 
Most of the common letters and control-keys are occupied by 
existing[1]/useful[1]/non-portable commands[2].  However, the F# 
keys should be available.  You want "mappings", so to save, you'd 
want something like this:


:nnoremap  :w

(with all less-than and greater-than signs).

For save+quit, there's "ZZ" in normal mode, and for abandon+quit, 
there's "ZQ".  I don't use either of them as discussed on the 
list a month or two ago (I like the intentionality of building it 
piece-by-piece regarding whether to quit, confirm, all files, and 
save/overwrite in the process) but they might be easier to use. 
However, you _can_ do things like


:nnoremap  :wq

to save+quit.


[1] like the "g" you suggest...very useful
[2] such as control+[SQ] which is available in some versions, but 
is terminal flow-control or control+Z which can suspend/minimize vim



Just my $0.02 adjusted for inflation, minus taxes, social 
security, and medicare.


-tim






Thank you very much, Tim. You are a true vim genius. The reason I don't like
ZZ is that I still have to press shift with z. :( If only it worked without
shift... But then again, like you said most keys are already bound to
functions that are useful in general (though I've never used regular z
function).

 RANT 
Though I don't really get the reason why every command is preceded by colon.
It should be one keypress, like maybe semi-colon. I'm sure the writers of
vim were pretty aware of that, so there must be a design issue they faced or
something that prevented one keypress instead of two (maybe they wanted to
prevent accidental press?). This was just a rant.


With the exception of the letters themselves, which characters require Shift 
varies from one keyboard layout to the next. For instance, on my fr_BE AZERTY 
keyboard, the colon is unshifted, but the digits are shifted. IIUC, on en_US 
QWERTY keyboards it's the opposite.



 END RANT 

One quick question, please if you could answer: what if I want to map
something like a two keys in succession to something, like gg for save, gz
for quitting and saving. How would it change?


You may. The {lhs} of a mapping can be any number of characters (greater or 
equal to one, of course). If you start typing the characters of a 
multi-character mapping, they will appear at bottom right if you have 
'showcmd' set (which is the 'nocompatible' default). As soon as you hit a key 
which is not part of the mapping, what you typed will be acted upon. Or once 
you complete the mapping, it will be executed.


For instance, let's imagine you create the mapping:
:map gg :w

to use gg for Save. This will of course disable the usual meaning of gg (go to 
top) but you can use 1G for that. Now when you hit g (in Normal mode) you will 
see it at bottom right of your screen, "waiting" to know what you want to do 
with it. If you follow it by a second g, your file will be saved. If you 
follow it by something else, let's say j, Vim will execute the Normal-mode 
command gj (go to next screen line, which may be another part of the current 
"file" line if it is longer than 'columns' and you have 'wrap' on).




I'm sorry if my English is bad.. it's not my first language.

Regards,


Neither is it mine, but as we say in my mother language (French), "by working 
the smithy one becomes a smith".



Best regards,
Tony.
--
Why is it called "Windows"?  "Gates" would be more appropriate...


question about omni-complete

2007-03-22 Thread shawn bright

lo there,
i just discovered omni-complete . i am starting to use vim for some
python and ruby scripting for work. i found omni-complete. I can type
time.ctrl-x ctrl-o and a list of funtions pop up for me to choose.
but
how do i navigate the list without using arrow keys ? it is getting
kinda natrual to use jk to move up and down ( i find myself typing j
and k into other text editors)

what keys do i use to navigate and select the function from the list ?

thanks
sk


Re: Customizing vim: How to change the char before commands

2007-03-22 Thread panshizhu

Some user <[EMAIL PROTECTED]> 写于 2007-03-22 05:14:30:
> I'm new to Vim. I want to change the character before commands. For
example
> saving is done by:
>
> :w 
>
> Can it be made slightly easier by just pressing 'g' or some other key
that's
> not taken? I don't know why every command has to be pre-pended by a
> difficult to reach character like colon.

Sure, I think many Vim users may found this useful:

noremap ; :

then you could use ;w  instead of :w 

I'm in the same boat, I don't want to press any "chord-combination-keys"
since I can type much faster if there're no s or s or s

If you want to change the character into 'g', it may not be a good idea
IMO, since the left hand need to move a bit to reach the 'g' key, while the
';' key is right at the right hand.

--
Sincerely, Pan, Shi Zhu. ext: 2606

Re: Plug-ins for C++ Development

2007-03-22 Thread fREW

On 3/22/07, Andreas Bakurov <[EMAIL PROTECTED]> wrote:

Hi!
What is a good set of plug-ins for vim in order to make it suitable for
productive C++ editing for small programs (around 15-20 .cpp files).

Navigation enhancements  are helpful in such cases:

* I need some kind of method tree where i can select methods quickly,
* some enhancements  for  tag browsing and
* maybe debugger(gdb) interface.

Thank  You  in  advance.



omnicppcomplete (
http://vim.sourceforge.net/scripts/script.php?script_id=1520) can help
with completion
TagList (http://vim.sourceforge.net/scripts/script.php?script_id=273)
is good for browsing methods and whatnot.  You'll need to set up
exuberant tags with it, but that's pretty easy.  It shows how on the
site.
Project (http://vim.sourceforge.net/scripts/script.php?script_id=69)
is really nice if you need to navigate through a bunch of different
files.  I have a special binding that will load a project file for
each of my projects separately.  So for instance I have a project
called tome, to load the plugin for tome I do tome (\tome) and
it will load the plugin and I can easily access any of the files for
the project.

Hope that helps!

--
-fREW


Plug-ins for C++ Development

2007-03-22 Thread Andreas Bakurov
Hi!
What is a good set of plug-ins for vim in order to make it suitable for
productive C++ editing for small programs (around 15-20 .cpp files).

Navigation enhancements  are helpful in such cases:

* I need some kind of method tree where i can select methods quickly,
* some enhancements  for  tag browsing and
* maybe debugger(gdb) interface.

Thank  You  in  advance.


Re: Feature proposal: Change bars

2007-03-22 Thread Bram Moolenaar

Christoph Kögl wrote:

> I want to propose a feature I have come to appreciate in some editors
> (e.g. Codewright and most recently in the Delphi 2006 editor) that
> (g)vim currently lacks: change bars. By this I mean a colored bar to the left
> of the first text column (some other vim scripts use that area already,
> e.g. ShowMarks http://www.vim.org/scripts/script.php?script_id=152), namely
> a green bar in front of each line that has been changed (and
> subsequently saved) since editing this file has started, and a yellow
> bar in front of each line that has been changed (but not yet saved).
> (The colors should be configurable.)
> 
> Or is there a possibility to emulate change bars using the "signs" feature?

This has been asked for a few times.  Currently you could use diff mode,
but that looks quite different from a change bar.

I'll add a voting item for this.

-- 
ARTHUR: Go on, Bors, chop its head off.
BORS:   Right.  Silly little bleeder.  One rabbit stew coming up.
 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


Re: IncSearch doesn't work (newbie)

2007-03-22 Thread flope

Your are right!
I feel a little stupid.
-- 
View this message in context: 
http://www.nabble.com/IncSearch-doesn%27t-work-%28newbie%29-tf3449967.html#a9623565
Sent from the Vim - General mailing list archive at Nabble.com.



Re: IncSearch doesn't work (newbie)

2007-03-22 Thread Richard van der Leeden


flope wrote:
> 
> Hi,
> I am new using VIM ... to be precise I use GVIM.
> My platform: Ubuntu 6.10, VIM 7
> I made my own .gvimrc file (see below) and Incsearch is not working. What
> am I doing wrong?
> It should work when using :/pattern, shouldn't it?
> 
> 

Try it without the colon - i.e.

/pattern
-- 
View this message in context: 
http://www.nabble.com/IncSearch-doesn%27t-work-%28newbie%29-tf3449967.html#a9623359
Sent from the Vim - General mailing list archive at Nabble.com.



Highlight a specific character using colorscheme?

2007-03-22 Thread flope

Hi,
this is my second post. so I am new in vim (gvim).
I would like to know if it possible to highlight a specific character such
as ";" differently from others.
I tried different things but without success.  Should I do that in my color
scheme?

I use to edit perl scripts so If I load my colorscheme in the .gvimrc file
and the syntax is on, is the perl syntax overwritten by my color scheme? at
least some of the parameters?

thank you for your help!!! 
-- 
View this message in context: 
http://www.nabble.com/Highlight-a-specific-character-using-colorscheme--tf3450062.html#a9623129
Sent from the Vim - General mailing list archive at Nabble.com.



Re: Error

2007-03-22 Thread Andreas Bakurov
felipe fernandez wrote:
> I update vim 6.3 to 7.0 on my debian.  The error is
> Se ha detectado un error al procesar /usr/share/vim/vim70/menu.vim:
> línea  150
> E121: Variable sin definir: paste#paste_cmd.
> E15: Expresión no válida: 'vnoremenu 

IncSearch doesn't work (newbie)

2007-03-22 Thread flope

Hi,
I am new using VIM ... to be precise I use GVIM.
My platform: Ubuntu 6.10, VIM 7
I made my own .gvimrc file (see below) and Incsearch is not working. What am
I doing wrong?
It should work when using :/pattern, shouldn't it?
I checked :set all and incsearch is on.
Is something related to the colorscheme and highlighting?
I used to edit perl files, is my coloscheme overwriting the perl color
syntaxes?

thank you very much for your patient

set ch=2" Make command line two lines high
set mousehide   " Hide the mouse when typing text
set nocompatible 

  " Switch on syntax highlighting if it wasn't on yet.
  if !exists("syntax_on")
syntax on
  endif

colorscheme flope "my color scheme

" Highly recommended to set tab keys to 4 spaces
set tabstop=4
set shiftwidth=4
"
" The opposite is 'set nowrapscan' while searching for strings
set wrapscan
"
" The opposite is set ignorecase
set noignorecase
 
" You may want to turn off the beep sounds (if you want quite) with visual
bell
set vb

set lines=50
set columns=140
set nowrap
" the `b' puts a scrollbar at the bottom, which has no effect if wrap is set
" Menu bar (m), Right scroll bar (r), 
set guioptions +=b

" Switch on search pattern highlighting.
set hlsearch

"it will show the pattern while your are still typing
set incsearch



-- 
View this message in context: 
http://www.nabble.com/IncSearch-doesn%27t-work-%28newbie%29-tf3449967.html#a9622845
Sent from the Vim - General mailing list archive at Nabble.com.



Re: Count characters

2007-03-22 Thread Andy Wokula

Tim Chase schrieb:
Is there some function or script to count characters (letters without 
whitespaces) in vim?


For example Kile the Latex Editor has such a feature to control how 
long texts are.



You can use

:%s/\w/&/g

which will report back "X substitutions on Y lines".  "X" represents the 
number of characters of interest.  Adjust the "\w" regexp for whatever 
constitutes your definiton of "characters" that you want to count.  
Thus, this might be


:%s/\a/&/g "(only letters)
:%s/\S/&/g"(non-whitespace)

Or any other such combo.

It does have the side effect of "modifying" your document (setting the 
"modified" flag).  If this is a problem, you can "u"ndo it and it should 
revert.  It also requires that the document not be readonly (or at least 
it will gripe if it is, warning you that you're changing a RO document).


If you have fewer than 'report' characters, Vim won't report back:

:help 'report'

but you can set this to

:set report=0

to always report any changes.

There are ways to do it on non-modifiable buffers, but they require a 
bit more programatic logic, such as


:let x=0
:g/^/let x+=strlen(substitute(getline('.'), '\W', '', 'g'))
:echo x

where the '\W' is the inverse-set of characters of interest.  In this 
case, if you're interested in "\w" characters, the "\W" is the inverse.  
If you're interested in non-whitespace characters ("\s"), you would use 
"\S"; and if you're interested in counting vowels, you could use 
"[^aeiouAEIOU]".


You might even notice that the second version uses a :g command that 
matches every line.  With this, you have a lot of flexibility:


  :'<,'>g/^/let ... " counts characters in the linewise selection
  :g/foo/let ..." counts characters on lines containing "foo"

and the like.

All sorts of fun things at your disposal :)  Hope this helps,

-tim


Therefore in Vim7 the 'n' flag was added to the
substitute command:

   :%s/\S/&/gn

just reports the number of matches.  Works also
for read-only files, because no text is changed.

   :h :s_flags

Andy

--
EOM





___ 
Der frühe Vogel fängt den Wurm. Hier gelangen Sie zum neuen Yahoo! Mail: http://mail.yahoo.de


Error

2007-03-22 Thread felipe fernandez
I update vim 6.3 to 7.0 on my debian.  The error is
Se ha detectado un error al procesar /usr/share/vim/vim70/menu.vim:
línea  150
E121: Variable sin definir: paste#paste_cmd.
E15: Expresión no válida: 'vnoremenu 

Re: Customizing vim: How to change the char before commands

2007-03-22 Thread Jean-Rene David
* Some user [2007.03.22 15:00]:
>  RANT 
> Though I don't really get the reason why every
> command is preceded by colon.

Not to nitpick, but commands themselves don't
really care about the colon. The colon is used to
*change mode*.

In normal mode, you can just type away your
commands without any colon, ever. 

Command-line mode accepts just one command at a
time, so you need to re-enter a colon for each new
command to re-enter command-line mode.

For multiple successive commands, you can use
either Ex mode or the command window:

:h Ex-mode
:h cmdwin

It sounds like you would like to be able to do
everything from normal-mode. But then you would be
lacking a lot of the expressive power of vim
commands.

> It should be one keypress, like maybe
> semi-colon. 

map ; :

> One quick question, please if you could answer:
> what if I want to map something like a two keys
> in succession to something, like gg for save, gz
> for quitting and saving. How would it change?

map gg :w
map gz :wq

-- 
JR


Re: Customizing vim: How to change the char before commands

2007-03-22 Thread Dmitriy Yamkovoy

The semicolon command isn't used that often, especially if you're a
new user.  You could do this:

:map ; :

Now your two-keypress : has become a one-keypress ;

-dpy

On 3/22/07, Some user <[EMAIL PROTECTED]> wrote:



Tim Chase-2 wrote:
>
>> I'm new to Vim. I want to change the character before commands. For
>> example
>> saving is done by:
>>
>> :w 
>>
>> Can it be made slightly easier by just pressing 'g' or some other key
>> that's
>> not taken? I don't know why every command has to be pre-pended by a
>> difficult to reach character like colon. In an old text editor (I think
>> one
>> by Borland), you could save by pressing just one key, i.e. F2.
>
> yes, the Borland IDE used to use  to save.
>
>> This isn't a flame.. I just want to do simple commands like save, quit,
>> save
>> and quit, etc. with fewer than four keys. One key like 'g' or F2 or
>> something would be awesome. Ctrl + key would be nice too.
>
> Most of the common letters and control-keys are occupied by
> existing[1]/useful[1]/non-portable commands[2].  However, the F#
> keys should be available.  You want "mappings", so to save, you'd
> want something like this:
>
>   :nnoremap  :w
>
> (with all less-than and greater-than signs).
>
> For save+quit, there's "ZZ" in normal mode, and for abandon+quit,
> there's "ZQ".  I don't use either of them as discussed on the
> list a month or two ago (I like the intentionality of building it
> piece-by-piece regarding whether to quit, confirm, all files, and
> save/overwrite in the process) but they might be easier to use.
> However, you _can_ do things like
>
>   :nnoremap  :wq
>
> to save+quit.
>
>
> [1] like the "g" you suggest...very useful
> [2] such as control+[SQ] which is available in some versions, but
> is terminal flow-control or control+Z which can suspend/minimize vim
>
>
> Just my $0.02 adjusted for inflation, minus taxes, social
> security, and medicare.
>
> -tim
>
>
>
>

Thank you very much, Tim. You are a true vim genius. The reason I don't like
ZZ is that I still have to press shift with z. :( If only it worked without
shift... But then again, like you said most keys are already bound to
functions that are useful in general (though I've never used regular z
function).

 RANT 
Though I don't really get the reason why every command is preceded by colon.
It should be one keypress, like maybe semi-colon. I'm sure the writers of
vim were pretty aware of that, so there must be a design issue they faced or
something that prevented one keypress instead of two (maybe they wanted to
prevent accidental press?). This was just a rant.
 END RANT 

One quick question, please if you could answer: what if I want to map
something like a two keys in succession to something, like gg for save, gz
for quitting and saving. How would it change?

I'm sorry if my English is bad.. it's not my first language.

Regards,
--
View this message in context: 
http://www.nabble.com/Customizing-vim%3A-How-to-change-the-char-before-commands-tf3443878.html#a9621585
Sent from the Vim - General mailing list archive at Nabble.com.




Re: Customizing vim: How to change the char before commands

2007-03-22 Thread Tim Chase

:nnoremap  :w


 RANT 
Though I don't really get the reason why every
command is preceded by colon. It should be one keypress, like
maybe semi-colon. I'm sure the writers of vim were pretty
aware of that, so there must be a design issue they faced or 
something that prevented one keypress instead of two (maybe

they wanted to prevent accidental press?). This was just a
rant.
 END RANT 


The biggest issues are

1) a lack of keys--vim *really* *does* use _every_ regular
letter, number, punctuation mark, and control-key for *something*
(and freakishly, I use a good majority of them fairly regularly).
 Your example of a semicolon?  The "search for the next f/F/t/T
search on the line in the same direction as before" command.  By
using the colon, it allows arbitrary complexity to be introduced
through longer command-names.

2) a lack of predictable means by which to get the "extended"
keys (such as Fn keys, , , , alt+character
etc) across the multitude of platforms on which vi/vim runs.
Some of this has stabilized as many terminals have condensed into
a few common ones,  but I still have problems with such extended
characters on some connections.  And on some platforms, you don't
have the same keys (some keyboards don't have F11 and F12, etc)

However, since Vim doesn't use the extended keys for anything,
they're ripe for remapping according to your platform.


One quick question, please if you could answer: what if I want
to map something like a two keys in succession to something,
like gg for save, gz for quitting and saving. How would it
change?


:nnoremap gg :w
:nnoremap gz :wq

I would avoid remapping "gg" as that goes to the top of the
file...something I use *all* the time (and drives me nuts on nvi
when I use it on one of my OpenBSD boxes).  I would recommend the
(almost:  ":help gs") useless "gs" command for your saving if you
need it:

:nnoremap gs :w

As mentioned above, "extended" keys are good candidates for
mapping to custom functionality if they come across in your
platform/interface, so you could use

:nnoremap  :w
:nnoremap  :wq

to make alt+s save and alt+q save+quit.  Or use function keys
as mentioned previously such as  to save, and  to
save+quit, with perhaps  to quit+abandon, etc.


I'm sorry if my English is bad.. it's not my first language.


It's notably better than most of my non-English (Spanish, ASL,
and some Latin are the only languages I've taken/learned, and ASL
isn't of much use on a mailing list :)  so have non fear.  You're 
understood :)


Hope this helps,

-tim




Re: Customizing vim: How to change the char before commands

2007-03-22 Thread Some user


Tim Chase-2 wrote:
> 
>> I'm new to Vim. I want to change the character before commands. For
>> example
>> saving is done by:
>> 
>> :w 
>> 
>> Can it be made slightly easier by just pressing 'g' or some other key
>> that's
>> not taken? I don't know why every command has to be pre-pended by a
>> difficult to reach character like colon. In an old text editor (I think
>> one
>> by Borland), you could save by pressing just one key, i.e. F2. 
> 
> yes, the Borland IDE used to use  to save.
> 
>> This isn't a flame.. I just want to do simple commands like save, quit,
>> save
>> and quit, etc. with fewer than four keys. One key like 'g' or F2 or
>> something would be awesome. Ctrl + key would be nice too. 
> 
> Most of the common letters and control-keys are occupied by 
> existing[1]/useful[1]/non-portable commands[2].  However, the F# 
> keys should be available.  You want "mappings", so to save, you'd 
> want something like this:
> 
>   :nnoremap  :w
> 
> (with all less-than and greater-than signs).
> 
> For save+quit, there's "ZZ" in normal mode, and for abandon+quit, 
> there's "ZQ".  I don't use either of them as discussed on the 
> list a month or two ago (I like the intentionality of building it 
> piece-by-piece regarding whether to quit, confirm, all files, and 
> save/overwrite in the process) but they might be easier to use. 
> However, you _can_ do things like
> 
>   :nnoremap  :wq
> 
> to save+quit.
> 
> 
> [1] like the "g" you suggest...very useful
> [2] such as control+[SQ] which is available in some versions, but 
> is terminal flow-control or control+Z which can suspend/minimize vim
> 
> 
> Just my $0.02 adjusted for inflation, minus taxes, social 
> security, and medicare.
> 
> -tim
> 
> 
> 
> 

Thank you very much, Tim. You are a true vim genius. The reason I don't like
ZZ is that I still have to press shift with z. :( If only it worked without
shift... But then again, like you said most keys are already bound to
functions that are useful in general (though I've never used regular z
function).

 RANT 
Though I don't really get the reason why every command is preceded by colon.
It should be one keypress, like maybe semi-colon. I'm sure the writers of
vim were pretty aware of that, so there must be a design issue they faced or
something that prevented one keypress instead of two (maybe they wanted to
prevent accidental press?). This was just a rant.
 END RANT 

One quick question, please if you could answer: what if I want to map
something like a two keys in succession to something, like gg for save, gz
for quitting and saving. How would it change?

I'm sorry if my English is bad.. it's not my first language.

Regards,
-- 
View this message in context: 
http://www.nabble.com/Customizing-vim%3A-How-to-change-the-char-before-commands-tf3443878.html#a9621585
Sent from the Vim - General mailing list archive at Nabble.com.



Re: Count characters

2007-03-22 Thread Jean-Rene David
* Harald Kröll [2007.03.22 13:30]:
> Is there some function or script to count
> characters (letters without whitespaces) in vim?

One way is to use the 'substitute' command's
ability to tell you how many items it replaced. So
if you type:

:%s/\S/&/g

You will get a message saying how many non-blank
characters were found and replaced by themselves.

-- 
JR


Re: Count characters

2007-03-22 Thread Tim Chase
Is there some function or script to count characters (letters without 
whitespaces) in vim?


For example Kile the Latex Editor has such a feature to control how long 
texts are.



You can use

:%s/\w/&/g

which will report back "X substitutions on Y lines".  "X" 
represents the number of characters of interest.  Adjust the "\w" 
regexp for whatever constitutes your definiton of "characters" 
that you want to count.  Thus, this might be


:%s/\a/&/g "(only letters)
:%s/\S/&/g"(non-whitespace)

Or any other such combo.

It does have the side effect of "modifying" your document 
(setting the "modified" flag).  If this is a problem, you can 
"u"ndo it and it should revert.  It also requires that the 
document not be readonly (or at least it will gripe if it is, 
warning you that you're changing a RO document).


If you have fewer than 'report' characters, Vim won't report back:

:help 'report'

but you can set this to

:set report=0

to always report any changes.

There are ways to do it on non-modifiable buffers, but they 
require a bit more programatic logic, such as


:let x=0
:g/^/let x+=strlen(substitute(getline('.'), '\W', '', 'g'))
:echo x

where the '\W' is the inverse-set of characters of interest.  In 
this case, if you're interested in "\w" characters, the "\W" is 
the inverse.  If you're interested in non-whitespace characters 
("\s"), you would use "\S"; and if you're interested in counting 
vowels, you could use "[^aeiouAEIOU]".


You might even notice that the second version uses a :g command 
that matches every line.  With this, you have a lot of flexibility:


  :'<,'>g/^/let ... " counts characters in the linewise selection
  :g/foo/let ..." counts characters on lines containing "foo"

and the like.

All sorts of fun things at your disposal :)  Hope this helps,

-tim






Re: Can you create file dependend fold markers

2007-03-22 Thread Tim Chase
Can you create your own (VHDL) fold markers? (not sure if the terminolgy is 
OK)


For example I have VHDL-code like below:

component bufg
port (
  o : out std_ulogic;
  i : in std_ulogic);
end component;

And when I'm at the first line in normal-mode and give zc command (fold 
close) then I want to see it fold like:


+-- 5 lines: component bufg


I don't know enough about VHDL (make that "I really don't know 
anything about VHDL syntax") to know if this is too specific:


  :set foldmarker=component\ bufg,end\ component
  :set foldmethod=marker

This assumes that "component bufg" always starts the block.  If 
"bufg" is some sort of variable/tag, you /can/ use


  :set foldmarker=component,end\ component

But this will mark any place that the word "component" is used, 
and could cause problems if (assuming a C++ style commenting) one 
had something like


  // this component
  // does stuff
  component bufg
  port (
   o : out std_ulogic;
   i : in std_ulogic);
  end component;


It would fold the whole lot (including the comments).

Alternatively, with manual folding, you can force them by first 
clearing your folds (with "zE") and then using something like


:g/^component\s\+\w+/,/^end component/fold

The use of regexps can give you more flexibility for nailing them 
down.  An advantage over some of the 'foldmethod's is that you 
can also create your own manual folds on top of this as desired. 
 This has a disadvantage that it doesn't refresh realtime, but 
the pairing (zE + the :g//) can be mapped to a single keypress to 
force a manual update if needed (though it will wipe out any 
other manually created folds).  If you have trouble understanding 
what the above is doing, drop a line and I'd be glad to explain it.


I tend to go with the latter as allows me to be very precise with 
my regexps and it also allows me to create manual folds in addition.


Hope this gives you some ideas to work with...

-tim





Count characters

2007-03-22 Thread Harald Kröll

Hi,

Is there some function or script to count characters (letters without 
whitespaces) in vim?


For example Kile the Latex Editor has such a feature to control how long 
texts are.


regards,

Harry


Re: Quck Add & Remove comments

2007-03-22 Thread Jean-Rene David
* Andreas Bakurov [2007.03.22 09:00]:
> I trying to find a way to quickly remove and add one line comments (//
> or /* */) to Java or C/C++ code.
> What is a effective "combo" to achieve this.

You could do this manually with mappings and such,
but I find there are so many special cases
(especially with the C-style /* */ type of
comments) that I prefer using a plugin in which
most of the dirty work can be hidden away.

Here is one:

EnhancedCommentify
http://www.vim.org/scripts/script.php?script_id=23

-- 
JR


Re: Selecting tag opens file in a new tab - how?

2007-03-22 Thread Zarko Coklin
I posted following question some time back:
~
Is it possible to have a setup in .vimrc so that every
time I select tag either through "CTRL-]" or by
holding CTRL and pressing left mouse click to open a
new buffer in a new tab?

and got following answer that works:
:map  :exe "tab stag" expand("")
:map  :exe "tab stag"
expand("")
~
The trouble I am having at the moment is that this
approach leads to a quick proliferation of open file
tabs. Ideally, Vim should not open a new tab for the
the file that already has a tab. Rather, it should
simply reuse an existing tab and position itself
within an open tab. Is there a way to get that done?

Thanks in advance,
Zarko




 

Be a PS3 game guru.
Get your game face on with the latest PS3 news and previews at Yahoo! Games.
http://videogames.yahoo.com/platform?platform=120121


Re: question about search

2007-03-22 Thread Jean-Rene David
* Dave Land [2007.03.22 08:15]:
> " Command-[ and Command-] put the prev/next match at top of screen
> map  kNz " put prev match at top of screen
> map  jnz " put next match at top of screen

Very recently on the list someone suggested these
very simple and elegant mappings:

nnoremap n nzz
nnoremap N Nzz

The up-side is you don't need to remember a new
keystroke -- the down side is you lose the old
behavior.

-- 
JR


Re: jump to last edit

2007-03-22 Thread shawn bright

wow, that was fast, thanks !

On 3/22/07, Wolfgang Schmidt <[EMAIL PROTECTED]> wrote:

Hi,

:help g;

Cheers,

Wolfgang

shawn bright wrote:
> Hello there all,
>
> is there a command in vim that will cause you to jump to the last edit
> location in a file ?
>
> thanks,
> shawn




Can you create file dependend fold markers

2007-03-22 Thread Eric Leenman

Hi,

Can you create your own (VHDL) fold markers? (not sure if the terminolgy is 
OK)


For example I have VHDL-code like below:

component bufg
port (
 o : out std_ulogic;
 i : in std_ulogic);
end component;

And when I'm at the first line in normal-mode and give zc command (fold 
close) then I want to see it fold like:


+-- 5 lines: component bufg

Is this possible?
And if so, how to do this?

Rgds,
Eric

_
5.5%* 30 year fixed mortgage rate. Good credit refinance. Up to 5 free 
quotes - *Terms 
https://www2.nextag.com/goto.jsp?product=10035&url=%2fst.jsp&tm=y&search=mortgage_text_links_88_h2a5d&s=4056&p=5117&disc=y&vers=910




Re: Consistently exit "message display" with 'q'?

2007-03-22 Thread mzyzik
I would like to concur with some that it is strange that the "d"/"u"
keys work for scrolling when the "Press ENTER or type command to
continue" message comes up; however, the "q" key does not just exit the
prompt, but also begins recording a macro.

I feel that "q" should only exit (and not record a macro). So, the user
would be able to hold down "d" to get to the bottom of the message, and
then press "q" to exit it, just like with the "less" program.

--Matt

On Thu, Mar 22, 2007 at 01:36:20PM +0800, [EMAIL PROTECTED] wrote:
> John Orr <[EMAIL PROTECTED]>  2007-03-22 12:43:51:
> > Thanks for the clarification Brett.  At least if you have external
> > commands you use regularly though, you could wrap them in a vim
> > function, thereby making them effectively internal, making g< useful.
> >
> > Just an update - I promised I'd investigate extending my "patch" to
> > help those people who complained about losing their commands if they
> > pressed one too many keys.
> > I tried the most obvious approach, and whilst it sort of worked,
> > there was some unhandled complexity to do with reverting to "more-
> > prompt" mode which I couldn't easily work out.
> > I think it was because vim thought we had alreday exited "more-
> > prompt" mode, when in fact we shouldn't have (so you couldn't scroll
> > back up when you reached the end).
> > Since this g< command works somewhat (or can be made to work by
> > using a wrapper function for external commands), I think I might
> > give up on this and just be satisfied with the simpler "q exits the
> > Press Enter prompt" change.
> > Cheers,
> > John
> 
> Just done some experiment, if I use j/k or / to scroll within the
> "more-prompt" the message will never quit. Seems good but not quite useful
> to me since I always use "f"/"b" or / to view the message.
> 
> So the only issue is the lack of "f"/"b" or  support for the
> "more-prompt" and "hit-enter-prompt". key "f" and "b" is the standard
> page-scrolling key for less and more, it seems strange that the
> "more-prompt" and "hit-enter-prompt" do not have support the "f" and "b"
> key.
> 
> Let's hope it will be available in future versions.
> 
> --
> Sincerely,
> Pan, Shi Zhu


Re: jump to last edit

2007-03-22 Thread Wolfgang Schmidt

   Hi,

:help g;

Cheers,

   Wolfgang

shawn bright wrote:

Hello there all,

is there a command in vim that will cause you to jump to the last edit
location in a file ?

thanks,
shawn




jump to last edit

2007-03-22 Thread shawn bright

Hello there all,

is there a command in vim that will cause you to jump to the last edit
location in a file ?

thanks,
shawn


Quck Add & Remove comments

2007-03-22 Thread Andreas Bakurov
Hi!
I trying to find a way to quickly remove and add one line comments (//
or /* */) to Java or C/C++ code.
What is a effective "combo" to achieve this.


Feature proposal: Change bars

2007-03-22 Thread Kögl Christoph Dr .
Dear VIMmers,

I want to propose a feature I have come to appreciate in some editors
(e.g. Codewright and most recently in the Delphi 2006 editor) that
(g)vim currently lacks: change bars. By this I mean a colored bar to the left
of the first text column (some other vim scripts use that area already,
e.g. ShowMarks http://www.vim.org/scripts/script.php?script_id=152), namely
a green bar in front of each line that has been changed (and subsequently saved)
since editing this file has started, and a yellow bar in front of each line that
has been changed (but not yet saved). (The colors should be configurable.)

Or is there a possibility to emulate change bars using the "signs" feature?


Regards,

Dr. Christoph Kögl


Re: Spell check not working when editing HTML

2007-03-22 Thread A.J.Mechelynck

Claus Atzenbeck wrote:

On Thu, 22 Mar 2007, A.J.Mechelynck wrote:


Well the syntax/html.vim I have (dated 2006 Jun 19) includes "syntax spell
toplevel" at line 27. So what version are you using?


I still have the one dated 2006 April 13, which comes with the Vim
sources at .

Did you update it manually?

Claus



I update it periodically via rsync. On Linux, the commands are

cd ~/.build/vim/vim70
# or wherever; parent of the src/ runtime/ (etc.) subfolders
# NOT your "production" $VIMRUNTIME directory
rsync -avzcP --delete --exclude="/dos/" ftp.nluug.nl::Vim/runtime/ ./runtime/
cd src
make installruntime


Best regards,
Tony.
--
This is an especially good time for you vacationers who plan to fly,
because the Reagan administration, as part of the same policy under
which it recently sold Yellowstone National Park to Wayne Newton, has
"deregulated" the airline industry.  What this means for you, the
consumer, is that the airlines are no longer required to follow any
rules whatsoever.  They can show snuff movies.  They can charge for
oxygen.  They can hire pilots right out of Vending Machine Refill
Person School.  They can conserve fuel by ejecting husky passengers
over water.  They can ram competing planes in mid-air.  These
innovations have resulted in tremendous cost savings which have been
passed along to you, the consumer, in the form of flights with
amazingly low fares, such as $29.  Of course, certain restrictions do
apply, the main one being that all these flights take you to Newark,
and you must pay thousands of dollars if you want to fly back out.
-- Dave Barry, "Iowa -- Land of Secure Vacations"


Re: Spell check not working when editing HTML

2007-03-22 Thread Claus Atzenbeck
On Thu, 22 Mar 2007, A.J.Mechelynck wrote:

> Well the syntax/html.vim I have (dated 2006 Jun 19) includes "syntax spell
> toplevel" at line 27. So what version are you using?

I still have the one dated 2006 April 13, which comes with the Vim
sources at .

Did you update it manually?

Claus


Re: Spell check not working when editing HTML

2007-03-22 Thread A.J.Mechelynck

Claus Atzenbeck wrote:

On Thu, 22 Mar 2007, Claus Atzenbeck wrote:


I use Vim 7.0 (on Mac OS 10.4.9). Spell checking works perfectly,
however, not when editing HTML files. Even after typing ":setlocal spell
spelllang=en_us", I don't get any error marks.


I found a solution shortly after sending this e-mail:

:sy spell toplevel

switches on spell checking.

However, I don't see any reason why HTML editing should not have spell
checking on by default. What would be the best solution for turning it
on for HTML file by default?

Claus



Well the syntax/html.vim I have (dated 2006 Jun 19) includes "syntax spell 
toplevel" at line 27. So what version are you using?


Best regards,
Tony.
--
Colvard's Logical Premises:
All probabilities are 50%.  Either a thing will happen or it
won't.

Colvard's Unconscionable Commentary:
This is especially true when dealing with someone you're
attracted to.

Grelb's Commentary
Likelihoods, however, are 90% against you.


"Masking in context" for spell check -- was:Re: Spell check not working when editing HTML

2007-03-22 Thread Claus Atzenbeck
On Thu, 22 Mar 2007, A.J.Mechelynck wrote:

> However, I notice that the spell checker doesn't understand entities:
> "où" is highlighted as a misspelling even though "où" is a valid word
> in modern French.

In fact, I have the same problem with LaTeX documents: For instance, \"a
(or even "a with German package on) would be ä, but this is not
recognized by the spell checker. So, 'ändern' (German) is recognized as
being correct, but '\"andern' or '"andern' is not.

I don't know if there are solutions provided for mapping such masking in
their context (HTML, LaTeX, etc.) Anyone who has a workaround or
solution?

Claus

Re: Spell check not working when editing HTML

2007-03-22 Thread Claus Atzenbeck
On Thu, 22 Mar 2007, Claus Atzenbeck wrote:

> I use Vim 7.0 (on Mac OS 10.4.9). Spell checking works perfectly,
> however, not when editing HTML files. Even after typing ":setlocal spell
> spelllang=en_us", I don't get any error marks.

I found a solution shortly after sending this e-mail:

:sy spell toplevel

switches on spell checking.

However, I don't see any reason why HTML editing should not have spell
checking on by default. What would be the best solution for turning it
on for HTML file by default?

Claus


Re: Spell check not working when editing HTML

2007-03-22 Thread A.J.Mechelynck

Claus Atzenbeck wrote:

Hi,

I use Vim 7.0 (on Mac OS 10.4.9). Spell checking works perfectly,
however, not when editing HTML files. Even after typing ":setlocal spell
spelllang=en_us", I don't get any error marks.

Other files, such as plain text or LaTeX, work perfectly with spell
checking.

Any idea why this could be the case?

Thanks,
Claus



I don't know; when I use ":setl spell spellang=fr" in an HTML file in 
15th-century French, all words whose orthography changed since then are 
highlighted with red curly underline.


However, I notice that the spell checker doesn't understand entities: 
"où" is highlighted as a misspelling even though "où" is a valid word 
in modern French.


You have set filetype recognition and syntax highlighting, haven't you?

What's the date of your syntax/html.vim (as shown in one of the comment liunes 
near the top)? Mine is dated 2006 Jun 19.


Best regards,
Tony.
--
Green light in a.m. for new projects.  Red light in P.M. for traffic
tickets.


Spell check not working when editing HTML

2007-03-22 Thread Claus Atzenbeck
Hi,

I use Vim 7.0 (on Mac OS 10.4.9). Spell checking works perfectly,
however, not when editing HTML files. Even after typing ":setlocal spell
spelllang=en_us", I don't get any error marks.

Other files, such as plain text or LaTeX, work perfectly with spell
checking.

Any idea why this could be the case?

Thanks,
Claus