Vim Tips Wiki
No edit summary
 
Tags: Visual edit apiedit
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
{{review}}
 
{{review}}
  +
{{TipImported
{{Tip
 
 
|id=534
 
|id=534
  +
|previous=533
|title=for verilog users only
 
  +
|next=535
|created=August 19, 2003 6:50
+
|created=2003
 
|complexity=basic
 
|complexity=basic
 
|author=rajesh
 
|author=rajesh
 
|version=5.7
 
|version=5.7
 
|rating=29/8
 
|rating=29/8
  +
|category1=
|text=
 
  +
|category2=
for all verilog users dealing with netlists,this an easier way to find out in which module you are really working in.add this map to your .vimrc/.gvimrc file.use `(tick) key to find out in which module u are actually residing in.
 
 
 
 
map ` ma?module<CR>Wyiw'a:echo "module -->" @0<CR>
 
 
 
 
note:
 
 
this map works only when u are whithin the module.placing it on module/endmodule does not make any sense.
 
 
 
 
}}
 
}}
 
For all verilog users dealing with netlists, this an easier way to find out in which module you are really working in.add this map to your [[vimrc]]. Press <code>`</code> to find out which module you are actually residing in.
  +
<pre>
 
map ` ma?module<CR>Wyiw'a:echo "module -->" @0<CR>
  +
</pre>
   
 
This map works only when you are within the module. Placing it on module/endmodule does not make any sense.
== Comments ==
 
an improved version of this if you are using a searching for a particular net/wire and then u want to know in which module you are really in.add this to your .vimrc/.gvimrc file
 
   
 
==Comments==
map ` ma?module&lt;CR&gt;Wyiw'a/&lt;Up&gt;&lt;Up&gt;&lt;CR&gt;:echo "module --&gt;" --AT--0&lt;CR&gt;
 
 
An improved version of this if you are using a searching for a particular net/wire and then u want to know in which module you are really in. Add this to your vimrc
  +
<pre>
 
map ` ma?module<CR>Wyiw'a/<Up><Up><CR>:echo "module -->" @0<CR>
  +
</pre>
   
if your are not searching for any particular net the above map will do.
+
If you are not searching for any particular net the above map will do.
   
inti.rajesh--AT--analog.com
 
, August 19, 2003 20:50
 
 
----
 
----
 
It's not working for me. Vim seems to be kind of hanging then i press C-C to break it.
an improved version of this if you are using a searching for a particular net/wire and then u want to know in which module you are really in.add this to your .vimrc/.gvimrc file
 
 
BTW but if some signals are having <module> in the signal names? Won't work i think!
   
map ` ma?module&lt;CR&gt;Wyiw'a/&lt;Up&gt;&lt;Up&gt;&lt;CR&gt;:echo "module --&gt;" --AT--0&lt;CR&gt;
 
 
if your are not searching for any particular net the above map will do.
 
 
inti.rajesh--AT--analog.com
 
, August 19, 2003 20:51
 
 
----
 
----
 
This will not work if you have module with names line module_AND...
haha smart !
 
   
'''Anonymous'''
 
, August 21, 2003 18:46
 
 
----
 
----
 
Also wont work if module is in commnets or something,
Dont know but its not working for me. vim seems to be kind of hanging then i press C-C to break it.
 
 
I guess better solution would be to exclusively search for module
mine is VIM version 6.0
 
 
I think the following will avoid both of the problems.
BTW but if some signals are having &lt;module&gt; in the signal names?
 
  +
<pre>
wont work i think!
 
 
:map <F6> ma?^\s*\<module\><CR>Wyiw'a:echo "module -->" @0<CR>
any comments.
 
  +
</pre>
   
vjiron--AT--yahoo.com
 
, October 12, 2003 7:15
 
 
----
 
----
  +
Here's a version which doesn't pollute your search history:
this will not work if u have module ith names line module_AND...
 
   
  +
<pre>
inti.rajesh--AT--analog.com
 
  +
map ` :let old = @/<CR>ma?module<CR>Wyiw'a:call histdel('search',-1)<CR>:let @/ = old<CR>:echo "module -->" @0<CR>
, October 20, 2003 10:25
 
  +
</pre>
----
 
Also wont work if module is in commnets or something,
 
i guess better solution would be to exclusively search for module
 
i think the following will avoid both of the problems.
 
   
  +
----I added a space after module to help when module is part of a name. Now I'd like to expand it or add another mapping to traverse up hierarchy.
:map &lt;F6&gt; ma?^\s*\&lt;module\&gt;&lt;CR&gt;Wyiw'a:echo "module --&gt;" --AT--0&lt;CR&gt;
 
 
vjiron--AT--yahoo.com
 
, January 2, 2007 2:21
 
----
 
can smone tell me how this works!!!plz
 
 
noname
 
, January 6, 2007 2:42
 
----
 
<!-- parsed by vimtips.py in 0.487451 seconds-->
 

Latest revision as of 22:07, 2 February 2016

Tip 534 Printable Monobook Previous Next

created 2003 · complexity basic · author rajesh · version 5.7


For all verilog users dealing with netlists, this an easier way to find out in which module you are really working in.add this map to your vimrc. Press ` to find out which module you are actually residing in.

map ` ma?module<CR>Wyiw'a:echo "module -->" @0<CR>

This map works only when you are within the module. Placing it on module/endmodule does not make any sense.

Comments[]

An improved version of this if you are using a searching for a particular net/wire and then u want to know in which module you are really in. Add this to your vimrc

map ` ma?module<CR>Wyiw'a/<Up><Up><CR>:echo "module -->" @0<CR>

If you are not searching for any particular net the above map will do.


It's not working for me. Vim seems to be kind of hanging then i press C-C to break it. BTW but if some signals are having <module> in the signal names? Won't work i think!


This will not work if you have module with names line module_AND...


Also wont work if module is in commnets or something, I guess better solution would be to exclusively search for module I think the following will avoid both of the problems.

:map <F6> ma?^\s*\<module\><CR>Wyiw'a:echo "module -->" @0<CR>

Here's a version which doesn't pollute your search history:

map ` :let old = @/<CR>ma?module<CR>Wyiw'a:call histdel('search',-1)<CR>:let @/ = old<CR>:echo "module -->" @0<CR>

I added a space after module to help when module is part of a name. Now I'd like to expand it or add another mapping to traverse up hierarchy.