I ran into a slight problem with vi jumping to a variable definition and not function when both have the same name.
Does anybody know if I can influence ctags to give preference to function over the variable?
Details of my setup:
in $MYLIB/myedi.h I have a struct with
in it.
in $SHLIB/mycode.c I have a function procname (old, new, off_days) { ... }
in $MYCODE directory I have a bunch of .c and .h files, the makefile that builds an executable and updates tags like this
The ctags is
The resulting tags file has following:
So, when in vi (vim 7.0) I press ctrl-] (vi's jump to command) I am landing in the mylib/edi.h, but my intesion is to jump to the function instead.
I haven't looked at the vim code, but I believe that when you have multiple entries in your ctags file with the same tag, the one you'll go to with the vi ctl-] command varies depending on what else is in the ctags file. (I.e., you won't always go to the first matching definition found in the ctags file.)
One thing I used to do when ctl-] took me to the wrong entry was to edit the crags file (:e ctags), search for the matching entries (:g/^tag/p), and then edit the file that contained the tag I wanted. (The entry in the ctags will will give you both the filename and the line or search pattern in that file you need to get to the entry you want.)
You can also manually edit the ctags file to only contain function names (or at least to remove the entries with duplicate names that you are least likely to want to jump to in vi).
Hope this helps.
These 2 Users Gave Thanks to Don Cragun For This Post:
updateEnvironmentField() {
linewithoutquotes=`echo $LINE | tr -d '"'`
b()
}
I want to pass variable named $linewithoutquotes to another method called b(), which is called from updateEnvironmentField() method. How to do the above requirement with shell script (1 Reply)
Hello All,
I would like to ask help from you on how to pass variable value from a function that has been called inside the function. I have created below and
put the variables in " ". Is there another way I can do this? Thank you in advance.
readtasklist() {
while read -r mod ver... (1 Reply)
hi all
this is my function
#! /bin/sh
awk '/ Type/ { print "m;" $4 } /IDf/ {print $3 } /IuSac/ { print $3 } /IuSac/ { print $1 }' / IBM.txt |tr '\n' ';'| perl -pi -e 's/;m//g'|cut -d ";" -f 2-5 ' >> 2m
1) i wanna make it to save output of awk in a file named by date in order not to... (3 Replies)
Hello again :)
Am currently trying to write a function which will delete a record from a file.
The code currently looks as such:
function deleteRecord() {
clear
read -p "Please enter the ID of the record you wish to remove: " strID
... (2 Replies)
Hi Forum
Can anyone tell me whats wrong with my script. What i want to do read in values from a input file using a while loop then taking that input from the file into a function that i created. Every time i execute the script it goes through the while loop but the function doesn't see the... (10 Replies)
Hi All,
As per my understanding, value of variable is retained outside function.
But the value of array myarrayDriver is not retained outside function. Could you please tell the reason for the same..
code:
readingConfigFile()
{
search_keyword="$1"
i=0
for pointer in $(cat... (7 Replies)
Hey folks,
I'm pretty new to unix programming. I was trying to get something to work but it's not doing what I expected.
#!/bin/ksh
. ./functions.sh
STRING=function_1
FUNCTION="$STRING"
RETURN=eval $FUNCTION
echo "value of $FUNCTION function is: $RETURN"
All i'm... (5 Replies)
Hi ,
I have three funcions f1, f2 and f3 .
f1 calls f2 and f2 calls f3 .
I have a global variable "period" which i want to pass to f3 .
Can i pass the variable directly in the definition of f3 ?
Pls help .
sars (4 Replies)
I would like to know how to pass a variable inside a variable to a function.
sample code below
--------------
for x in 1 9
do
check_null $C$x ##call function to check if the value is null
if
then
echo "line number:$var_cnt,... (2 Replies)
Hi,
I am trying to sum up numbered columns and in order to tidy up the program I have wrote a function to do the adding of some numbers. I have a problem though with passing a variable to the function in the UNIX bash shell. The function only gives the first number in the variable list and does... (4 Replies)