Wikia

Vim Tips Wiki

Changes: For verilog users only

Edit

Back to page

(Remove html character entities)
(Change <tt> to <code>, perhaps also minor tweak.)
 
Line 4: Line 4:
 
|previous=533
 
|previous=533
 
|next=535
 
|next=535
|created=August 19, 2003
+
|created=2003
 
|complexity=basic
 
|complexity=basic
 
|author=rajesh
 
|author=rajesh
Line 12: Line 12:
 
|category2=
 
|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]]. Press <tt>`</tt> to find out which module you are actually residing in.
+
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>
 
<pre>
 
map ` ma?module<CR>Wyiw'a:echo "module -->" @0<CR>
 
map ` ma?module<CR>Wyiw'a:echo "module -->" @0<CR>

Latest revision as of 05:34, July 13, 2012

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.

CommentsEdit

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>

Around Wikia's network

Random Wiki